summaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac/dpot-dac.c
Commit message (Collapse)AuthorAgeFilesLines
* iio:dac:dpot-dac: Swap of.h for mod_devicetable.hJonathan Cameron2021-12-121-1/+1
| | | | | | | | | This driver never used anything in the of specific header. It just wants the struct of_device_id from mod_devicetable.h. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Peter Rosin <peda@axentia.se>
* Merge 5.9-rc5 into staging-nextGreg Kroah-Hartman2020-09-141-2/+3
|\ | | | | | | | | | | We want the staging/iio changes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * iio: dpot-dac: fix code comment in dpot_dac_read_raw()Gustavo A. R. Silva2020-08-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | After the replacement of the /* fall through */ comment with the fallthrough pseudo-keyword macro, the natural reading of a code comment was broken. Fix the natural reading of such a comment and make it intelligible. Reported-by: Peter Rosin <peda@axentia.se> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
| * treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva2020-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
* | iio: dac: dpot-dac: Simplify with dev_err_probe()Krzysztof Kozlowski2020-09-031-10/+6
|/ | | | | | | | | | | Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/20200829064726.26268-12-krzk@kernel.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: dpot-dac: mark expected switch fall-through with text GCC expects.Gustavo A. R. Silva2018-10-141-2/+2
| | | | | | | | | | | | | | | | | In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I replaced "...and fall through." with the specific string "fall through", which is what GCC is expecting to find thus supressing this false positive. As Peter has observed this breaks the nice English flow, which is less than ideal, but short of teaching GCC to read English, there isn't a lot that we can do about it. Addresses-Coverity-ID: 1462408 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: dpot-dac: switch to SPDX license identifierPeter Rosin2018-08-201-4/+1
| | | | | | | Drop the boilerplate license text. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:dac: drop assignment of iio_info.driver_moduleJonathan Cameron2017-08-221-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>
* iio: dpot-dac: DAC driver based on a digital potentiometerPeter Rosin2016-11-131-0/+266
It is assumed that the dpot is used as a voltage divider between the current dpot wiper setting and the maximum resistance of the dpot. The divided voltage is provided by a vref regulator. .------. .-----------. | | | vref |--' .---. | regulator |--. | | '-----------' | | d | | | p | | | o | wiper | | t |<---------+ | | | | '---' dac output voltage | | '------+------------+ Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <jic23@kernel.org>