[PATCH 19/28] leds-lp5521/5523: use lp55xx common deinit device function

2012-10-05 Thread Kim, Milo
Use lp55xx common function to release the device. Unnecessary old code lines are removed. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5521.c |6 +- drivers/leds/leds-lp5523.c |6 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git

[PATCH 20/28] leds-lp55xx: support device specific attibutes

2012-10-05 Thread Kim, Milo
(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5521.c|2 +- drivers/leds/leds-lp5523.c|2 +- drivers/leds/leds-lp55xx-common.c | 15 ++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521

[PATCH 21/28] leds-lp5521/5523: use lp55xx data structure on selftest

2012-10-05 Thread Kim, Milo
or not. And just skip read status value in case of external clock mode. LP5523 : Like LP5521, pdata NULL checking is unnecessary. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5521.c | 18 +++--- drivers/leds/leds-lp5523.c | 43

[PATCH 22/28] leds-lp5521/5523: clean up unused code

2012-10-05 Thread Kim, Milo
Old data structures and I2C functions are not used any more. Each driver uses the lp55xx common data and functions. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5521.c | 61 --- drivers/leds/leds-lp5523.c | 62

[PATCH 23/28] leds-lp5521/5523: clean up definitions

2012-10-05 Thread Kim, Milo
Remove unused definitions and make hex values capital letters Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5521.c | 26 +++-- drivers/leds/leds-lp5523.c | 54 ++-- 2 files changed, 10 insertions(+), 70

[PATCH 24/28] leds-lp5521/5523: clean up headers

2012-10-05 Thread Kim, Milo
Remove unused headers and sort them alphabetically. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5521.c | 17 + drivers/leds/leds-lp5523.c | 17 + 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/leds/leds

[PATCH 25/28] leds-lp5521/5523: use new lp55xx common header

2012-10-05 Thread Kim, Milo
. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- arch/arm/mach-omap2/board-rx51-peripherals.c |8 +-- arch/arm/mach-ux500/board-mop500.c | 14 ++--- include/linux/leds-lp5521.h | 73 -- include/linux/leds-lp5523.h

[PATCH 26/28] leds-lp5521/5523: add author and copyright description

2012-10-05 Thread Kim, Milo
Add the author and copyright about the new lp55xx structure. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5521.c |3 +++ drivers/leds/leds-lp5523.c |3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c

[PATCH 27/28] leds-lp5521/5523: relocate functions and remove comments

2012-10-05 Thread Kim, Milo
Relocate device attribute function nearby the declaration of the attribute. This is really minor, but it may improve the legibility. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5521.c | 24 +++ drivers/leds/leds-lp5523.c | 154

[PATCH 28/28] Documentation: leds: update LP55xx family devices

2012-10-05 Thread Kim, Milo
Add leds-lp55xx.txt. Update the platform data information. For the LED patterns, detailed information is described in lp55xx document. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- Documentation/leds/00-INDEX|2 + Documentation/leds/leds-lp5521.txt | 63

RE: [PATCH v4] power_supply: add new lp8788 charger driver

2012-09-20 Thread Kim, Milo
> -Original Message- > From: Anton Vorontsov [mailto:anton.voront...@linaro.org] > Sent: Friday, September 21, 2012 7:17 AM > To: Kim, Milo > Cc: David Woodhouse; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v4] power_supply: add new lp8788 charger driver > &

RE: [PATCH v4] power_supply: add new lp8788 charger driver

2012-09-20 Thread Kim, Milo
-Original Message- From: Anton Vorontsov [mailto:anton.voront...@linaro.org] Sent: Friday, September 21, 2012 7:17 AM To: Kim, Milo Cc: David Woodhouse; linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] power_supply: add new lp8788 charger driver On Wed, Sep 05, 2012 at 10:43

RE: [PATCH 2/2] iio: inkern: put the IIO device when mem alloc gets failed

2012-09-17 Thread Kim, Milo
> I can see your point, but Lars-Peter's way is the more commonly used > approach > so lets go with the ancient arguement of making it look like what those > reading the code expect to see ;) Two chained patches were sent. [PATCH 1/2] iio: inkern: put the IIO device when it fails to allocate

[PATCH 2/2] iio: inkern: clean up error return code

