A stray+extraneous 'netif_napi_add()' that we were doing in
visornic_probe() was causing havoc when we got into visornic_remove(),
called during 'modprobe -r visornic'. The symptom was a processor busy-wait
loop on the modprobe process, which '/proc/<pid>/stack' would show looping
doing napi things.
Presumably the stray line got there as a result of some merging snafoo, and
has been deleted to fix the problem. With this patch 'modprobe -r visornic'
and a subsequent 'modprobe visornic' both complete successfully, and result
in an operational network.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simplifies kobject usage in visorchipset.c by combining pairs of functions
that are better expressed combined.
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Checks the controlvm message's payload size before copying it into a
parser_context struct's name region.
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Removes struct safe_uis_queue, which is within struct visorchannel. The
struct is not used anywhere in the s-Par drivers.
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove spaces around parenthesized expression to conform to the
kernel coding style. Issue found by checkpatch.pl script.
Signed-off-by: Miquel Raynal <raynal.miquel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The incorrect or operator is being used resulting in cookies being
set to 1 (true) rather than the intended hex value. Fix this by
using | instead of ||.
Issue found with static analysis with cppcheck
Fixes: 0cec463e39 ("staging: bcm2835-audio: Simplify callback structure for write data")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lustre uses a fake switch() statement as a compile-time assert, but unfortunately
each use of that causes a warning when building with clang:
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2907:2: warning: no case matching constant switch condition '42'
drivers/staging/lustre/lnet/klnds/socklnd/../../../include/linux/libcfs/libcfs_private.h:294:36: note: expanded from macro 'CLASSERT'
#define CLASSERT(cond) do {switch (42) {case (cond): case 0: break; } } while (0)
As Greg suggested, let's just kill off this macro completely instead of
fixing it. This replaces it with BUILD_BUG_ON(), which means we have
to negate all the conditions in the process.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
I got a link error in allyesconfig:
drivers/staging/media/platform/bcm2835/bcm2835-camera.o: In function `vidioc_enum_framesizes':
bcm2835-camera.c:(.text.vidioc_enum_framesizes+0x0): multiple definition of `vidioc_enum_framesizes'
drivers/media/platform/vivid/vivid-vid-cap.o:vivid-vid-cap.c:(.text.vidioc_enum_framesizes+0x0): first defined here
While both drivers are equally at fault for this problem, the bcm2835 one was
just added and is easier to fix, as it is only one file, and none of its symbols
need to be globally visible. This marks the three global symbols as static.
Fixes: 7b3ad5abf0 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
gcc-7 warns about debug statements being left out here:
drivers/staging/bcm2835-audio/bcm2835-vchiq.c: In function 'bcm2835_audio_set_ctls':
drivers/staging/bcm2835-audio/bcm2835-vchiq.c:572:54: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
It's better to use no_printk(), which has the added advantage of checking
the format strings.
Fixes: 23b028c871 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The driver introduces a new instance of the missing-include-dirs warning that
is enabled at the "make W=1" level but has no other output:
cc1: error: /git/arm-soc/drivers/staging/vc04_services/interface/vcos/linuxkernel: No such file or directory [-Werror=missing-include-dirs]
In order to let us enable the warning by default in the future, we should
just remove the incorrect argument here.
Fixes: 23b028c871 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The driver introduces a new instance of the missing-include-dirs warning that
is enabled at the "make W=1" level but has no other output:
cc1: error: drivers/staging/vc04_services/interface/vcos/linuxkernel: No such file or directory [-Werror=missing-include-dirs]
cc1: all warnings being treated as errors
scripts/Makefile.build:307: recipe for target 'drivers/staging/media/platform/bcm2835/bcm2835-camera.o' failed
In order to let us enable the warning by default in the future, we should
just remove the incorrect argument here.
Fixes: 97b35807cc ("staging: bcm2835-v4l2: Add a build system for the module.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function vchi_msg_queue was made static in vc04_services
and replaced with vchi_queue_kernel_message.
Change the call to vchi_msg_queue to vchi_queue_kernel_message
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function vchi_msg_queue was made static in vc04_services
and replaced with vchi_queue_kernel_message.
Change the call to vchi_msg_queue to vchi_queue_kernel_message
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This also involves a merge of the ib-mid-iio-pwm-4.11 branch from mfd to
bring in support for the stm32 timer triggers needed for the buffered
features in the stm32 adc driver.
New device support:
* Amligic Meson SAR ADC
- new driver and bindings
* cros_ec barometer
- new driver
* max5481 digital potentiometers
- new driver for 5481, 5482, 5483 and 5484
* Renesas GyroADC - a very specific spi offload engine for ADCs
- new driver and bindings.
* srf08 ultrasonic ranger
- new driver, bindings and ABI docs,
New features
* Qualcomm PM8xxx ADC bindings.
- due to a trivial build issues the driver will be following shortly.
* stm32 ADC
- Triggered buffer mode
- Allow use of stm32 timer triggers
- Add trigger polarity control
- Optional DMA support with bindings update
* stx104
- add support for gpio names
- support set_multiple callback
* tmp007
- optional interrupt support
Cleanups
* ad7150
- alignment fix.
* ad7816
- octal rather than symbolic permissions.
* lsm6dsx
- allow selection of data ready pin via device tree bindings.
* ssp_sensors
- use devm_iio_device_register to handle unregister automatically.
* stx104
- use devm functions in probe allowing removal or the remove function.
- drop unneeded struct stx104_dev
* tmp007
- fix the name attribute to be a meaninful description of the part.
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAliSM5IRHGppYzIzQGtl
cm5lbC5vcmcACgkQVIU0mcT0FogLaBAApj79bVoAcO+aznbW1ipg1sZEl8617610
60Wq23pXqQRVi8osklnsUC+PBEdQhpGq8ijDMppjJD7ta3UEUBEFDUTAEWnkfugb
B65H0XVO2m0ZCyEh7mqb9R9PXK/et1YU1Wj0Q7VTLDqX3oUCg4tPNDI+VBsA5ZFa
OWFtDEiSY9GpLiotUi9cGGAx+qt1pOzimukrZkIFwt+UXju4rCySLymjESv++G7+
3Kqumvjz+BQqWqqEcj2X0SYORDadpTNkS/3z477Kc4b4ykYsuRIHYM+zrDAtziKu
Yxd2aggnFkM3BSvk1Uld0WM9xpwBuCMOZVvN8S0QkkNGIvrM/faWsH4UmANkmDeG
dtldakTp7rHrWi8bGvzVXswXELANyDL7+SB/MWqJhf3LqLnt5KM0DoFxxGfUWuXG
bg3yGwgxxOaUrZJIqxVXGHOiYK+TA3fU/dz0+qp/rbtLV0bbF9TMST0UH5o2+cXy
NkisXiAQSWXRV6YMNiMwEoqt5d3SuUJb0bcryMeIPl3bbjc2YBQPo5n/2Q7UWsWt
GdFwuw9Y6IvRw61RQRceGjEs5sVIUXm2JnRdOFluJA1YDb3WUfxrA8lL4M08ZCa5
bt+tGtf1SCRcTeourYzn7+xMVvCurRA62p5DOkFKeJ8Ck+tr6eTyP3gE5shdzVrv
skwSqrkRUPg=
=smLx
-----END PGP SIGNATURE-----
Merge tag 'iio-for-4.11c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Third set of new device support, features and cleanups for IIO in the 4.11 cycle
This also involves a merge of the ib-mid-iio-pwm-4.11 branch from mfd to
bring in support for the stm32 timer triggers needed for the buffered
features in the stm32 adc driver.
New device support:
* Amligic Meson SAR ADC
- new driver and bindings
* cros_ec barometer
- new driver
* max5481 digital potentiometers
- new driver for 5481, 5482, 5483 and 5484
* Renesas GyroADC - a very specific spi offload engine for ADCs
- new driver and bindings.
* srf08 ultrasonic ranger
- new driver, bindings and ABI docs,
New features
* Qualcomm PM8xxx ADC bindings.
- due to a trivial build issues the driver will be following shortly.
* stm32 ADC
- Triggered buffer mode
- Allow use of stm32 timer triggers
- Add trigger polarity control
- Optional DMA support with bindings update
* stx104
- add support for gpio names
- support set_multiple callback
* tmp007
- optional interrupt support
Cleanups
* ad7150
- alignment fix.
* ad7816
- octal rather than symbolic permissions.
* lsm6dsx
- allow selection of data ready pin via device tree bindings.
* ssp_sensors
- use devm_iio_device_register to handle unregister automatically.
* stx104
- use devm functions in probe allowing removal or the remove function.
- drop unneeded struct stx104_dev
* tmp007
- fix the name attribute to be a meaninful description of the part.
The Apex Embedded Systems STX104 series provides a digital output
register where 4 lines may be set at a time. This patch add support for
the set_multiple callback function, thus allowing multiple digital
output lines to be set more efficiently in groups.
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This adds the device tree bindings for the Qualcomm PM8xxx
ADCs. This is based on the existing DT bindings for the
SPMI ADC so there are hopefully no controversial features.
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: Ivan T. Ivanov <iivanov.xz@gmail.com>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Rama Krishna Phani A <rphani@codeaurora.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch sets the gpio_chip names option with an array of GPIO line
names that match the manual documentation for the Apex Embedded Systems
STX104. This should make it easier for users to identify which GPIO line
corresponds to a respective GPIO pin on the device.
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The vchi_msg_queue function which is used by other drivers
to queue a message is difficult to understand and overly
generic.
Make the function static and remove it from the exported
symbols.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The vchi_msg_queue function which is used by other drivers
to queue a message is difficult to understand and overly
generic.
Add a new function which is a wrapper on top of vchi_msg_queue
that is specifically for queuing a message located in user
address space.
int
vchi_queue_user_message(VCHI_SERVICE_HANDLE_T handle,
void __user *data,
unsigned int size)
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The vchi_msg_queue function which is used by other drivers
to queue a message is difficult to understand and overly
generic.
Add a new function which is a wrapper on top of vchi_msg_queue
that is specifically for queuing a message located in kernel
address space.
int
vchi_queue_kernel_message(VCHI_SERVICE_HANDLE_T handle,
void *data,
unsigned int size)
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The device sends data to the audio devices by sending a message with
the data through VC04_SERVICES/VCHIQ. This message contains a
callback pointer that is always filled in with the same function.
This is prone to corruption issues.
Instead fill the callback fields with a fixed cookie value to perforam
some validation on the message response and call the handler function
directly instead of through the callback pointer.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The bcm2835-audio driver has a legacy code path for initializing
devices without a device tree. Delete this code path and remove
the non device tree devices.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add a TODO list of possible cleanup items.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Generated with checkpatch.pl --fix-inplace and git add -p out of the
results.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Generated with checkpatch.pl --fix-inplace, some manual fixes for
cases where checkpatch fixed one out of multiple lines of mis-indented
function parameters, and then git add -p out of the results.
I skipped some fixes that should probably instead be replaced with the
BIT() macro.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is derived from the downstream tree's build system, but with just
a single Kconfig option.
For now the driver only builds on 32-bit arm -- the aarch64 build
breaks due to the driver using arm-specific cache flushing functions.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
49bec49fd7 ("staging: vc04_services: remove vchiq_copy_from_user")
removed the flags/msg_handle arguments, which were unused, and pushed
the implementation of copying using memcpy vs copy_from_user to the
caller.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- Supports raw YUV capture, preview, JPEG and H264.
- Uses videobuf2 for data transfer, using dma_buf.
- Uses 3.6.10 timestamping
- Camera power based on use
- Uses immutable input mode on video encoder
This code comes from the Raspberry Pi kernel tree (rpi-4.9.y) as of
a15ba877dab4e61ea3fc7b006e2a73828b083c52.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fix some spelling typos found in visornic_main.c
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Conversion macros le16_to_cpu was removed and that caused new sparse warning
sparse output:
drivers/staging/wlan-ng/p80211netdev.c:241:44: warning: incorrect type in argument 2 (different base types)
drivers/staging/wlan-ng/p80211netdev.c:241:44: expected unsigned short [unsigned] [usertype] fc
drivers/staging/wlan-ng/p80211netdev.c:241:44: got restricted __le16 [usertype] fc
Fixes: 7ad8257234 ("staging:wlan-ng:Fix sparse warning")
Signed-off-by: Igor Pylypiv <igor.pylypiv@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
A style fix across whole driver.
changed permissions to octal style, found using checkpatch
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The IIO ABI specifies the name field of the IIO device as:
Description of the physical chip / device for device X.
Typically a part number.
The tmp007 driver currently uses the name of the parent device instead.
Change this to the part name to be in accordance with the ABI.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The stx104_dev structure was used to hold private data for use in the
stx104_remove function. Now that the stx104_remove function is gone, the
stx104_dev structure and relevant code is no longer needed. This patch
removes the unnecessary code.
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add DMA optional support to STM32 ADC, as there is a limited number DMA
channels (request lines) that can be assigned to ADC. This way, driver
may fall back using interrupts when all DMA channels are in use for
other IPs.
Use dma cyclic mode with two periods. Allow to tune period length by
using watermark. Coherent memory is used for dma (max buffer size is
fixed to PAGE_SIZE).
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
STM32 ADC can use dma. Add dt documentation for optional dma support.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Define extended attribute so that user may choose rising, falling or both
edges for external trigger sources.
Default to rising edge in case it isn't set.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
STM32 ADC has external timer trigger sources. Use stm32 timer triggers
API (e.g. is_stm32_timer_trigger()) with local ADC lookup table to
validate a trigger can be used.
This also provides correct trigger selection value (e.g. extsel).
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
STM32 ADC conversions can be launched using hardware triggers.
It can be used to start conversion sequences (group of channels).
Selected channels are select via sequence registers.
Trigger source is selected via 'extsel' (external trigger mux).
Trigger polarity is set to rising edge by default.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJYiNNFAAoJEFGvii+H/HdhqSEP/jNBWmiCKvci3hR0T6ujyqoR
A7GM5soFkw25ZWi0hRPYUewA4KOn+laFnHJsHfx6h2fTeZHk3Phx/9f6uBhVENG5
gSmAkSTsRaFGUyDU1Enq6hH9CIhdUuJh2ybIc2Fq8T1Z8hg3sGjcDfBC8T3uT/fM
y1fdlhNzlSB1DnRO9niHQJMCGXRx7V6C4jH9epxXY2Tf5WjcFgQTpf7XrXyz7gxy
8Zn1oLHt6nT6H70AHb3hbV48IVcVVpIN/qVHMDAXd8kvTTFh7OTi7zJIGqQKzOFr
y83mv5fBF6V67WOLsRcd0diNgOUSFLxxp4D2j8EAjSB386V+9wfm42A04z9HNXE5
XD2gmaVpm0H3OH3YjOHo+s/lbWAYvzb3NJ0pOHXis8dcKGW/3MH33cWHsUBe+ytv
SOfd9u+OYbe0o2xKPUVIF6m/HXrLqWBM5+wT2F/5Z0nbIXlhXK96km4T16JD5L+A
QWyilHmP/shDCuZ4ORl7sf0V/FY7BicOzPBpHZKOGjX+3RmCn1fo++WgdFIyVkCG
tvIUtSONxeidaDUJ8J1tn2OR8DtdyMag7pagzypZF4JSpjfJ+IMj/6wFftgTzZgh
yDtkfUYk9sJsBy3Bp1pfcVrcnERlIq7FND9HySQTbRFRX0+5ARx7ZXzjqidKHy6l
yvFfnhxy1vcy8RdEh21e
=tG0h
-----END PGP SIGNATURE-----
Merge tag 'ib-mfd-iio-pwm-4.11' into test
Immutable branch between MFD, IIO and PWM due for the v4.11 merge window
Pulled into IIO to allow follow up series of triggered capture for the
STM32 ADCs.
Add sysfs-bus-iio-distance-srf08 for individual attributes of the driver,
especially:
- sensitivity which the device documentation calls gain for amplifying the
signal
- max_range for limiting the maximum distance for expected echos and
therefore limiting the time waiting for telegrams
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This is the IIO driver for devantech srf08 ultrasonic ranger which can be
used to measure the distances to an object.
The sensor supports I2C with some registers.
Supported Features include:
- read the distance in ranging mode in centimeters
- output of the driver is directly the read value
- together with the scale the driver delivers the distance in meters
- only the first echo of the nearest object is delivered
- set sensitivity as analog value in the range of 0-31 means setting
gain register on device
- set range registers; userspace enters max. range in millimeters in
43 mm steps
Features not supported by this driver:
- ranging mode in inches or in microseconds
- ANN mode
- change I2C address through this driver
- light sensor
The driver was added in the directory "proximity" of the iio subsystem and
the menu in den config is now called "Proximity and distance sensors"
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
- Add DT binding for devantech,srf08
- Add vendor devantech to vendor list
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The devm_ resource manager functions allow memory to be automatically
released when a device is unbound. This patch takes advantage of the
resource manager functions and replaces the gpiochip_add_data call and
iio_device_register call with the devm_gpiochip_add_data call and
devm_iio_device_register call respectively. In addition, the
stx104_remove function has been removed as no longer necessary due to
the use of the relevant devm_ resource manager functions.
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add st,drdy-int-pin property to select interrupt pin of the package
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add capability to route data ready signal on pin 1 or pin 2 of the package
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This adds support for the SAR (Successive Approximation Register) ADC
on the Amlogic Meson SoCs.
The code is based on the public S805 (Meson8b) and S905 (GXBB)
datasheets (see [0] and [1]), as well as by reading (various versions
of) the vendor driver and by inspecting the registers on the vendor
kernels of my testing-hardware.
Currently the GXBB, GXL and GXM SoCs are supported. GXBB hardware has
10-bit ADC resolution, while GXL and GXM have 12-bit ADC resolution.
The code was written to support older SoCs (Meson8 and Meson8b) as well,
but due to lack of actual testing-hardware no of_device_id was added for
these.
Two "features" from the vendor driver are currently missing:
- the vendor driver uses channel #7 for calibration (this improves the
accuracy of the results - in my tests the results were less than 3%
off without calibration compared to the vendor driver). Adding support
for this should be easy, but is not required for most applications.
- channel #6 is connected to the SoCs internal temperature sensor.
Adding support for this is probably not so easy since (based on the
u-boot sources) most SoC versions are using different registers and
algorithms for the conversion from "ADC value" to temperature.
Supported by the hardware but currently not supported by the driver:
- reading multiple channels at the same time (the hardware has a FIFO
buffer which stores multiple results)
- continuous sampling (this would require a way to enable this
individually because otherwise the ADC would be drawing power
constantly)
- interrupt support (similar to the vendor driver this new driver is
polling the results. It is unclear if the IRQ-mode is supported on
older (Meson6 or Meson8) hardware as well or if there are any errata)
[0]
http://dn.odroid.com/S805/Datasheet/S805_Datasheet%20V0.8%2020150126.pdf
[1] http://dn.odroid.com/S905/DataSheet/S905_Public_Datasheet_V1.1.4.pdf
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This adds the devicetree binding documentation for the SAR ADC found in
Amlogic Meson SoCs.
Currently only the GXBB, GXL and GXM SoCs are supported.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>