[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170105164651.tk5e3rhdthtpn4lc@lukather>
Date: Thu, 5 Jan 2017 17:46:51 +0100
From: Maxime Ripard <maxime.ripard@...e-electrons.com>
To: Quentin Schulz <quentin.schulz@...e-electrons.com>
Cc: Chen-Yu Tsai <wens@...e.org>, Jonathan Cameron <jic23@...nel.org>,
knaack.h@....de, Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Sebastian Reichel <sre@...nel.org>,
Russell King <linux@...linux.org.uk>,
Lee Jones <lee.jones@...aro.org>, linux-iio@...r.kernel.org,
devicetree <devicetree@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
"open list:THERMAL" <linux-pm@...r.kernel.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
Icenowy Zheng <icenowy@...c.xyz>,
Bruno Prémont <bonbons@...ux-vserver.org>
Subject: Re: [PATCH 03/22] iio: adc: add support for X-Powers AXP20X and
AXP22X PMICs ADCs
On Thu, Jan 05, 2017 at 10:50:33AM +0100, Quentin Schulz wrote:
> >>>> +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;
> >>>
> >>>> + 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
Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)
Powered by blists - more mailing lists