2012-09-17 Thread Kim, Milo
When the IIO consumer tries to get specific IIO channel, few error cases can be happened. (a) Memory allocation failure (b) No matched ADC channel error (c) Invalid input arguments This patch enables cleaning up error handling in case of (a) and (b). In error handling code, (a): the

[PATCH 1/2] iio: inkern: put the IIO device when it fails to allocate memory

2012-09-17 Thread Kim, Milo
The reference count of the IIO device is increased if the IIO map has matched consumer name. After then, it tries to allocate the iio_channel which is used by the consumer. If it fails to allocate memory, the reference count should be decreased. This patch enables restoring the reference

RE: Question about cleaning up the LP5521/5523 LED driver

2012-09-17 Thread Kim, Milo
> > Should I keep the sysfs layout of LP5521 and LP5523? > > When we change the device attributes, do we have to consider the > backward compatibility? > > The ABI is a contract so basically yes, you need real good reasons > (like security concerns) to change the ABI. > > That said, the lm3533

RE: Question about cleaning up the LP5521/5523 LED driver

2012-09-17 Thread Kim, Milo
> Actually, I'm not sure about the impact with changing the sysfs > interface. I guess we need some input from the driver authors. As you already noticed, I can't contact authors. Mail accounts don't exist anymore. > > Personally I vote for the simple firmware interface there, since it > looks

Question about cleaning up the LP5521/5523 LED driver

2012-09-17 Thread Kim, Milo
Hi Bryan, I would like to have your opinion about cleaning up LP5521 and LP5523/LP55231 drivers. Three devices have similar features such like multi channels, register access via the I2C and internal RAM usage for loading various LED patterns. Moreover upcoming IC has also similar layout and

RE: [PATCH 2/2] iio: inkern: put the IIO device when mem alloc gets failed

2012-09-17 Thread Kim, Milo
> > drivers/iio/inkern.c |5 - > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c > > index 13748c0..aff034b 100644 > > --- a/drivers/iio/inkern.c > > +++ b/drivers/iio/inkern.c > > @@ -132,7 +132,7 @@ struct iio_channel

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

2012-09-17 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 several ADC input selection and supports 12bit resolution. Internal operation of getting ADC is access to registers of LP8788.

RE: [PATCH 2/2] iio: inkern: add error case in iio_channel_get()

2012-09-17 Thread Kim, Milo
> Fine, I'm convinced. Certainly less weird doing it your way ;) > Please do fix up the get all case as well. Please refer to chained patches. [PATCH 1/2] iio: inkern: add error case in iio_channel_get() [PATCH 2/2] iio: inkern: put the IIO device when mem alloc gets failed I'd like to mention

[PATCH 2/2] iio: inkern: put the IIO device when mem alloc gets failed

2012-09-17 Thread Kim, Milo
The reference count of the IIO device is increased if the IIO map has matched consumer name. After then, it tries to allocate the iio_channel which is used by the consumer. If memory allocation gets failed, the reference count should be decreased. This patch enables restoring the reference

[PATCH 1/2] iio: inkern: add error case in iio_channel_get()

2012-09-17 Thread Kim, Milo
The datasheet name is defined in the IIO driver. On the other hand, the adc_channel_label is configured in the platform side. If the datasheet name is not matched with any adc_channel_label, the iio_channel_get() should be returned as error for preventing invalid channel data access. This

[PATCH 1/2] iio: inkern: add error case in iio_channel_get()

2012-09-17 Thread Kim, Milo
. This can be handled either way. (a) checking null data when using it : in the xxx_read_raw() or (b) error returns when the channel is requested : this patch The IIO consumer can't use the channel with invalid channel spec. Therefore case (b) is more reasonable. Signed-off-by: Milo(Woogyom) Kim

[PATCH 2/2] iio: inkern: put the IIO device when mem alloc gets failed

2012-09-17 Thread Kim, Milo
count of the IIO device. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/iio/inkern.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 13748c0..aff034b 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio

RE: [PATCH 2/2] iio: inkern: add error case in iio_channel_get()

2012-09-17 Thread Kim, Milo
Fine, I'm convinced. Certainly less weird doing it your way ;) Please do fix up the get all case as well. Please refer to chained patches. [PATCH 1/2] iio: inkern: add error case in iio_channel_get() [PATCH 2/2] iio: inkern: put the IIO device when mem alloc gets failed I'd like to mention

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

