aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac/ad5755.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-08-22iio:dac: drop assignment of iio_info.driver_moduleJonathan Cameron1-1/+0
The equivalent of this is now done via macro magic when the relevant register call is made. The actual structure element will shortly go away. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-08-29iio: ad5755: fix off-by-one on devnr limit checkColin Ian King1-1/+1
The comparison for devnr limits is off-by-one, the current check allows 0 to AD5755_NUM_CHANNELS and the limit should be in fact 0 to AD5755_NUM_CHANNELS - 1. This can lead to an out of bounds write to pdata->dac[devnr]. Fix this by replacing > with >= on the comparison. Signed-off-by: Colin Ian King <colin.king@canonical.com> Fixes: c947459979c6 ("iio: ad5755: add support for dt bindings") Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-27iio: ad5755: add support for dt bindingsSean Nyekjaer1-1/+187
Devicetree can provide platform data Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-28spi: Drop owner assignment from spi_driversAndrew F. Davis1-1/+0
An spi_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2013-12-17iio:dac:ad5755 replaces IIO_ST macro with explicit entries to struct scan_typeJonathan Cameron1-1/+6
IIO_ST is going away as it is a pain to maintain. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-12-03iio:ad5755: Mark transfer buffer as __be32Lars-Peter Clausen1-1/+1
Fixes the following warnings from sparse: drivers/iio/dac/ad5755.c:117:25: warning: incorrect type in assignment (different base types) drivers/iio/dac/ad5755.c:117:25: expected unsigned int [unsigned] [usertype] d32 drivers/iio/dac/ad5755.c:117:25: got restricted __be32 [usertype] <noident> drivers/iio/dac/ad5755.c:171:25: warning: incorrect type in assignment (different base types) drivers/iio/dac/ad5755.c:171:25: expected unsigned int [unsigned] [usertype] d32 drivers/iio/dac/ad5755.c:171:25: got restricted __be32 [usertype] <noident> drivers/iio/dac/ad5755.c:172:25: warning: incorrect type in assignment (different base types) drivers/iio/dac/ad5755.c:172:25: expected unsigned int [unsigned] [usertype] d32 drivers/iio/dac/ad5755.c:172:25: got restricted __be32 [usertype] <noident> drivers/iio/dac/ad5755.c:176:23: warning: cast to restricted __be32 drivers/iio/dac/ad5755.c:176:23: warning: cast to restricted __be32 drivers/iio/dac/ad5755.c:176:23: warning: cast to restricted __be32 drivers/iio/dac/ad5755.c:176:23: warning: cast to restricted __be32 drivers/iio/dac/ad5755.c:176:23: warning: cast to restricted __be32 drivers/iio/dac/ad5755.c:176:23: warning: cast to restricted __be32 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-24iio: dac: ad5755: Use devm_iio_device_registerSachin Kamat1-11/+1
devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: dac: ad5755: Remove redundant codeSachin Kamat1-7/+1
The if check is redundant as the value obtained from iio_device_register() is already in the required format. Error messages are already printed by iio_device_register(); hence not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-01iio:ad5755: Report scale as fractional valueLars-Peter Clausen1-12/+5
Move the complexity of calculating the fixed point scale to the core. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-15iio: refactor info mask and ext_info attribute creation.Jonathan Cameron1-0/+1
Introduce an enum to specify whether the attribute is separate or shared. Factor out the bitmap handling for loop into a separate function. Tidy up error handling and add a NULL assignment to squish a false positive warning from GCC. Change ext_info shared type from boolean to enum and update in all drivers. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2013-08-19iio: dac: ad5755: Use devm_iio_device_allocSachin Kamat1-10/+4
Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17iio:dac:ad5755 move to info_mask_(shared_by_type/separate)Jonathan Cameron1-5/+5
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-02-09iio: Use spi_sync_transfer()Lars-Peter Clausen1-6/+1
Use the new spi_sync_transfer() helper function instead of open-coding it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-03Drivers: iio: remove __dev* attributes.Greg Kroah-Hartman1-8/+8
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-22iio: dac/ad5755: signedness bug in ad5755_setup_pdata()Dan Carpenter1-1/+1
We need "ret" to be signed for the error handling to work correctly. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-17iio:dac: Add ad5755 driverLars-Peter Clausen1-0/+650
This patch adds support for the AD5755, AD5755-1, AD5757, AD5735, AD5737 16 and 14 bit quad-channel DACs. The AD5757/AD5737 only have current outputs, but for the AD5755/AD5757 each of the outputs can be configured to either be a voltage or a current output. We only allow to configure this at device probe time since usually this needs to match the external circuitry and should not be changed on the fly. A few trivial formatting changes on merge. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>