summaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac/ad5758.c
Commit message (Collapse)AuthorAgeFilesLines
* iio:dac:ad5758: Drop unused of specific headers.Jonathan Cameron2021-12-121-2/+1
| | | | | | | | | These have never been used in this driver. What is used is in mod_devicetable.h so add that include (struct of_device_id) Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Daniel Gomez <dagmcr@gmail.com>
* iio: dac: Convert powerdown read callbacks to sysfs_emit()Lars-Peter Clausen2021-03-291-1/+1
| | | | | | | | | | | | Update DAC drivers powerdown attribute show callback to use the new sysfs_emit() function. sysfs_emit() is preferred over raw s*printf() for sysfs attributes since it knows about the sysfs buffer specifics and has some built-in sanity checks. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20210320071405.9347-5-lars@metafoo.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5758: Move and fix-up kerneldoc header and demote unworthy kerneldocLee Jones2020-07-201-9/+9
| | | | | | | | | | | | | | | | | | | | Kerneldoc headers need to come directly before the function/struct that they are documenting. Also fix some missing descriptions and misspellings. Fixes the following W=1 kernel build warning(s): drivers/iio/dac/ad5758.c:111: warning: Function parameter or member 'reg' not described in 'ad5758_range' drivers/iio/dac/ad5758.c:111: warning: Function parameter or member 'min' not described in 'ad5758_range' drivers/iio/dac/ad5758.c:111: warning: Function parameter or member 'max' not described in 'ad5758_range' drivers/iio/dac/ad5758.c:122: warning: Function parameter or member 'gpio_reset' not described in 'ad5758_state' drivers/iio/dac/ad5758.c:122: warning: Function parameter or member 'd32' not described in 'ad5758_state' drivers/iio/dac/ad5758.c:137: warning: cannot understand function prototype: 'enum ad5758_output_range ' Cc: Michael Hennerich <Michael.Hennerich@analog.com> Cc: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: remove explicit IIO device parent assignmentAlexandru Ardelean2020-06-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch applies the semantic patch: @@ expression I, P, SP; @@ I = devm_iio_device_alloc(P, SP); ... - I->dev.parent = P; It updates 302 files and does 307 deletions. This semantic patch also removes some comments like '/* Establish that the iio_dev is a child of the i2c device */' But this is is only done in case where the block is left empty. The patch does not seem to cover all cases. It looks like in some cases a different variable is used in some cases to assign the parent, but it points to the same reference. In other cases, the block covered by ... may be just too big to be covered by the semantic patch. However, this looks pretty good as well, as it does cover a big bulk of the drivers that should remove the parent assignment. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5758: remove set but not used variable 'dc_dc_mode'YueHaibing2019-04-271-6/+3
| | | | | | | | | | | | | Fixes gcc '-Wunused-but-set-variable' warning: drivers/iio/dac/ad5758.c: In function ad5758_write_powerdown: drivers/iio/dac/ad5758.c:585:15: warning: variable dc_dc_mode set but not used [-Wunused-but-set-variable] It is not used any more since commit edde945257e2 ("iio: dac: ad5758: Modifications for new revision") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5758: declare missing of tableDaniel Gomez2019-04-271-0/+9
| | | | | | | | | | | | | | | | | | | Add missing <of_device_id> table for SPI driver relying on SPI device match since compatible is in a DT binding or in a DTS. Before this patch: modinfo drivers/iio/dac/ad5758.ko | grep alias alias: spi:ad5758 After this patch: modinfo drivers/iio/dac/ad5758.ko | grep alias alias: spi:ad5758 alias: of:N*T*Cadi,ad5758C* alias: of:N*T*Cadi,ad5758 Reported-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Daniel Gomez <dagmcr@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5758: Modifications for new revisionMircea Caprioru2019-04-221-37/+18
| | | | | | | | | | | | | | This patch will ensure compatibility with the new revision of the AD5758 dac converter. The modifications consist of removing the fault_prot_switch function since this option is no longer available, and enabling the ENABLE_PPC_BUFFERS bit in ADC_CONFIG register before setting the PPC current mode. The previous version of the chip was never released to customers so there is no need to support it going forwards. Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* drivers: iio: dac: Fix wrong license for ADI driversStefan Popa2019-02-091-1/+1
| | | | | | | | Analog Devices drivers are typically GPL v2 only. This patch fixes the inconsistencies between the module license and SPDX. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5758: Add support for hard resetStefan Popa2018-09-021-2/+24
| | | | | | | | | | | | | | | The ad5758 has a hardware reset active low input pin. This patch adds a devicetree entry for a reset GPIO and a new ad5758_reset() function. During initialization, it is checked if the reset property is specified and the the GPIO is being asserted, therefore the device will become active. When the reset function is called, if the gpio_reset var is set, then the GPIO will be toggled, otherwise a software reset is performed. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: Add AD5758 supportStefan Popa2018-07-071-0/+897
The AD5758 is a single channel DAC with 16-bit precision which uses the SPI interface that operates at clock rates up to 50MHz. The output can be configured as voltage or current and is available on a single terminal. Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/ad5758.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>