This code was cut and pasted in several places. It's missing some
unlocks on error.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Looks like this moved into the core at somepoint and kfifo buf got left
behind.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This mean all sorts of interesting results on driver removal.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
A number of these register indexes were not set or actually wrong.
This only effects sysfs reads.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Remove the driver's get_sensor_data() interfaces and replace them with
iio_chan_spec channels. This converts 4 files to the new framework.
Driver ABI change: The intensity_infrared_raw file is now intensity_ir_raw.
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Add "proximity" to the iio_chan_type_name_spec_shared string list to
support proximity sensors.
Now this list fully matches the declared iio_chan_type enums.
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This makes comparison between the iio_chan_type_name_spec_shared strings
and the iio_chan_type enums easier.
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The I2C clientdata is set to indio_dev instead of chip as of a couple weeks ago.
Correct the calls to i2c_get_clientdata() accordingly.
Otherwise the driver fails to initialize.
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
There are a couple places here where we should have called
mutex_unlock() before returning.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Defaulting to 1, this gives a way to amplify the lux value before being
reduced by the programmed adc_bit shift.
Only support whole numbers right now. When this driver is converted to the new
IIO_CHAN framework, it will be easy to support the framework's pseudo float.
Add illuminance0_calibscale documentation to sysfs-bus-iio-light.
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
There were some uninitialized variable warnings in iio. Two of
these came from the recent changes to how the private data was
allocated in 83f0422dc6 "staging:iio:accel:sca3000: allocate
state in iio_dev and use iio_priv to access."
drivers/staging/iio/accel/sca3000_core.c: In function 'sca3000_probe':
drivers/staging/iio/accel/sca3000_core.c:1137:9: warning: 'st' may be used uninitialized in this function
drivers/staging/iio/adc/ad7291.c: In function 'ad7291_probe':
drivers/staging/iio/adc/ad7291.c:805:15: warning: 'chip' may be used uninitialized in this function
drivers/staging/iio/dac/ad5624r_spi.c: In function 'ad5624r_probe':
drivers/staging/iio/dac/ad5624r_spi.c:228:24: warning: 'st' may be used uninitialized in this function
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This handles the merge conflicts with the
drivers/staging/brcm80211/Kconfig file due to changes on the two
different branches.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is so we can support it on x86 SMBUS adapters.
Since i2c adapters which do not provide an smbus_xfer interface fall
back to using their I2C master_xfer interface, all the i2c_master_send()
calls in this driver are changed to i2c_smbus_*() calls.
This will fail on an i2c adapter that implements a proper subset of
(SMBUS_BYTE | SMBUS_BYTE_DATA | SMBUS_WORD_DATA), but I do not see that
in any of our adapters today.
This results in a few wrapper functions that provide little additional
functionality, so remove them and call the smbus functions directly from
the general driver code.
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Add the required read/write_raw functions to the tsl2563_info_no_irq data
structure. This structure is used insted of tsl2563_info when the I2C client
has no IRQ.
The absence of these functions causes a panic when reading or writing the
created sysfs files.
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Add a wrapper for this driver around the IIO_CHAN() wrapper to make channel
parameters more readable. This fixes a panic caused by the info_masks being
accidentally passed in as channel2 parameters which easily surpass the size
of the iio_modifier_names_light array.
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Same problem as seen and fixed in adis16204 et al.
These were fixed by Randy in:
staging: fix more iio builds when IIO_RING_BUFFER is not enabled
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
In the error handling, it dereferences "st" before it has been
initialized. I also just tidied it up a bit to remove some extra
conditions.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
No point to start comments with '\'.
Signed-off-by: maximilian attems <max@stro.at>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
New driver for AD5686R, AD5685R, AD5684R Quad channel digital to analog converters
Changes since V1:
drop header file
use strtobool()
Fix dev attribute macros
Reorder probe() function
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Add IIO_OUT type for DAC like devices
In case of IIO_OUT make sure the channel device attribute is writable
Ideally we add a flag to iio_chan_spec that tells the core that
the channel device attribute is writable...
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
New driver for AD7792/AD7793 3-Channel, Low Noise,
Low Power, 16-/24-Bit Sigma-Delta ADC with On-Chip In-Amp
and Reference.
The AD7792/AD7793 features a dual use data out ready DOUT/RDY output.
In order to avoid contentions on the SPI bus, it's necessary to use
spi bus locking. The DOUT/RDY output must also be wired to an
interrupt capable GPIO.
In INDIO_RING_TRIGGERED mode, this driver may block its SPI bus segment
for an extended period of time.
Changes since V1:
Use bool where applicable.
Use data buffer that lives in their own cache line.
Restructure ad7793_calibrate_all to use an array.
Use msleep.
Query REG_ID instead of doing a write/read This is a test.
Add support for unipolar mode.
Drop range attribute in favor of write scale.
Add proper locking.
Use new validate_trigger callbacks.
Use IIO_IN_DIFF for differential channels.
Change attribute naming.
Use available_scan_masks.
Some other miscellaneous cleanup (none functional changes).
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Basically use various new facilities to tidy up.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Here the ordering is a little tricky, so to keep changes minimal, a copy of the gpio
number is introduced.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Very simple driver, so not much to do.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
I've currently squashed the vel + pos combined attribute. If people need them
precisely paired I doubt they will get them from the sysfs interface anyway.
If that is a requirement it should come via a buffer implementation.
Note this patch leaves the completely non standard interface alone.
That will get fixed later.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Note I haven't made any changes to the userspace interface as yet.
This is all about cleaning up what was actually there (handling
all errors etc).
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Requires moving a few things around, but should be no functional changes.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is still a very odd driver.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The main attribute group was placed under driver name for some reason.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>