<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/power, branch v5.10.185</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.185</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.185'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-06-05T07:07:02+00:00</updated>
<entry>
<title>power: supply: bq27xxx: Ensure power_supply_changed() is called on current sign changes</title>
<updated>2023-06-05T07:07:02+00:00</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2023-04-15T18:23:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0949c572d42df8a1b78c5583ed4345e0ff06e06f'/>
<id>urn:sha1:0949c572d42df8a1b78c5583ed4345e0ff06e06f</id>
<content type='text'>
[ Upstream commit 939a116142012926e25de0ea6b7e2f8d86a5f1b6 ]

On gauges where the current register is signed, there is no charging
flag in the flags register. So only checking flags will not result
in power_supply_changed() getting called when e.g. a charger is plugged
in and the current sign changes from negative (discharging) to
positive (charging).

This causes userspace's notion of the status to lag until userspace
does a poll.

And when a power_supply_leds.c LED trigger is used to indicate charging
status with a LED, this LED will lag until the capacity percentage
changes, which may take many minutes (because the LED trigger only is
updated on power_supply_changed() calls).

Fix this by calling bq27xxx_battery_current_and_status() on gauges with
a signed current register and checking if the status has changed.

Fixes: 297a533b3e62 ("bq27x00: Cache battery registers")
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: supply: bq27xxx: Fix poll_interval handling and races on remove</title>
<updated>2023-05-30T11:57:58+00:00</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2023-04-15T18:23:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e85757da9091998276ff21a13915ac25229cc232'/>
<id>urn:sha1:e85757da9091998276ff21a13915ac25229cc232</id>
<content type='text'>
commit c00bc80462afc7963f449d7f21d896d2f629cacc upstream.

Before this patch bq27xxx_battery_teardown() was setting poll_interval = 0
to avoid bq27xxx_battery_update() requeuing the delayed_work item.

There are 2 problems with this:

1. If the driver is unbound through sysfs, rather then the module being
   rmmod-ed, this changes poll_interval unexpectedly

2. This is racy, after it being set poll_interval could be changed
   before bq27xxx_battery_update() checks it through
   /sys/module/bq27xxx_battery/parameters/poll_interval

Fix this by added a removed attribute to struct bq27xxx_device_info and
using that instead of setting poll_interval to 0.

There also is another poll_interval related race on remove(), writing
/sys/module/bq27xxx_battery/parameters/poll_interval will requeue
the delayed_work item for all devices on the bq27xxx_battery_devices
list and the device being removed was only removed from that list
after cancelling the delayed_work item.

Fix this by moving the removal from the bq27xxx_battery_devices list
to before cancelling the delayed_work item.

Fixes: 8cfaaa811894 ("bq27x00_battery: Fix OOPS caused by unregistring bq27x00 driver")
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>power: supply: max17042_battery: fix typo in MAx17042_TOFF</title>
<updated>2021-09-15T07:50:26+00:00</updated>
<author>
<name>Sebastian Krzyszkowiak</name>
<email>sebastian.krzyszkowiak@puri.sm</email>
</author>
<published>2021-08-16T16:50:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d0831db736bb88ea60ac6982f1b5c355d861bd41'/>
<id>urn:sha1:d0831db736bb88ea60ac6982f1b5c355d861bd41</id>
<content type='text'>
[ Upstream commit ed0d0a0506025f06061325cedae1bbebd081620a ]

Signed-off-by: Sebastian Krzyszkowiak &lt;sebastian.krzyszkowiak@puri.sm&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: supply: bq27xxx: fix power_avg for newer ICs</title>
<updated>2021-05-11T12:47:24+00:00</updated>
<author>
<name>Matthias Schiffer</name>
<email>matthias.schiffer@ew.tq-group.com</email>
</author>
<published>2021-03-03T09:54:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ff0d8a0904bf38dd0f0c403e52e166b66c11e49'/>
<id>urn:sha1:8ff0d8a0904bf38dd0f0c403e52e166b66c11e49</id>
<content type='text'>
[ Upstream commit c4d57c22ac65bd503716062a06fad55a01569cac ]

On all newer bq27xxx ICs, the AveragePower register contains a signed
value; in addition to handling the raw value as unsigned, the driver
code also didn't convert it to µW as expected.

At least for the BQ28Z610, the reference manual incorrectly states that
the value is in units of 1mW and not 10mW. I have no way of knowing
whether the manuals of other supported ICs contain the same error, or if
there are models that actually use 1mW. At least, the new code shouldn't
be *less* correct than the old version for any device.

power_avg is removed from the cache structure, se we don't have to
extend it to store both a signed value and an error code. Always getting
an up-to-date value may be desirable anyways, as it avoids inconsistent
current and power readings when switching between charging and
discharging.