2012-09-17 Thread Kim, Milo
spec macro. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/iio/adc/Kconfig |6 + drivers/iio/adc/Makefile |1 + drivers/iio/adc/lp8788_adc.c | 264 ++ 3 files changed, 271 insertions(+) create mode 100644 drivers/iio/adc

RE: [PATCH 2/2] iio: inkern: put the IIO device when mem alloc gets failed

2012-09-17 Thread Kim, Milo
drivers/iio/inkern.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 13748c0..aff034b 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -132,7 +132,7 @@ struct iio_channel

Question about cleaning up the LP5521/5523 LED driver

2012-09-17 Thread Kim, Milo
Hi Bryan, I would like to have your opinion about cleaning up LP5521 and LP5523/LP55231 drivers. Three devices have similar features such like multi channels, register access via the I2C and internal RAM usage for loading various LED patterns. Moreover upcoming IC has also similar layout and

RE: Question about cleaning up the LP5521/5523 LED driver

2012-09-17 Thread Kim, Milo
Actually, I'm not sure about the impact with changing the sysfs interface. I guess we need some input from the driver authors. As you already noticed, I can't contact authors. Mail accounts don't exist anymore. Personally I vote for the simple firmware interface there, since it looks more

RE: Question about cleaning up the LP5521/5523 LED driver

2012-09-17 Thread Kim, Milo
Should I keep the sysfs layout of LP5521 and LP5523? When we change the device attributes, do we have to consider the backward compatibility? The ABI is a contract so basically yes, you need real good reasons (like security concerns) to change the ABI. That said, the lm3533 is the only

[PATCH 1/2] iio: inkern: put the IIO device when it fails to allocate memory

2012-09-17 Thread Kim, Milo
count of the IIO device. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/iio/inkern.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 13748c0..aff034b 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c

[PATCH 2/2] iio: inkern: clean up error return code

2012-09-17 Thread Kim, Milo
explicitly. Then, the error returns as ERR_PTR() with this value. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/iio/inkern.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index aff034b..656d4d4

RE: [PATCH 2/2] iio: inkern: put the IIO device when mem alloc gets failed

2012-09-17 Thread Kim, Milo
I can see your point, but Lars-Peter's way is the more commonly used approach so lets go with the ancient arguement of making it look like what those reading the code expect to see ;) Two chained patches were sent. [PATCH 1/2] iio: inkern: put the IIO device when it fails to allocate memory

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 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 1/2] iio: inkern: clear allocated memory

2012-09-13 Thread Kim, Milo
> Please state why. I'm sure I can track it down, but it ought to be > in the commit comment. The patch was resent with more detailed description. Title : [PATCH RESEND] iio: inkern: allocate zeroed memory Thanks for your comment. Best Regards, Milo -- To unsubscribe from this list: send the

[PATCH RESEND] iio: inkern: allocate zeroed memory

2012-09-13 Thread Kim, Milo
Use kzalloc() rather than kmalloc() for initializing the iio_channel structure. This patch enables the iio_dev and iio_chan_spec are set to NULL. This may prevent the page fault problem because the pointer of iio_chan_spec is initialized as NULL. The iio_chan_spec is updated only in case

RE: [PATCH 2/2] iio: inkern: add error case in iio_channel_get()

2012-09-13 Thread Kim, Milo
> On 10/09/12 09:02, Kim, Milo wrote: > > The datasheet name is defined in the IIO driver. > > On the other hand, the adc_channel_label is configured in > > the platform machine side. > > If the datasheet name is not matched with any adc_channel_label, > &g

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 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 2/2] iio: inkern: add error case in iio_channel_get()

2012-09-13 Thread Kim, Milo
On 10/09/12 09:02, Kim, Milo wrote: The datasheet name is defined in the IIO driver. On the other hand, the adc_channel_label is configured in the platform machine side. If the datasheet name is not matched with any adc_channel_label, the iio_channel_get() should be returned

[PATCH RESEND] iio: inkern: allocate zeroed memory

2012-09-13 Thread Kim, Milo
that the IIO map has specific channel label. When the map has no ADC channel label, then the value of iio_chan_spec remains as invalid pointer. To prevent this problem, the pointer should be initialized as NULL. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/iio/inkern.c |2

