Thread (72 messages) 72 messages, 8 authors, 2017-01-29

Re: [PATCH 03/22] iio: adc: add support for X-Powers AXP20X and AXP22X PMICs ADCs

From: Maxime Ripard <hidden>
Date: 2017-01-05 16:47:09
Also in: linux-arm-kernel, linux-devicetree, linux-iio, lkml

On Thu, Jan 05, 2017 at 10:50:33AM +0100, Quentin Schulz wrote:
quoted
quoted
quoted
quoted
+static int axp20x_remove(struct platform_device *pdev)
+{
+       struct axp20x_adc_iio *info;
+       struct iio_dev *indio_dev = platform_get_drvdata(pdev);
+
+       info = iio_priv(indio_dev);
Nit: you could just reverse the 2 declarations above and join this
line after struct axp20x_adc_iio *info;
quoted
+       regmap_write(info->regmap, AXP20X_ADC_EN1, 0);
+       regmap_write(info->regmap, AXP20X_ADC_EN2, 0);
The existing VBUS power supply driver enables the VBUS ADC bits itself,
and does not check them later on. This means if one were to remove this
axp20x-adc module, the voltage/current readings in the VBUS power supply
would be invalid. Some sort of workaround would be needed here in this
driver of the VBUS driver.
That would be one reason to migrate the VBUS driver to use the IIO
channels, wouldn't it?
It is, preferably without changing the device tree.
Yes, of course.
Note that you can have something like a test for the iio channel
property in the VBUS driver, and keep the old behaviour in the case
where we wouldn't have it.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help