<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/power/supply, branch v4.9</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>power: supply: bq27xxx_battery: allow kernel poll_interval parameter runtime update</title>
<updated>2016-09-21T00:08:04+00:00</updated>
<author>
<name>Matt Ranostay</name>
<email>mranostay@gmail.com</email>
</author>
<published>2016-09-20T03:43:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1d72706f0485b58e151b5a7584c4c65d66670587'/>
<id>1d72706f0485b58e151b5a7584c4c65d66670587</id>
<content type='text'>
Fix issue with poll_interval being not updated till the previous
interval expired.

Cc: Tony Lindgren &lt;tony@atomide.com&gt;
Cc: Liam Breck &lt;liam@networkimprov.net&gt;
Signed-off-by: Matt Ranostay &lt;matt@ranostay.consulting&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix issue with poll_interval being not updated till the previous
interval expired.

Cc: Tony Lindgren &lt;tony@atomide.com&gt;
Cc: Liam Breck &lt;liam@networkimprov.net&gt;
Signed-off-by: Matt Ranostay &lt;matt@ranostay.consulting&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: sbs-battery: Cleanup removal of chip-&gt;pdata</title>
<updated>2016-09-21T00:04:47+00:00</updated>
<author>
<name>Phil Reid</name>
<email>preid@electromag.com.au</email>
</author>
<published>2016-09-20T01:01:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=389958bb6be8b08c9f6d350dcaa9fc127123eada'/>
<id>389958bb6be8b08c9f6d350dcaa9fc127123eada</id>
<content type='text'>
There where still a few lingering references to pdata after commit
power: supply: sbs-battery: simplify DT parsing.

Remove pdata from struct·sbs_info and conditional checks to ser if this
was set from the i2c read / write functions.
Instead of call max in each function for incrementing poll_retry_count
do it once in the probe function.
Fixup null pointer dereference in to pdata in sbs_external_power_changed.
Change retry counts to u32 to avoid need for max.

Signed-off-by: Phil Reid &lt;preid@electromag.com.au&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There where still a few lingering references to pdata after commit
power: supply: sbs-battery: simplify DT parsing.

Remove pdata from struct·sbs_info and conditional checks to ser if this
was set from the i2c read / write functions.
Instead of call max in each function for incrementing poll_retry_count
do it once in the probe function.
Fixup null pointer dereference in to pdata in sbs_external_power_changed.
Change retry counts to u32 to avoid need for max.

Signed-off-by: Phil Reid &lt;preid@electromag.com.au&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: ab8500: cleanup with list_first_entry_or_null()</title>
<updated>2016-09-19T19:22:10+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2016-09-12T18:23:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f04f7aef7f6aafdc0ba54c6b9670cd11f9d9200a'/>
<id>f04f7aef7f6aafdc0ba54c6b9670cd11f9d9200a</id>
<content type='text'>
The combo of list_empty() check and return list_first_entry()
can be replaced with list_first_entry_or_null().

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The combo of list_empty() check and return list_first_entry()
can be replaced with list_first_entry_or_null().

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sbs-battery: make writes to ManufacturerAccess optional</title>
<updated>2016-09-19T19:02:17+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-09-09T02:10:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=17c6d3979e5bbff1de36a4e89015fa09ac495d27'/>
<id>17c6d3979e5bbff1de36a4e89015fa09ac495d27</id>
<content type='text'>
According to the Smart Battery Data Specification, the use
of ManufacturerAcess (register 0x0) is implementation-defined.
It appears that some batteries use writes to this register
in order to implement certain functionality, but others may
simply NAK all writes to it. As a result, write failures to
ManufacturerAccess should not be used as an indicator of
battery presence, nor as a failure to enter sleep mode.

The failed write access was seen with SANYO AP13J3K.

Cc: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to the Smart Battery Data Specification, the use
of ManufacturerAcess (register 0x0) is implementation-defined.
It appears that some batteries use writes to this register
in order to implement certain functionality, but others may
simply NAK all writes to it. As a result, write failures to
ManufacturerAccess should not be used as an indicator of
battery presence, nor as a failure to enter sleep mode.

The failed write access was seen with SANYO AP13J3K.