RE: [PATCH 1/2] iio: inkern: clear allocated memory

2012-09-13 Thread Kim, Milo
Please state why. I'm sure I can track it down, but it ought to be in the commit comment. The patch was resent with more detailed description. Title : [PATCH RESEND] iio: inkern: allocate zeroed memory Thanks for your comment. Best Regards, Milo -- To unsubscribe from this list: send the

[PATCH 1/2] leds-lp5523: turn off the LED engines on unloading the driver

2012-09-12 Thread Kim, Milo
The LP5523 has 3 engines which are used for running LED patterns. These engines should be off while unloading the driver. Obviously, LP5523 platform data are used for releasing the resource such like enable()/release_resource(), but these are not mandatory. Therefore this patch is required

[PATCH 2/2] leds-lp5523: Fix riskiness of the page fault

2012-09-12 Thread Kim, Milo
The last attribute should be terminated as NULL because any member of attribute structure is accessed while adding the sysfs file. If not, invalid address may cause the page fault problem. Signed-off-by: Milo(Woogyom) Kim --- drivers/leds/leds-lp5523.c |1 + 1 file changed, 1

[PATCH 2/2] leds-lp5523: Fix riskiness of the page fault

2012-09-12 Thread Kim, Milo
The last attribute should be terminated as NULL because any member of attribute structure is accessed while adding the sysfs file. If not, invalid address may cause the page fault problem. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5523.c |1 + 1 file changed

[PATCH 1/2] leds-lp5523: turn off the LED engines on unloading the driver

2012-09-12 Thread Kim, Milo
without the platform data dependency. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5523.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c index 3d60428..5ebdc92 100644 --- a/drivers/leds/leds-lp5523.c +++ b

[PATCH 2/2] iio: inkern: add error case in iio_channel_get()

2012-09-10 Thread Kim, Milo
The datasheet name is defined in the IIO driver. On the other hand, the adc_channel_label is configured in the platform machine side. If the datasheet name is not matched with any adc_channel_label, the iio_channel_get() should be returned as error for preventing using invalid IIO channel

[PATCH 1/2] iio: inkern: clear allocated memory

2012-09-10 Thread Kim, Milo
Use kzalloc() rathern than kmalloc() for initializing iio_dev and iio_chan_spec. Signed-off-by: Milo(Woogyom) Kim --- drivers/iio/inkern.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index b5afc2f..1faa240 100644 ---

[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
styles. Patch v2. Support RAW and SCALE interface for IIO consumer. Clean up the IIO channel spec macro. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/iio/adc/Kconfig |6 + drivers/iio/adc/Makefile |1 + drivers/iio/adc/lp8788_adc.c | 270

[PATCH 1/2] iio: inkern: clear allocated memory

2012-09-10 Thread Kim, Milo
Use kzalloc() rathern than kmalloc() for initializing iio_dev and iio_chan_spec. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/iio/inkern.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index b5afc2f..1faa240

[PATCH 2/2] iio: inkern: add error case in iio_channel_get()

2012-09-10 Thread Kim, Milo
-channel' or 'iio_chan_spec-type'. If the iio_channel_get() gets failed in the IIO consumer, then no read_raw() operation proceeds. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/iio/inkern.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio

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

2012-09-07 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 v4] mfd: add new lp8788 driver

