aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac/ad5755.c
AgeCommit message (Collapse)Author
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177Thomas Gleixner
Based on 1 normalized pattern(s): licensed under the gpl 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 135 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Steve Winslow <swinslow@gmail.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528170026.071193225@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22iio:dac: drop assignment of iio_info.driver_moduleJonathan Cameron
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 King
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 Nyekjaer
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. Davis
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 Cameron
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 Clausen
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 Kamat
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 Kamat
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 Clausen
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 Cameron
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 Kamat
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 Cameron
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 Clausen
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-Hartman
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 Carpenter
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 Clausen
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>