Cc: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: bq24257: Fix use of uninitialized pointer bq-&gt;charger</title>
<updated>2016-09-19T18:56:22+00:00</updated>
<author>
<name>Georges Savoundararadj</name>
<email>savoundg@gmail.com</email>
</author>
<published>2016-09-08T01:38:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0610735928ee47870e083d5901caa371089216f1'/>
<id>0610735928ee47870e083d5901caa371089216f1</id>
<content type='text'>
bq-&gt;charger is initialized in bq24257_power_supply_init.
Therefore, bq24257_power_supply_init should be called before the
registration of the IRQ handler bq24257_irq_handler_thread that calls
power_supply_changed(bq-&gt;charger).

Signed-off-by: Georges Savoundararadj &lt;savoundg@gmail.com&gt;
Cc: Aurelien Chanot &lt;chanot.a@gmail.com&gt;
Cc: Andreas Dannenberg &lt;dannenberg@ti.com&gt;
Cc: Sebastian Reichel &lt;sre@kernel.org&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Fixes: 2219a935963e ("power_supply: Add TI BQ24257 charger driver")
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
bq-&gt;charger is initialized in bq24257_power_supply_init.
Therefore, bq24257_power_supply_init should be called before the
registration of the IRQ handler bq24257_irq_handler_thread that calls
power_supply_changed(bq-&gt;charger).