2012-09-07 Thread Kim, Milo
TI LP8788 PMU provides regulators, battery charger, ADC, RTC, backlight driver and current sinks. This MFD patch supports the I2C communication using the regmap, the interrupt handling using the linear IRQ domain and configurable platform data structures for each driver module. (Driver

[PATCH v4] mfd: add new lp8788 driver

2012-09-07 Thread Kim, Milo
driver. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/mfd/Kconfig | 10 ++ drivers/mfd/Makefile |2 + drivers/mfd/lp8788-irq.c | 197 + drivers/mfd/lp8788.c | 245 + include/linux/mfd

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

2012-09-07 Thread Kim, Milo
channel spec macro. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/iio/adc/Kconfig |6 ++ drivers/iio/adc/Makefile |1 + drivers/iio/adc/lp8788_adc.c | 242 ++ 3 files changed, 249 insertions(+) create mode 100644 drivers/iio

RE: [PATCH v3 2/3] power_supply: add new lp8788 charger driver

2012-09-05 Thread Kim, Milo
> -Original Message- > From: Anton Vorontsov [mailto:anton.voront...@linaro.org] > Sent: Thursday, August 23, 2012 2:54 PM > To: Kim, Milo > Cc: sa...@linux.intel.com; linux-kernel@vger.kernel.org; Jonathan > Cameron > Subject: Re: [PATCH v3 2/3] power_supply: a

[PATCH v4] power_supply: add new lp8788 charger driver

2012-09-05 Thread Kim, Milo
TI LP8788 PMU supports regulators, battery charger, RTC, ADC, backlight driver and current sinks. This patch supports the charger operations including the charger interrupt handling. The LP8788 charger driver provides configurable platform data. The charger platform data includes ADC input

[PATCH v4] power_supply: add new lp8788 charger driver

2012-09-05 Thread Kim, Milo
, POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX for the battery. (e) Replace flush_work_sync() with flush_work() on unloading the driver (f) Fix bug for releasing the IRQ : only call free_irq() for valid IRQ number. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/power/Kconfig |7 + drivers/power/Makefile

RE: [PATCH v3 2/3] power_supply: add new lp8788 charger driver

2012-09-05 Thread Kim, Milo
-Original Message- From: Anton Vorontsov [mailto:anton.voront...@linaro.org] Sent: Thursday, August 23, 2012 2:54 PM To: Kim, Milo Cc: sa...@linux.intel.com; linux-kernel@vger.kernel.org; Jonathan Cameron Subject: Re: [PATCH v3 2/3] power_supply: add new lp8788 charger driver

[PATCH 3/5] regulator: lp872x: initialize the DVS mode

2012-09-04 Thread Kim, Milo
The platform specific configuration(general_config) is optional. However, the DVS settings should be configured explicitly while loading the driver. This patch enables configuring the default DVS mode even though the platform data is not defined. Signed-off-by: Milo(Woogyom) Kim ---

[PATCH 5/5] regulator: lp872x: remove unnecessary function

2012-09-04 Thread Kim, Milo
The lp872x_check_dvs_validity() is used for checking DVS platform data. If the DVS platform data is not defined, return as error code. Now, this is unnecessary because the default DVS mode is set in this case. Signed-off-by: Milo(Woogyom) Kim --- drivers/regulator/lp872x.c | 28

[PATCH 4/5] regulator: lp872x: fix NULL pointer access problem

2012-09-04 Thread Kim, Milo
The lp872x_set_dvs() is used for changing the DVS pin state. This function works only when the DVS platform data is defined. So don't assume that DVS data is always valid. In case the platform data is not defined, the DVS data is set to NULL for skipping the DVS pin control. DVS selection

[PATCH 2/5] regulator: lp872x: set the default DVS mode

2012-09-04 Thread Kim, Milo
The lp872x driver has the DVS platform data which select the register address of the BUCK voltage. This patch enables updating the default DVS mode when the DVS platform data is not defined. Signed-off-by: Milo(Woogyom) Kim --- drivers/regulator/lp872x.c | 15 ++- 1 file

[PATCH 1/5] regulator: lp872x: remove regulator platform data dependency

2012-09-04 Thread Kim, Milo
This patch enables registering the regulator driver even though the regulator_init_data is not defined in the platform side. Signed-off-by: Milo(Woogyom) Kim --- drivers/regulator/lp872x.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git

[PATCH 0/5] regulator: lp872x: remove platform data dependency

2012-09-04 Thread Kim, Milo
This patch-set removes the platform data dependency. The LP872x driver should be run even if the platform data is not defined. 5 patches enable running the driver in case the LP8720/8725 platform data has no configuration. [PATCH 1/5] regulator: lp872x: remove regulator platform data dependency

[PATCH 3/3] leds-lp5523: use the i2c device id rather than fixed name

2012-09-04 Thread Kim, Milo
LP5523 driver supports both LP5523 and LP55231. The i2c device id is one of the two - lp5523 or lp55231. So it's better to use matching i2c device id while enumerating the device and naming LED channels. Signed-off-by: Milo(Woogyom) Kim --- drivers/leds/leds-lp5523.c | 10 ++ 1

[PATCH 1/3] leds-lp5523: support new LP55231 device

2012-09-04 Thread Kim, Milo
New TI LP55231 device has same I2C register layout as LP5523. Therefore, all of LED operations can be shared with the LP5523 driver. To support new LP55231 device explicitly, the device description is added in the configuration file. Signed-off-by: Milo(Woogyom) Kim ---

[PATCH 2/3] leds-lp5523: add new device id for LP55231

2012-09-04 Thread Kim, Milo
To support LP55231 device, the device id is added. Additionally, the i2c driver name is changed from lp5523 to lp5523x. Signed-off-by: Milo(Woogyom) Kim --- drivers/leds/leds-lp5523.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/leds/leds-lp5523.c

[PATCH 2/3] leds-lp5523: add new device id for LP55231

2012-09-04 Thread Kim, Milo
To support LP55231 device, the device id is added. Additionally, the i2c driver name is changed from lp5523 to lp5523x. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5523.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/leds

[PATCH 1/3] leds-lp5523: support new LP55231 device

2012-09-04 Thread Kim, Milo
New TI LP55231 device has same I2C register layout as LP5523. Therefore, all of LED operations can be shared with the LP5523 driver. To support new LP55231 device explicitly, the device description is added in the configuration file. Signed-off-by: Milo(Woogyom) Kim milo@ti.com

[PATCH 3/3] leds-lp5523: use the i2c device id rather than fixed name

2012-09-04 Thread Kim, Milo
LP5523 driver supports both LP5523 and LP55231. The i2c device id is one of the two - lp5523 or lp55231. So it's better to use matching i2c device id while enumerating the device and naming LED channels. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/leds/leds-lp5523.c | 10

[PATCH 0/5] regulator: lp872x: remove platform data dependency

2012-09-04 Thread Kim, Milo
This patch-set removes the platform data dependency. The LP872x driver should be run even if the platform data is not defined. 5 patches enable running the driver in case the LP8720/8725 platform data has no configuration. [PATCH 1/5] regulator: lp872x: remove regulator platform data dependency

[PATCH 1/5] regulator: lp872x: remove regulator platform data dependency

2012-09-04 Thread Kim, Milo
This patch enables registering the regulator driver even though the regulator_init_data is not defined in the platform side. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/regulator/lp872x.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git

[PATCH 2/5] regulator: lp872x: set the default DVS mode

2012-09-04 Thread Kim, Milo
The lp872x driver has the DVS platform data which select the register address of the BUCK voltage. This patch enables updating the default DVS mode when the DVS platform data is not defined. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/regulator/lp872x.c | 15

[PATCH 4/5] regulator: lp872x: fix NULL pointer access problem

2012-09-04 Thread Kim, Milo
and GPIO pin number are used for the LP872x DVS pin control. For better readability, DVS selection argument is added in lp872x_set_dvs(). Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/regulator/lp872x.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 5/5] regulator: lp872x: remove unnecessary function

