[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <A874F61F95741C4A9BA573A70FE3998FBC4743E2@DQHE06.ent.ti.com>
Date: Mon, 22 Sep 2014 01:01:12 +0000
From: "Kim, Milo" <Milo.Kim@...com>
To: Jonathan Cameron <jic23@...nel.org>,
Stanimir Varbanov <svarbanov@...sol.com>
CC: Hartmut Knaack <knaack.h@....de>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Pawel Moll <pawel.moll@....com>,
Rob Herring <robh+dt@...nel.org>,
Kumar Gala <galak@...eaurora.org>,
Mark Rutland <mark.rutland@....com>,
Grant Likely <grant.likely@...aro.org>,
Arnd Bergmann <arnd@...db.de>,
"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Lars-Peter Clausen <lars@...afoo.de>,
"Angelo Compagnucci" <angelo.compagnucci@...il.com>,
Doug Anderson <dianders@...omium.org>,
Fugang Duan <B38611@...escale.com>,
"Johannes Thumshirn" <johannes.thumshirn@....de>,
Jean Delvare <jdelvare@...e.de>,
Philippe Reynes <tremyfr@...oo.fr>,
Lee Jones <lee.jones@...aro.org>,
"Josh Cartwright" <joshc@...eaurora.org>,
Stephen Boyd <sboyd@...eaurora.org>,
"David Collins" <collinsd@...eaurora.org>,
"Ivan T. Ivanov" <iivanov@...sol.com>
Subject: RE: [PATCH v2 1/2] iio: vadc: Qualcomm SPMI PMIC voltage ADC driver
Hello Jonathan and Stanimir,
> >> See Documentation/ABI/sysfs-bus-iio
> >> Millivolts I think... We copied hwmon where possible.
> >
> > I'm a bit confused about these units. I searched references of
> > iio_read_channel_processed() and found a few.
> >
> > The iio_hwmon expecting milivolts. On the other side lp8788-charger.c
> > registers a get_property method in charger-manager.c, which expects
> > microvolts in get_batt_uV().
> It's definitely meant to be millivolts (lifted from hwmon a while back).
> See Documentation/ABI/testing/sysfs-bus-iio
>
> Looks like we have a bug in lp8788-charger - it might be matched with one in
> lp8788-adc, but then there will be a bug there...
>
> Cc'd Milo Kim.
'lp8788-charger' registers not charger-manager but power-supply subsystem.
'lp8788-adc' is the IIO driver.
'lp8788-charger' is the IIO consumer of lp8788-adc.
(How to communicate between lp8788-adc and lp8788-charger)
1. Application requests vbatt(battery voltage) by accessing /sys/class/power/
2. lp8788-charger asks lp8788-adc to get converted vbatt value
3. lp8788-adc get the battery ADC from the device.
It returns calculated micro voltage to lp8788-charger.
4. lp8788-charger reports this uV value to the application
5. Application uses uV or converts to mV or V unit. It's up to the app.
Please note that battery app accesses not /sys/bus/iio but /sys/class/power/.
Best regards,
Milo
Powered by blists - more mailing lists