Signed-off-by: Georges Savoundararadj &lt;savoundg@gmail.com&gt;
Cc: Aurelien Chanot &lt;chanot.a@gmail.com&gt;
Cc: Andreas Dannenberg &lt;dannenberg@ti.com&gt;
Cc: Sebastian Reichel &lt;sre@kernel.org&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Fixes: 2219a935963e ("power_supply: Add TI BQ24257 charger driver")
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: sbs-battery: simplify DT parsing</title>
<updated>2016-09-06T23:46:59+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-09-06T13:16:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9edeaada19a21eb669ae0dfe749be88f1810ea92'/>
<id>9edeaada19a21eb669ae0dfe749be88f1810ea92</id>
<content type='text'>
After the change to use the gpio descriptor interface, we get a warning if
-Wmaybe-uninitialized is added back to the build flags (it is currently
disabled:

drivers/power/supply/sbs-battery.c: In function 'sbs_probe':
drivers/power/supply/sbs-battery.c:760:28: error: 'pdata' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The problem is that if neither the DT properties nor a platform_data
pointer are provided, the chip-&gt;pdata pointer gets set to an uninitialized
value.

Looking at the code some more, I found that the sbs_of_populate_pdata
function is more complex than necessary and has confusing calling
conventions of possibly returning a valid pointer, a NULL pointer
or an ERR_PTR pointer (in addition to the uninitialized pointer).

To fix all of that, this gets rid of the chip-&gt;pdata pointer and
simply moves the two integers into the sbs_info structure. This
makes it much clearer from reading sbs_probe() what the precedence
of the three possible values are (pdata, DT, hardcoded defaults)
and completely avoids the #ifdef CONFIG_OF guards as
of_property_read_u32() gets replaced with a compile-time stub
when that is disabled, and returns an error if passed a NULL of_node
pointer.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 3b5dd3a49496 ("power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detect")
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After the change to use the gpio descriptor interface, we get a warning if
-Wmaybe-uninitialized is added back to the build flags (it is currently
disabled:

drivers/power/supply/sbs-battery.c: In function 'sbs_probe':
drivers/power/supply/sbs-battery.c:760:28: error: 'pdata' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The problem is that if neither the DT properties nor a platform_data
pointer are provided, the chip-&gt;pdata pointer gets set to an uninitialized
value.

Looking at the code some more, I found that the sbs_of_populate_pdata
function is more complex than necessary and has confusing calling
conventions of possibly returning a valid pointer, a NULL pointer
or an ERR_PTR pointer (in addition to the uninitialized pointer).

To fix all of that, this gets rid of the chip-&gt;pdata pointer and
simply moves the two integers into the sbs_info structure. This
makes it much clearer from reading sbs_probe() what the precedence
of the three possible values are (pdata, DT, hardcoded defaults)
and completely avoids the #ifdef CONFIG_OF guards as
of_property_read_u32() gets replaced with a compile-time stub
when that is disabled, and returns an error if passed a NULL of_node
pointer.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 3b5dd3a49496 ("power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detect")
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: bq24735-charger: Request status GPIO with initial input setup</title>
<updated>2016-09-05T10:59:49+00:00</updated>
<author>
<name>Paul Kocialkowski</name>
<email>contact@paulk.fr</email>
</author>
<published>2016-09-02T22:09:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c65a8b51123a14f6960e4238bfa4673d54ee183a'/>
<id>c65a8b51123a14f6960e4238bfa4673d54ee183a</id>
<content type='text'>
This requests the status GPIO with initial input setup. It is required
to read the GPIO status at probe time and thus correctly avoid sending
I2C messages when AC is not plugged.

When requesting the GPIO without initial input setup, it always reads 0
which causes probe to fail as it assumes the charger is connected, sends
I2C messages and fails.

While at it, this switches the driver over to gpiod API.

Signed-off-by: Paul Kocialkowski &lt;contact@paulk.fr&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This requests the status GPIO with initial input setup. It is required
to read the GPIO status at probe time and thus correctly avoid sending
I2C messages when AC is not plugged.

When requesting the GPIO without initial input setup, it always reads 0
which causes probe to fail as it assumes the charger is connected, sends
I2C messages and fails.

While at it, this switches the driver over to gpiod API.

Signed-off-by: Paul Kocialkowski &lt;contact@paulk.fr&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detect</title>
<updated>2016-09-01T14:06:14+00:00</updated>
<author>
<name>Phil Reid</name>
<email>preid@electromag.com.au</email>
</author>
<published>2016-09-01T07:50:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3b5dd3a49496220b35af83c96e3d2ff5716550ae'/>
<id>3b5dd3a49496220b35af83c96e3d2ff5716550ae</id>
<content type='text'>
Switch to using new gpio_desc interface and devm gpio get calls to
automatically manage gpio resource. Use gpiod_get_value which handles
active high / low calls.

If gpio_detect is set then force loading of the driver as it is
reasonable to assume that the battery may not be present.

Update the is_present flag immediately in the IRQ.

Remove legacy gpio specification from platform data.

Signed-off-by: Phil Reid &lt;preid@electromag.com.au&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Switch to using new gpio_desc interface and devm gpio get calls to
automatically manage gpio resource. Use gpiod_get_value which handles
active high / low calls.

If gpio_detect is set then force loading of the driver as it is
reasonable to assume that the battery may not be present.

Update the is_present flag immediately in the IRQ.

Remove legacy gpio specification from platform data.

Signed-off-by: Phil Reid &lt;preid@electromag.com.au&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: act8945a_charger: Add max current property</title>
<updated>2016-09-01T11:55:55+00:00</updated>
<author>
<name>Wenyou Yang</name>
<email>wenyou.yang@atmel.com</email>
</author>
<published>2016-09-01T09:29:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=528e3504123d0281c613b83ca46aaf2dd7c3f45e'/>
<id>528e3504123d0281c613b83ca46aaf2dd7c3f45e</id>
<content type='text'>
Add the power supply's current max property,
POWER_SUPPLY_PROP_CURRENT_MAX.

Signed-off-by: Wenyou Yang &lt;wenyou.yang@atmel.com&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the power supply's current max property,
POWER_SUPPLY_PROP_CURRENT_MAX.

Signed-off-by: Wenyou Yang &lt;wenyou.yang@atmel.com&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power: supply: act8945a_charger: Add capacity level property</title>
<updated>2016-09-01T11:55:52+00:00</updated>
<author>
<name>Wenyou Yang</name>
<email>wenyou.yang@atmel.com</email>
</author>
<published>2016-09-01T09:29:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=369eba0986d503302784f55f1020129bf802ae72'/>
<id>369eba0986d503302784f55f1020129bf802ae72</id>
<content type='text'>
Add the power supply capacity level property, it corresponds to
POWER_SUPPLY_CAPACITY_LEVEL_*.

It also utilizes the precision voltage detector function module
to catch the low battery voltage.

Signed-off-by: Wenyou Yang &lt;wenyou.yang@atmel.com&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the power supply capacity level property, it corresponds to
POWER_SUPPLY_CAPACITY_LEVEL_*.

It also utilizes the precision voltage detector function module
to catch the low battery voltage.

Signed-off-by: Wenyou Yang &lt;wenyou.yang@atmel.com&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
