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
(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
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
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
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
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
.
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
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
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
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
> -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
>
&
-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
> 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
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
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
> > 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
> 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
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
> > 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
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.
> 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
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
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
.
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
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
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
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
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
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
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
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
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
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
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
> > 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) /
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
> 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
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
> 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
>
> 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, \
> > +
> 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
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:
+
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, \
+
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
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
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
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
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
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
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
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
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
---
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
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
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
-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
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
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
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
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
> -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
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
,
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
-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
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
---
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
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
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
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
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
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
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
---
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
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
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
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
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
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
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
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
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
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
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.
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
---
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
---
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
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
+++
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
---
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
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
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
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
+++
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
---
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
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
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
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
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
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
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
501 - 600 of 758 matches
Mail list logo