2012-09-04 Thread Kim, Milo
The lp872x_check_dvs_validity() is used for checking DVS platform data. If the DVS platform data is not defined, return as error code. Now, this is unnecessary because the default DVS mode is set in this case. Signed-off-by: Milo(Woogyom) Kim milo@ti.com --- drivers/regulator/lp872x.c

[PATCH 3/5] regulator: lp872x: initialize the DVS mode

2012-09-04 Thread Kim, Milo
The platform specific configuration(general_config) is optional. However, the DVS settings should be configured explicitly while loading the driver. This patch enables configuring the default DVS mode even though the platform data is not defined. Signed-off-by: Milo(Woogyom) Kim milo

[PATCH 00/22] lp8727_charger: clean up code

2012-08-31 Thread Kim, Milo
LP8727 driver should be fixed for several reasons. (a) Need to clean up _probe() and _remove() (b) Not secure code when the platform data is NULL (c) Improved the interrupt handling (d) Lots of definitions should be unique. (e) Others... Patch v2. These patches are submitted more separately.

[PATCH 21/22] lp8727_charger: fix checkpatch warning

2012-08-31 Thread Kim, Milo
Fix the warning on MODULE_AUTHOR. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index 772e509..005aaae 100644 ---

[PATCH 20/22] lp8727_charger: add description in the private data

