summaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac/ad5696-i2c.c
Commit message (Collapse)AuthorAgeFilesLines
* iio: Switch i2c drivers back to use .probe()Uwe Kleine-König2023-05-211-1/+1
| | | | | | | | | | | | After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230515205048.19561-1-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5686: Add support for AD5337Fabio Estevam2022-12-281-0/+2
| | | | | | | | | | | | AD5337 belongs to the same family as the AD5338. The difference is that the AD5337 has 8-bit precision instead of 10-bit. Add support for the AD5337 chip in the driver. Signed-off-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20221130182632.3856675-2-festevam@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5696-i2c: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-231-3/+3
| | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20221118224540.619276-87-uwe@kleine-koenig.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* i2c: Make remove callback return voidUwe Kleine-König2022-08-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The value returned by an i2c driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.) So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before. Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com> Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au> Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Crt Mori <cmo@melexis.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omnia Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_power Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013 Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/* Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2s Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5 Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccg Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iio Acked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860 Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912b Reviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxes Acked-by: Corey Minyard <cminyard@mvista.com> # for IPMI Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/power Acked-by: Krzysztof Hałasa <khalasa@piap.pl> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* iio:dac:ad5686: Move exports into IIO_AD5686 namespaceJonathan Cameron2022-02-181-0/+1
| | | | | | | | | | | | | | | Note these are used in the related ad5696-i2c drivers as well as the more obviously connected ad5686-spi driver. In order to avoid unnecessary pollution of the global symbol namespace move the common/library functions into a specific namespace and import that into the various specific device drivers that use them. For more information see https://lwn.net/Articles/760045/ Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220130205701.334592-8-jic23@kernel.org
* iio: dac: ad5686: Make ad5686_remove() return voidUwe Kleine-König2021-10-191-1/+3
| | | | | | | | | | | | | Up to now ad5686_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20211013203223.2694577-11-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5686: Add support for AD5673R/AD5677RMircea Caprioru2021-03-111-2/+4
| | | | | | | | | | | | | | The AD5673R/AD5677R are low power, 16-channel, 12-/16-bit buffered voltage output digital-to-analog converters (DACs). They include a 2.5 V internal reference (enabled by default). These devices are very similar to AD5674R/AD5679R, except that they have an i2c interface. Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20210217074102.23148-1-alexandru.ardelean@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5686: add of_match_tableMichael Auchter2020-10-101-0/+19
| | | | | | | | | Add of_match_table to this driver, so devices can be probed based on device tree contents. Signed-off-by: Michael Auchter <michael.auchter@ni.com> Link: https://lore.kernel.org/r/20200924195215.49443-2-michael.auchter@ni.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dac: ad5686: add support for AD5338RMichael Auchter2020-10-101-0/+1
| | | | | | | | | | | The AD5338R is a 10-bit DAC with 2 outputs and an internal 2.5V reference (enabled by default). The register configuration is nearly identical to the AD5696R DAC that's already supported by this driver, with the channel selection bits being the only thing different. Signed-off-by: Michael Auchter <michael.auchter@ni.com> Link: https://lore.kernel.org/r/20200924195215.49443-1-michael.auchter@ni.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:ad5686: Add AD5311R supportStefan Popa2018-06-101-0/+1
| | | | | | | | | | | | | | 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>
* iio:dac:ad5686: Add AD5691R/AD5692R/AD5693/AD5693R supportStefan Popa2018-05-201-1/+6
| | | | | | | | | | | | | | | | | | 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>
* iio:dac:ad5686: Add AD5671R/75R/94/94R/95R/96/96R supportStefan Popa2018-04-151-0/+97
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>