Signed-off-by: Matthias Schiffer &lt;matthias.schiffer@ew.tq-group.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: supply: bq27xxx: add support for TI bq34z100</title>
<updated>2020-10-01T22:01:42+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzk@kernel.org</email>
</author>
<published>2020-09-19T14:04:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=41a7431dbaa37533c3b732cdea425a7b8f2d4162'/>
<id>urn:sha1:41a7431dbaa37533c3b732cdea425a7b8f2d4162</id>
<content type='text'>
Add support for new device: the TI bq34z100-G1, a Wide Range Fuel Gauge
for Li-Ion, PbA, NiMH, and NiCd batteries.  The device shares a lot with
other models, although it has its own differences requiring new quirks.

This patch was tested on a system equipped with NiMH batteries.

Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: charger-manager: Update extcon functions</title>
<updated>2020-08-28T17:27:45+00:00</updated>
<author>
<name>Jonathan Bakker</name>
<email>xc-racer2@live.ca</email>
</author>
<published>2020-05-14T23:04:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c1f73028f75df43689feda4bc70573b7d18a618e'/>
<id>urn:sha1:c1f73028f75df43689feda4bc70573b7d18a618e</id>
<content type='text'>
In commit 830ae442202e ("extcon: Remove the deprecated extcon functions")
the function extcon_register_interest became a no-op returning an error,
leading to non-functional behaviour in charger-manager.

Additionally, a translation table is needed between the text representation
of the extcon cable names and their IDs is needed.  In order to retain DT
compatibility, TA and CHARGE-DOWNSTREAM are added as they were present up
until commit 11eecf910bd8 ("extcon: Modify the id and name of external
connector")

Signed-off-by: Jonathan Bakker &lt;xc-racer2@live.ca&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: charger-manager: Make decisions focussed on battery status</title>
<updated>2020-08-28T17:27:45+00:00</updated>
<author>
<name>Jonghwa Lee</name>
<email>jonghwa3.lee@samsung.com</email>
</author>
<published>2020-05-14T23:04:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e132fc6bb89bd307cfcdb8ba24afcd1985261485'/>
<id>urn:sha1:e132fc6bb89bd307cfcdb8ba24afcd1985261485</id>
<content type='text'>
cm_monitor(), where charging management starts, checks various charging
condition sequentially to decide next charging operation. However, as it
follows sequential process, cascaded if statements, it does some
jobs which have already done in the previous stage. This results in a
delay in decision making. Moreover, starting point of charging is spread
all around which makes maintain code and debugging difficult.

Both of the problems mentioned above become clean if it manages battery
charging focusing on battery status not following sequential condition
checking.  Now, cm_monitor() moves battery state diagram and does the
optimal operation for current state. As a result, it reduces whole
monitoring time almost in half.

Signed-off-by: Jonghwa Lee &lt;jonghwa3.lee@samsung.com&gt;
Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Jonathan Bakker &lt;xc-racer2@live.ca&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: charger-manager: Remove cm_notify_event function</title>
<updated>2020-08-28T17:03:24+00:00</updated>
<author>
<name>Jonghwa Lee</name>
<email>jonghwa3.lee@samsung.com</email>
</author>
<published>2020-05-14T23:04:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9584051f3cf3af181e577960956bb7c085879b67'/>
<id>urn:sha1:9584051f3cf3af181e577960956bb7c085879b67</id>
<content type='text'>
cm_notify_event() was introduced to get an event associated with the
battery status externally (ie in board files), but no one ever used it.
Moreover it makes charger manager driver more complicated. Drop the
function and all data related to it to simplify the driver.

Signed-off-by: Jonghwa Lee &lt;jonghwa3.lee@samsung.com&gt;
Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Jonathan Bakker &lt;xc-racer2@live.ca&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: smb347-charger: Drop pdata support</title>
<updated>2020-08-28T13:33:10+00:00</updated>
<author>
<name>Sebastian Reichel</name>
<email>sebastian.reichel@collabora.com</email>
</author>
<published>2020-08-26T14:41:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b6f3e21b928a8ae7959a0d79203b80bd70120768'/>
<id>urn:sha1:b6f3e21b928a8ae7959a0d79203b80bd70120768</id>
<content type='text'>
There are no platforms using the pdata support, so let's
drop it to simplify the driver.

Reviewed-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Tested-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: gpio-charger: Convert to GPIO descriptors</title>
<updated>2020-08-27T14:47:14+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2020-08-27T08:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=17529bcf0ae20f1ac6d7846762bf0c6ad91dbb7f'/>
<id>urn:sha1:17529bcf0ae20f1ac6d7846762bf0c6ad91dbb7f</id>
<content type='text'>
This converts the GPIO charger to use exclusively GPIO
descriptors, moving the two remaining platforms passing
global GPIO numbers over to using a GPIO descriptor table.

Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Robert Jarzmik &lt;robert.jarzmik@free.fr&gt;
Cc: Dmitry Eremin-Solenikov &lt;dbaryshkov@gmail.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
</feed>