2012-08-31 Thread Kim, Milo
Add description and relocate data. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index b3295a7..772e509 100644 ---

[PATCH 22/22] lp8727_charger: make cosmetic code

2012-08-31 Thread Kim, Milo
This is really minor, but it improves the readability. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c |3 ++- include/linux/platform_data/lp8727.h |8 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/power/lp8727_charger.c

[PATCH 19/22] lp8727_charger: fix typo - chg_parm to chg_param

2012-08-31 Thread Kim, Milo
Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index 62102c4..b3295a7 100644 --- a/drivers/power/lp8727_charger.c +++

[PATCH 18/22] lp8727_charger: make cosmetic code on lp8727_delayed_func()

2012-08-31 Thread Kim, Milo
Declare a variable at one line and align lines. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index a01059f..62102c4 100644 ---

[PATCH 17/22] lp8727_charger: clean up lp8727_charger_changed()

2012-08-31 Thread Kim, Milo
Declare a variable at one line. Just return when no charger exists to make code simpler. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/power/lp8727_charger.c

[PATCH 16/22] lp8727_charger: return if the battery is discharging

2012-08-31 Thread Kim, Milo
If the charger is pulled out, just return as DISCHARGING. Then no need for additional 'else' statement. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/power/lp8727_charger.c

[PATCH 15/22] lp8727_charger: make lp8727_charger_get_propery() simpler

2012-08-31 Thread Kim, Milo
Charger has only one valid property - ONLINE. If the property is not ONLINE, then just return quickly. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/power/lp8727_charger.c

[PATCH 14/22] lp8727_charger: make lp8727_ctrl_switch() inline

2012-08-31 Thread Kim, Milo
Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index 47cce41..880bb7b 100644 --- a/drivers/power/lp8727_charger.c +++

[PATCH 13/22] lp8727_charger: make lp8727_init_device() shorter

2012-08-31 Thread Kim, Milo
Return as the result of writing register. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c |6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index 658518b..47cce41 100644 ---

[PATCH 12/22] lp8727_charger: clean up lp8727_is_charger_attached()

2012-08-31 Thread Kim, Milo
Change return type as boolean. Remove unnecessary check routine for NULL string. (Power supply name is always valid when the function is executed.) Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff

[PATCH 11/22] lp8727_charger: use specific definition

2012-08-31 Thread Kim, Milo
Add new LP8727_ICHG_SHIFT definition and replace a magic number. Reuse definition for the size of interrupt register buffer. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git

[PATCH 10/22] lp8727_charger: clean up lp8727 definitions

2012-08-31 Thread Kim, Milo
All definitions should be unique - not general name. So the prefix LP8727_ are added. Additionally, use BIT() macro for bit masks. Remove unnecessary definitions such as SW_DM1_U1 and SW_DP2_U2. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c | 130

[PATCH 09/22] lp8727_charger: use the definition rather than enum

2012-08-31 Thread Kim, Milo
Enum lp8727_chg_state can be removed because only one charger status is used - EOC(End Of Charge). To check whether the EOC is reached or not, use simple comparison rather than shift-operation. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c | 16 +--- 1

[PATCH 08/22] lp8727_charger: fix code for getting battery temp

2012-08-31 Thread Kim, Milo
For better understanding, use specific function and definitions rather than magic numbers. New enum type for die temperature is matched with hex codes. Specific temperature names are better than 0x1, 0x2 and 0x3. And lp8727_is_high_temperature() function has better readability than

[PATCH 07/22] lp8727_charger: clear interrrupts at inital time

2012-08-31 Thread Kim, Milo
To initialize the device, previous interrupts need to be cleared while loading the driver. Signed-off-by: Milo(Woogyom) Kim --- drivers/power/lp8727_charger.c |8 1 file changed, 8 insertions(+) diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index

[PATCH 06/22] lp8727_charger: clean up the interrupt handler

2012-08-31 Thread Kim, Milo
For better understanding, function name is changed. (lp8727_intr_config() is replaced with lp8727_setup_irq().) The private IRQ number is set when the IRQ is allocated successfully. This data is used for releasing the IRQ on unloading the driver. Even the IRQ number is not defined, the

<    1   2   3   4   5   6   7   8   >