aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac/ad5686.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-08-19drivers: iio: Update MODULE AUTHOR email addressMichael Hennerich1-1/+1
no functional changes Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-06-10iio:dac:ad5686: Add AD5311R supportStefan Popa1-0/+7
AD5311R is a single channel DAC with 10-bit precision and i2c interface. The device includes a 2.5V internal reference which is enabled by default. This device is similar to AD5691R/AD5692R/AD5693/AD5693R, the only difference is that it has 10-bit precision. Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5310R_5311R.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20iio:dac:ad5686: Add AD5681R/AD5682R/AD5683/AD5683R supportStefan Popa1-0/+32
The AD5681R/AD5682R/AD5683/AD5683R are a family of one channel DACs with 12-bit, 14-bit and 16-bit precision respectively. The devices have either no built-in reference, or built-in 2.5V reference. These devices are similar to AD5691R/AD5692R/AD5693/AD5693R except with a few notable differences: * they use the SPI interface instead of I2C * in the write control register, DB18 and DB17 are used for setting the power mode, while DB16 is the REF bit. This is why a new regmap type was defined and checked accordingly. * the shift register is 24 bits wide, the first four bits are the command bits followed by the data bits. As the data comprises of 20-bit, 18-bit or 16-bit input code, this means that 4 LSB bits are don't care. This is why the data needs to be shifted on the left with four bits. Therefore, AD5683_REGMAP is checked inside a switch case in the ad5686_spi_write() function. On the other hand, similar devices such as AD5693R family, have the 4 MSB command bits followed by 4 don't care bits. Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5683R_5682R_5681R_5683.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20iio:dac:ad5686: Add AD5691R/AD5692R/AD5693/AD5693R supportStefan Popa1-6/+87
The AD5691R/AD5692R/AD5693/AD5693R are a family of one channel DACs with 12-bit, 14-bit and 16-bit precision respectively. The devices have either no built-in reference, or built-in 2.5V reference. These devices are pretty similar to AD5671R/AD5675R and AD5694/AD5694R/AD5695R/AD5696/AD5696R, except that they have one channel. Another difference is that they use a write control register(addr 0x04) for setting the power down modes and the internal reference instead of separate registers for each function. Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5693R_5692R_5691R_5693.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15iio:dac:ad5686: Add AD5671R/75R/94/94R/95R/96/96R supportStefan Popa1-0/+28
The AD5694/AD5694R/AD5695R/AD5696/AD5696R are a family of 4 channel DACs with 12-bit, 14-bit and 16-bit precision respectively. The devices have either no built-in reference, or built-in 2.5V reference. The AD5671R/AD5675R are similar, except that they have 8 instead of 4 channels. These devices are similar to AD5672R/AD5676/AD5676R and AD5684/AD5684R/AD5684/AD5685R/AD5686/AD5686R, except that they use i2c instead of spi. Datasheets: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5671R_5675R.pdf http://www.analog.com/media/en/technical-documentation/data-sheets/AD5696R_5695R_5694R.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15iio:dac:ad5686: Refactor the driverStefan Popa1-162/+29
In this patch restructures the existing ad5686 driver by adding a module for SPI and a header file, while the baseline module deals with the chip-logic. This is a necessary step, as this driver should support in the future similar devices which differ only in the type of interface used (I2C instead of SPI). Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15iio:dac:ad5686: Add AD5672R/76/76R/84R/86R supportStefan Popa1-0/+46
The AD5684R/AD5686R are a family of 4 channel DACs with 12-bit, 14-bit and 16-bit precision respectively. The devices come either with a built-in reference or no built-in reference. The AD5672R/AD5676/AD5676R are similar, except that they have 8 channels instead of 4. Datasheets: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5672R_5676R.pdf http://www.analog.com/media/en/technical-documentation/data-sheets/AD5686R_5685R_5684R.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15iio:dac:ad5686: Add support for AD5685RStefan Popa1-3/+4
This driver acctually supports the AD5685R device and NOT the AD5685, which does not exist. Maintain old id entry in case we have devicetrees out there which are using the wrong name. More information can be found in the datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5686_5684.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15iio:dac:ad5686: Add support for various number of channelsStefan Popa1-20/+25
This patch adds a new num_channels attribute as part of the ad5686_chip_info struct which replaces the AD5686_DAC_CHANNELS define. This is a necessary step, since this driver should support similar devices which differ only in the number of channels. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15iio:dac:ad5686: Change license descriptionStefan Popa1-2/+1
Add GPLv2+ SPDX identifier and remove license notice to keep the whole purpose of using an SPDx id. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15iio:dac:ad5686: Style fixes no functional changesStefan Popa1-11/+14
This patch fixes some indentation issues and does not modify the functionality of the driver. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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>
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>
2015-02-04iio: ad5686: fix optional reference voltage declarationUrs Fässler1-1/+1
When not using the "_optional" function, a dummy regulator is returned and the driver fails to initialize. Signed-off-by: Urs Fässler <urs.fassler@bytesatwork.ch> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-03iio: ad5686: Remove redundant variableSachin Kamat1-2/+1
‘regdone’ is not used in the function. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-17iio:dac:ad5686 replaces IIO_ST macro with explicit entries to struct scan_typeJonathan Cameron1-2/+7
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:ad5686: Mark transfer buffer as __be32Lars-Peter Clausen1-1/+1
Fixes the following warnings from sparse: drivers/iio/dac/ad5686.c:100:25: warning: incorrect type in assignment (different base types) drivers/iio/dac/ad5686.c:100:25: expected unsigned int [unsigned] [usertype] d32 drivers/iio/dac/ad5686.c:100:25: got restricted __be32 [usertype] <noident> drivers/iio/dac/ad5686.c:122:25: warning: incorrect type in assignment (different base types) drivers/iio/dac/ad5686.c:122:25: expected unsigned int [unsigned] [usertype] d32 drivers/iio/dac/ad5686.c:122:25: got restricted __be32 [usertype] <noident> drivers/iio/dac/ad5686.c:124:25: warning: incorrect type in assignment (different base types) drivers/iio/dac/ad5686.c:124:25: expected unsigned int [unsigned] [usertype] d32 drivers/iio/dac/ad5686.c:124:25: got restricted __be32 [usertype] <noident> drivers/iio/dac/ad5686.c:130:16: warning: cast to restricted __be32 drivers/iio/dac/ad5686.c:130:16: warning: cast to restricted __be32 drivers/iio/dac/ad5686.c:130:16: warning: cast to restricted __be32 drivers/iio/dac/ad5686.c:130:16: warning: cast to restricted __be32 drivers/iio/dac/ad5686.c:130:16: warning: cast to restricted __be32 drivers/iio/dac/ad5686.c:130:16: warning: cast to restricted __be32 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-01iio:ad5686: Report scale as fractional valueLars-Peter Clausen1-7/+3
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-1/+2
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-09-14iio: dac: ad5686: Remove redundant breakSachin Kamat1-1/+0
'break' after return is redundant. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-19iio: dac: ad5686: Use devm_* APIsSachin Kamat1-13/+4
devm_* APIs are device managed and make code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17iio:dac:ad5686 move to info_mask_(shared_by_type/separate)Jonathan Cameron1-3/+3
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-14Merge tag 'staging-3.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds1-1/+5
Pull staging fixes from Greg Kroah-Hartman: "Here are a number of small fixes to staging drivers for your 3.8-rc3 tree. Well, the omapdrm fixes aren't really "small" but they were waiting on a number of other drm patches to go in through the drm tree, and got delayed by my vacation over the holidays. They are totally self-contained, everyone involved have acked them, and they fix issues that people have been having with the driver. Other than that one, it's a bunch of tiny bugfixes for a number of reported issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'staging-3.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (36 commits) staging: zram: fix invalid memory references during disk write staging: tidspbridge: use prepare/unprepare on dsp clocks staging: tidspbridge: Fix build breakage due to splitting CM functions. staging: comedi: comedi_test: fix race when cancelling command staging: comedi: Kconfig: COMEDI_NI_AT_A2150 should select COMEDI_FC staging: comedi: prevent auto-unconfig of manually configured devices staging: comedi: fix minimum AO period for NI 625x and NI 628x staging: vme_pio2: fix oops on module unloading staging: speakup: avoid out-of-range access in synth_add() staging: speakup: avoid out-of-range access in synth_init() staging: rtl8192e: Fix failure to check pci_map_single() staging: rtl8187se: Fix failure to check pci_map_single() staging: drm/imx: fix double free bug in error path staging: drm/imx: several bug fixes staging: drm/imx: check return value of ipu_reset() staging: drm/omap: fix flags in dma buf exporting staging: drm/omap: use omapdss low level API staging/fwserial: Update TODO file per reviewer comments staging/fwserial: Limit tx/rx to 1394-2008 spec maximum staging/fwserial: Refine Kconfig help text ...
2013-01-03Drivers: iio: remove __dev* attributes.Greg Kroah-Hartman1-3/+3
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-12-27iio: dac: ad5686: Don't set error code to voltage_uvAxel Lin1-1/+5
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19iio: Don't compare boolean values to true/falseLars-Peter Clausen1-1/+1
Fixes the following warnings from coccicheck: drivers/iio/inkern.c:81:6-14: WARNING: Comparison to bool drivers/iio/dac/ad5686.c:191:5-11: WARNING: Comparison to bool Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-05staging:iio: Move DAC drivers out of stagingLars-Peter Clausen1-0/+418
The IIO DAC drivers are in a reasonably good shape. They all make use of channel spec and non of them provides non-documented sysfs attributes. Code style should be OK as well, both checkpatch and coccicheck only report trivial issues. So lets move the whole folder out of staging. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>