lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 22 Sep 2014 01:01:12 +0000
From:	"Kim, Milo" <>
To:	Jonathan Cameron <>,
	Stanimir Varbanov <>
CC:	Hartmut Knaack <>,
	Ian Campbell <>,
	Pawel Moll <>,
	Rob Herring <>,
	Kumar Gala <>,
	Mark Rutland <>,
	Grant Likely <>,
	Arnd Bergmann <>,
	"" <>,
	"" <>,
	"" <>,
	"" <>,
	Greg Kroah-Hartman <>,
	Lars-Peter Clausen <>,
	"Angelo Compagnucci" <>,
	Doug Anderson <>,
	Fugang Duan <>,
	"Johannes Thumshirn" <>,
	Jean Delvare <>,
	Philippe Reynes <>,
	Lee Jones <>,
	"Josh Cartwright" <>,
	Stephen Boyd <>,
	"David Collins" <>,
	"Ivan T. Ivanov" <>
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,

Powered by blists - more mailing lists