summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/npcm_adc.c
AgeCommit message (Collapse)AuthorFilesLines
2022-07-18iio: adc: npcm: Add NPCM8XX supportTomer Maimon1-7/+29
Adding ADC NPCM8XX support to NPCM ADC driver. ADC NPCM8XX uses a different resolution and voltage reference. As part of adding NPCM8XX support: - Add NPCM8XX specific compatible string. - Add data to handle architecture-specific ADC parameters. Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Link: https://lore.kernel.org/r/20220713132640.215916-3-tmaimon77@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-06-14iio: adc: npcm_adc: explicitly add proper header filesNuno Sá1-0/+1
Do not trust the fact that iio.h includes of.h which in turn includes all the headers we are relying on. The ultimate goal is to actually drop of.h from iio.h. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220610084545.547700-10-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25iio: adc: npcm_adc: Replace indio_dev->mlock with own device lockSergiu Cuciurean1-2/+13
As part of the general cleanup of indio_dev->mlock, this change replaces it with a local lock on the device's state structure. This is part of a bigger cleanup. Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/ Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com> Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com> Link: https://lore.kernel.org/r/20200928131333.36646-3-mircea.caprioru@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-06-14iio: remove explicit IIO device parent assignmentAlexandru Ardelean1-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>
2020-02-14iio: adc: modify NPCM reset supportTomer Maimon1-21/+9
Modify NPCM ADC reset support from direct register access to reset controller support. please make sure to modify NPCM adc device tree parameters as described at nuvoton,npcm-adc.txt document for using this change. Note for anyone noting that this is a breaking change, this is on a BMC and effectively in a close ecosystem so it is fine to rely on DT and kernel being updated together. Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-09iio: adc: npcm: use devm_platform_ioremap_resourceJonathan Cameron1-3/+1
Reduces local boilerplate code. Suggested by coccinelle via coccicheck. CHECK drivers/iio/adc/npcm_adc.c drivers/iio/adc/npcm_adc.c:200:1-11: WARNING: Use devm_platform_ioremap_resource for info -> regs Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: Tomer Maimon <tmaimon77@gmail.com>
2019-08-05iio: Remove dev_err() usage after platform_get_irq()Stephen Boyd1-1/+0
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Cc: linux-iio@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-07iio: adc: modify NPCM ADC read reference voltageTomer Maimon1-1/+1
Checking if regulator is valid before reading NPCM ADC regulator voltage to avoid system crash in a case the regulator is not valid. Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-01-19iio: adc: add NPCM ADC driverTomer Maimon1-0/+335
Add Nuvoton NPCM BMC Analog-to-Digital Converter(ADC) driver. The NPCM ADC is a 10-bit converter for eight channel inputs. Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>