Re: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-15 Thread Jonathan Cameron
On 09/15/2012 01:15 AM, Kim, Milo wrote: >>> The LP8788 has 13 ADC input selection. >>> >>> ADC selection: >>> Battery voltage, general ADC1 and so on. >>> >>> ADC result: >>> Result = MAX_VALUE * (raw + 0.5) / 4095 except ADC is the charger >> voltage >>> If the ADC input is the charger voltage,

Re: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-15 Thread Jonathan Cameron
On 09/15/2012 01:15 AM, Kim, Milo wrote: The LP8788 has 13 ADC input selection. ADC selection: Battery voltage, general ADC1 and so on. ADC result: Result = MAX_VALUE * (raw + 0.5) / 4095 except ADC is the charger voltage If the ADC input is the charger voltage, Result = MAX_VALUE *

RE: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-14 Thread Kim, Milo
> > The LP8788 has 13 ADC input selection. > > > > ADC selection: > > Battery voltage, general ADC1 and so on. > > > > ADC result: > > Result = MAX_VALUE * (raw + 0.5) / 4095 except ADC is the charger > voltage > > If the ADC input is the charger voltage, > > Result = MAX_VALUE * (raw + 0.5) /

Re: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-14 Thread Lars-Peter Clausen
On 09/14/2012 02:33 AM, Kim, Milo wrote: >> Hi, >> >> One issue and a couple of nitpicks inline. > > I really appreciate it. > Please see my questions below. > >>> + switch (mask) { >>> + case IIO_CHAN_INFO_RAW: >>> + ret = lp8788_get_adc_result(adc, id, val) ? -EIO : >>

Re: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-14 Thread Lars-Peter Clausen
On 09/14/2012 02:33 AM, Kim, Milo wrote: Hi, One issue and a couple of nitpicks inline. I really appreciate it. Please see my questions below. + switch (mask) { + case IIO_CHAN_INFO_RAW: + ret = lp8788_get_adc_result(adc, id, val) ? -EIO : IIO_VAL_INT; +

RE: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-14 Thread Kim, Milo
The LP8788 has 13 ADC input selection. ADC selection: Battery voltage, general ADC1 and so on. ADC result: Result = MAX_VALUE * (raw + 0.5) / 4095 except ADC is the charger voltage If the ADC input is the charger voltage, Result = MAX_VALUE * (raw + 0.5) / (4095 * 0.48) The

RE: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-13 Thread Kim, Milo
> > Couple of nitpicks in line to add to Lars-Peter's ones. I really appreciate it. > > +#define LP8788_CHAN(_id, _type) { \ > > + .type = _type, \ > > + .indexed = 1, \ > > +

RE: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-13 Thread Kim, Milo
> Hi, > > One issue and a couple of nitpicks inline. I really appreciate it. Please see my questions below. > > + switch (mask) { > > + case IIO_CHAN_INFO_RAW: > > + ret = lp8788_get_adc_result(adc, id, val) ? -EIO : > IIO_VAL_INT; > > + break; > > + case

Re: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-13 Thread Jonathan Cameron
Couple of nitpicks in line to add to Lars-Peter's ones. TI LP8788 PMU provides regulators, battery charger, ADC, RTC, backlight driver and current sinks. This patch enables the LP8788 ADC functions. The LP8788 ADC has 13 ADC input selection and supports 12-bit resolution. Internal

Re: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-13 Thread Jonathan Cameron
Couple of nitpicks in line to add to Lars-Peter's ones. TI LP8788 PMU provides regulators, battery charger, ADC, RTC, backlight driver and current sinks. This patch enables the LP8788 ADC functions. The LP8788 ADC has 13 ADC input selection and supports 12-bit resolution. Internal

RE: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-13 Thread Kim, Milo
Hi, One issue and a couple of nitpicks inline. I really appreciate it. Please see my questions below. + switch (mask) { + case IIO_CHAN_INFO_RAW: + ret = lp8788_get_adc_result(adc, id, val) ? -EIO : IIO_VAL_INT; + break; + case IIO_CHAN_INFO_SCALE: +

RE: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-13 Thread Kim, Milo
Couple of nitpicks in line to add to Lars-Peter's ones. I really appreciate it. +#define LP8788_CHAN(_id, _type) { \ + .type = _type, \ + .indexed = 1, \ +

Re: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-10 Thread Lars-Peter Clausen
On 09/10/2012 10:02 AM, Kim, Milo wrote: > TI LP8788 PMU provides regulators, battery charger, ADC, > RTC, backlight driver and current sinks. > > This patch enables the LP8788 ADC functions. > > The LP8788 ADC has 13 ADC input selection and supports 12-bit resolution. > Internal operation

[PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-10 Thread Kim, Milo
TI LP8788 PMU provides regulators, battery charger, ADC, RTC, backlight driver and current sinks. This patch enables the LP8788 ADC functions. The LP8788 ADC has 13 ADC input selection and supports 12-bit resolution. Internal operation of getting ADC is access to registers of LP8788. The

[PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-10 Thread Kim, Milo
TI LP8788 PMU provides regulators, battery charger, ADC, RTC, backlight driver and current sinks. This patch enables the LP8788 ADC functions. The LP8788 ADC has 13 ADC input selection and supports 12-bit resolution. Internal operation of getting ADC is access to registers of LP8788. The

Re: [PATCH v5] iio: adc: add new lp8788 adc driver

2012-09-10 Thread Lars-Peter Clausen
On 09/10/2012 10:02 AM, Kim, Milo wrote: TI LP8788 PMU provides regulators, battery charger, ADC, RTC, backlight driver and current sinks. This patch enables the LP8788 ADC functions. The LP8788 ADC has 13 ADC input selection and supports 12-bit resolution. Internal operation of