<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/power, branch v4.0</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.0</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.0'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-01-21T19:52:07Z</updated>
<entry>
<title>power: charger-manager: Use alarmtimer for battery monitoring in suspend.</title>
<updated>2015-01-21T19:52:07Z</updated>
<author>
<name>Jonghwa Lee</name>
<email>jonghwa3.lee@samsung.com</email>
</author>
<published>2014-12-19T08:55:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c1155c64e603378dccfc21ee0612cf60dd11725b'/>
<id>urn:sha1:c1155c64e603378dccfc21ee0612cf60dd11725b</id>
<content type='text'>
To guerantee proper charing and managing batteries even in suspend,
charger-manager has used rtc device with rtc framework interface.
However, it is better to use alarmtimer for cleaner and more appropriate
operation.
This patch makes driver to use alarmtimer for polling work in suspend and
removes all deprecated codes related with using rtc interface.

Signed-off-by: Jonghwa Lee &lt;jonghwa3.lee@samsung.com&gt;
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: charger-manager: Fix accessing invalidated power supply after charger unbind</title>
<updated>2014-10-28T02:30:21Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2014-10-13T13:34:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cdaf3e15385d3232b52287e50692506f8fd01a09'/>
<id>urn:sha1:cdaf3e15385d3232b52287e50692506f8fd01a09</id>
<content type='text'>
The charger manager obtained in probe references to power supplies for
all chargers with power_supply_get_by_name() for later usage. However
if such charger driver was removed then this reference would point to
old power supply (from driver which was removed).

This lead to accessing invalid memory which could be observed with:
$ echo "max77693-charger" &gt; /sys/bus/platform/drivers/max77693-charger/unbind
$ grep . /sys/devices/virtual/power_supply/battery/charger.0/*
$ grep . /sys/devices/virtual/power_supply/battery/*
[   15.339817] Unable to handle kernel paging request at virtual address 0001c12c
[   15.346187] pgd = edd08000
[   15.348814] [0001c12c] *pgd=6dce2831, *pte=00000000, *ppte=00000000
[   15.355075] Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM
[   15.360967] Modules linked in:
[   15.364010] CPU: 2 PID: 1388 Comm: grep Not tainted 3.17.0-next-20141007-00027-ga95e761db1b0 #245
[   15.372859] task: ee03ad00 ti: edcf6000 task.ti: edcf6000
[   15.378241] PC is at 0x1c12c
[   15.381113] LR is at is_ext_pwr_online+0x30/0x6c
[   15.385706] pc : [&lt;0001c12c&gt;]    lr : [&lt;c0339fc4&gt;]    psr: a0000013
[   15.385706] sp : edcf7e88  ip : 00000000  fp : 00000000
[   15.397161] r10: eeb02c08  r9 : c04b1f84  r8 : eeb02c00
[   15.402369] r7 : edc69a10  r6 : eea6ac10  r5 : eea6ac10  r4 : 00000004
[   15.408878] r3 : 0001c12c  r2 : edcf7e8c  r1 : 00000004  r0 : ee914418
[   15.415390] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   15.422506] Control: 10c5387d  Table: 6dd0804a  DAC: 00000015
[   15.428236] Process grep (pid: 1388, stack limit = 0xedcf6240)
[   15.434050] Stack: (0xedcf7e88 to 0xedcf8000)
[   15.438395] 7e80:                   ee03ad00 00000000 edcf7f80 eea6aca8 edcf7ec4 c033b7b0
[   15.446554] 7ea0: 00000001 ee1cc3f0 00000004 c06e1e44 eebdc000 c06e1e44 eeb02c00 c0337144
[   15.454713] 7ec0: ee2dac68 c005cffc ee1cc3c0 c06e1e44 00000fff 00001000 eebdc000 c0278ca8
[   15.462872] 7ee0: c0278c8c ee1cc3c0 eeb7ce00 c014422c edcf7f20 00008000 ee1cc3c0 ee9a48c0
[   15.471030] 7f00: 00000001 00000001 edcf7f80 c0142d94 c0142d70 c01060f4 00021000 ee1cc3f0
[   15.479190] 7f20: 00000000 00000000 c06a2150 eebdc000 2e7ec000 ee9a48c0 00008000 00021000
[   15.487349] 7f40: edcf7f80 00008000 edcf6000 00021000 00021000 c00e39a4 00000000 ee9a48c0
[   15.495508] 7f60: 00004000 00000000 00000000 ee9a48c0 ee9a48c0 00008000 00021000 c00e3aa0
[   15.503668] 7f80: 00000000 00000000 0001f2e0 0001f2e0 00021000 00001000 00000003 c000f364
[   15.511826] 7fa0: 00000000 c000f1a0 0001f2e0 00021000 00000003 00021000 00008000 00000000
[   15.519986] 7fc0: 0001f2e0 00021000 00001000 00000003 00000001 000205e8 00000000 00021000
[   15.528145] 7fe0: 00008000 bebbe910 0000a7ad b6edc49c 60000010 00000003 aaaaaaaa aaaaaaaa
[   15.536320] [&lt;c0339fc4&gt;] (is_ext_pwr_online) from [&lt;c033b7b0&gt;] (charger_get_property+0x170/0x314)
[   15.545164] [&lt;c033b7b0&gt;] (charger_get_property) from [&lt;c0337144&gt;] (power_supply_show_property+0x48/0x20c)
[   15.554719] [&lt;c0337144&gt;] (power_supply_show_property) from [&lt;c0278ca8&gt;] (dev_attr_show+0x1c/0x48)
[   15.563577] [&lt;c0278ca8&gt;] (dev_attr_show) from [&lt;c014422c&gt;] (sysfs_kf_seq_show+0x84/0x104)
[   15.571725] [&lt;c014422c&gt;] (sysfs_kf_seq_show) from [&lt;c0142d94&gt;] (kernfs_seq_show+0x24/0x28)
[   15.579973] [&lt;c0142d94&gt;] (kernfs_seq_show) from [&lt;c01060f4&gt;] (seq_read+0x1b0/0x484)
[   15.587614] [&lt;c01060f4&gt;] (seq_read) from [&lt;c00e39a4&gt;] (vfs_read+0x88/0x144)
[   15.594552] [&lt;c00e39a4&gt;] (vfs_read) from [&lt;c00e3aa0&gt;] (SyS_read+0x40/0x8c)
[   15.601417] [&lt;c00e3aa0&gt;] (SyS_read) from [&lt;c000f1a0&gt;] (ret_fast_syscall+0x0/0x48)
[   15.608877] Code: bad PC value
[   15.611991] ---[ end trace a88fcc95208db283 ]---

The charger-manager should get reference to charger power supply on
each use of get_property callback.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 3bb3dbbd56ea ("power_supply: Add initial Charger-Manager driver")
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: charger-manager: Fix accessing invalidated power supply after fuel gauge unbind</title>
<updated>2014-10-28T02:30:20Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2014-10-13T13:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bdbe81445407644492b9ac69a24d35e3202d773b'/>
<id>urn:sha1:bdbe81445407644492b9ac69a24d35e3202d773b</id>
<content type='text'>
The charger manager obtained reference to fuel gauge power supply in probe
with power_supply_get_by_name() for later usage. However if fuel gauge
driver was removed and re-added then this reference would point to old
power supply (from driver which was removed).

This lead to accessing old (and probably invalid) memory which could be
observed with:
$ echo "12-0036" &gt; /sys/bus/i2c/drivers/max17042/unbind
$ echo "12-0036" &gt; /sys/bus/i2c/drivers/max17042/bind
$ cat /sys/devices/virtual/power_supply/battery/capacity
[  240.480084] INFO: task cat:1393 blocked for more than 120 seconds.
[  240.484799]       Not tainted 3.17.0-next-20141007-00028-ge60b6dd79570 #203
[  240.491782] "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  240.499589] cat             D c0469530     0  1393      1 0x00000000
[  240.505947] [&lt;c0469530&gt;] (__schedule) from [&lt;c0469d3c&gt;] (schedule_preempt_disabled+0x14/0x20)
[  240.514449] [&lt;c0469d3c&gt;] (schedule_preempt_disabled) from [&lt;c046af08&gt;] (mutex_lock_nested+0x1bc/0x458)
[  240.523736] [&lt;c046af08&gt;] (mutex_lock_nested) from [&lt;c0287a98&gt;] (regmap_read+0x30/0x60)
[  240.531647] [&lt;c0287a98&gt;] (regmap_read) from [&lt;c032238c&gt;] (max17042_get_property+0x2e8/0x350)
[  240.540055] [&lt;c032238c&gt;] (max17042_get_property) from [&lt;c03247d8&gt;] (charger_get_property+0x264/0x348)
[  240.549252] [&lt;c03247d8&gt;] (charger_get_property) from [&lt;c0320764&gt;] (power_supply_show_property+0x48/0x1e0)
[  240.558808] [&lt;c0320764&gt;] (power_supply_show_property) from [&lt;c027308c&gt;] (dev_attr_show+0x1c/0x48)
[  240.567664] [&lt;c027308c&gt;] (dev_attr_show) from [&lt;c0141fb0&gt;] (sysfs_kf_seq_show+0x84/0x104)
[  240.575814] [&lt;c0141fb0&gt;] (sysfs_kf_seq_show) from [&lt;c0140b18&gt;] (kernfs_seq_show+0x24/0x28)
[  240.584061] [&lt;c0140b18&gt;] (kernfs_seq_show) from [&lt;c0104574&gt;] (seq_read+0x1b0/0x484)
[  240.591702] [&lt;c0104574&gt;] (seq_read) from [&lt;c00e1e24&gt;] (vfs_read+0x88/0x144)
[  240.598640] [&lt;c00e1e24&gt;] (vfs_read) from [&lt;c00e1f20&gt;] (SyS_read+0x40/0x8c)
[  240.605507] [&lt;c00e1f20&gt;] (SyS_read) from [&lt;c000e760&gt;] (ret_fast_syscall+0x0/0x48)
[  240.612952] 4 locks held by cat/1393:
[  240.616589]  #0:  (&amp;p-&gt;lock){+.+.+.}, at: [&lt;c01043f4&gt;] seq_read+0x30/0x484
[  240.623414]  #1:  (&amp;of-&gt;mutex){+.+.+.}, at: [&lt;c01417dc&gt;] kernfs_seq_start+0x1c/0x8c
[  240.631086]  #2:  (s_active#31){++++.+}, at: [&lt;c01417e4&gt;] kernfs_seq_start+0x24/0x8c
[  240.638777]  #3:  (&amp;map-&gt;mutex){+.+...}, at: [&lt;c0287a98&gt;] regmap_read+0x30/0x60

The charger-manager should get reference to fuel gauge power supply on
each use of get_property callback. The thermal zone 'tzd' field of
power supply should not be used because of the same reason.

Additionally this change solves also the issue with nested
thermal_zone_get_temp() calls and related false lockdep positive for
deadlock for thermal zone's mutex [1]. When fuel gauge is used as source of
temperature then the charger manager forwards its get_temp calls to fuel
gauge thermal zone. So actually different mutexes are used (one for
charger manager thermal zone and second for fuel gauge thermal zone) but
for lockdep this is one class of mutex.

The recursion is removed by retrieving temperature through power
supply's get_property().

In case external thermal zone is used ('cm-thermal-zone' property is
present in DTS) the recursion does not exist. Charger manager simply
exports POWER_SUPPLY_PROP_TEMP_AMBIENT property (instead of
POWER_SUPPLY_PROP_TEMP) thus no thermal zone is created for this power
supply.

[1] https://lkml.org/lkml/2014/10/6/309

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 3bb3dbbd56ea ("power_supply: Add initial Charger-Manager driver")
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
</content>
</entry>
<entry>
<title>isp1704_charger: Add DT support</title>
<updated>2013-12-24T02:34:58Z</updated>
<author>
<name>Sebastian Reichel</name>
<email>sre@debian.org</email>
</author>
<published>2013-12-01T01:00:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=34a109610e2a78b56be22fa314054c09669075eb'/>
<id>urn:sha1:34a109610e2a78b56be22fa314054c09669075eb</id>
<content type='text'>
This patch introduces device tree support to the isp1704 charger driver.
Adding support involved moving the handling of the enable GPIO from board
code into the driver.

Signed-off-by: Sebastian Reichel &lt;sre@debian.org&gt;
Signed-off-by: Anton Vorontsov &lt;anton@enomsg.org&gt;
</content>
</entry>
<entry>
<title>bq2415x_charger: Use power_supply notifier for automode</title>
<updated>2013-12-24T01:58:03Z</updated>
<author>
<name>Pali Rohár</name>
<email>pali.rohar@gmail.com</email>
</author>
<published>2013-11-19T10:18:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=32260308b4cafcd71b1c0aac35675dc68120c33d'/>
<id>urn:sha1:32260308b4cafcd71b1c0aac35675dc68120c33d</id>
<content type='text'>
This patch removing set_mode_hook function from board data and replacing
it with new string variable of notifier power supply device. After this
change it is possible to add DT support because driver does not need
specific board function anymore. Only static data and name of power supply
device is required.

Signed-off-by: Pali Rohár &lt;pali.rohar@gmail.com&gt;
Reviewed-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Anton Vorontsov &lt;anton@enomsg.org&gt;
</content>
</entry>
<entry>
<title>charger-manager: Support deivce tree in charger manager driver</title>
<updated>2013-12-24T01:10:07Z</updated>
<author>
<name>Jonghwa Lee</name>
<email>jonghwa3.lee@samsung.com</email>
</author>
<published>2013-12-18T06:42:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=856ee6115e2de98cb83389ce18116e6d5b90e817'/>
<id>urn:sha1:856ee6115e2de98cb83389ce18116e6d5b90e817</id>
<content type='text'>
Charger-manager can parse charger_desc data from devicetree which is used
to register charger manager.

Signed-off-by: Jonghwa Lee &lt;jonghwa3.lee@samsung.com&gt;
Signed-off-by: Myungjoo Ham &lt;myungjoo.ham@samsung.com&gt;
Signed-off-by: Anton Vorontsov &lt;anton@enomsg.org&gt;
</content>
</entry>
<entry>
<title>charger-manager: Modify the way of checking battery's temperature</title>
<updated>2013-12-24T01:09:09Z</updated>
<author>
<name>Jonghwa Lee</name>
<email>jonghwa3.lee@samsung.com</email>
</author>
<published>2013-12-18T06:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5c49a6256bed52f639ed70d252b1c91d1ab899d6'/>
<id>urn:sha1:5c49a6256bed52f639ed70d252b1c91d1ab899d6</id>
<content type='text'>
Charger-manager driver used to check battery temperature through the
callback function passed by platform data. Unfortunatley, without that
pre-defined callback function, charger-manager can't get battery's
temperature at all. Also passing callback function through platform data
ruins DT support for charger-manager.

This patch mondifies charger-manager driver to get temperature of battery
without pre-defined callback function. Now, charger-manager can use either
of battery thermometer in fuel-gauge and ouside of battery. It uses
thermal framework interface for outer thermometer if thermal fw is
enabled. Otherwise, it tries to use fuel-gauge's through the power supply
interface.

Signed-off-by: Jonghwa Lee &lt;jonghwa3.lee@samsung.com&gt;
Signed-off-by: Myungjoo Ham &lt;myungjoo.ham@samsung.com&gt;
Signed-off-by: Anton Vorontsov &lt;anton@enomsg.org&gt;
</content>
</entry>
<entry>
<title>power_supply: Add support for bq24735 charger</title>
<updated>2013-10-25T22:56:51Z</updated>
<author>
<name>Darbha Sriharsha</name>
<email>dsriharsha@nvidia.com</email>
</author>
<published>2013-10-11T21:15:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ce77399226313a72578b5b0d67e289d3f165b8ba'/>
<id>urn:sha1:ce77399226313a72578b5b0d67e289d3f165b8ba</id>
<content type='text'>
Adds support for the bq24735 charger chipset. The bq24735 is a
high-efficiency, synchronous battery charger.

It allows control of the charging current, input current, and the charger
voltage DAC's through SMBus.

Signed-off-by: Darbha Sriharsha &lt;dsriharsha@nvidia.com&gt;
Signed-off-by: Rhyland Klein &lt;rklein@nvidia.com&gt;
Thanks-to: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Thanks-to: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Thanks-to: Manish Badarkhe &lt;badarkhe.manish@gmail.com&gt;
Signed-off-by: Anton Vorontsov &lt;anton@enomsg.org&gt;
</content>
</entry>
<entry>
<title>power: Add twl4030_madc battery driver.</title>
<updated>2013-08-31T00:34:52Z</updated>
<author>
<name>Marek Belisko</name>
<email>marek@goldelico.com</email>
</author>
<published>2013-08-29T09:41:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=da0a00ebc239e852a504abfce2ad98957434ae58'/>
<id>urn:sha1:da0a00ebc239e852a504abfce2ad98957434ae58</id>
<content type='text'>
This driver is used and tested on gta04 phone. It's using twl4030_madc
(similar to rx51 existing driver). Driver also implement charging and
discharging calibration data so user can define ranges and level.

Signed-off-by: Marek Belisko &lt;marek@goldelico.com&gt;
Signed-off-by: Lukas Märdian &lt;lukas@goldelico.com&gt;
Signed-off-by: Anton Vorontsov &lt;anton@enomsg.org&gt;
</content>
</entry>
<entry>
<title>bq24190_charger: Add support for TI BQ24190 Battery Charger</title>
<updated>2013-08-28T01:17:54Z</updated>
<author>
<name>Mark A. Greer</name>
<email>mgreer@animalcreek.com</email>
</author>
<published>2013-08-24T02:21:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d7bf353fd0aa3e12060ce64c8a7b4aaf4336145c'/>
<id>urn:sha1:d7bf353fd0aa3e12060ce64c8a7b4aaf4336145c</id>
<content type='text'>
Add driver support for the Texas Instruments BQ24190 battery charger.
Some of the information provided by the device is about the charger and
other information is about the battery so create two power_supply objects
(one for each) and provide the appropriate information for each one.

The device has many fields that go beyond what is reasonable to report or
modify using the existing 'POWER_SUPPLY_PROP_*' properties so the driver
exports the register fields via sysfs.  They are prefixed by 'f_' (for
'field') to make it easier to distinguish between a register field and a
"normal" sysfs file exported by the power_supply infrastructure.

Signed-off-by: Mark A. Greer &lt;mgreer@animalcreek.com&gt;
Signed-off-by: Anton Vorontsov &lt;anton@enomsg.org&gt;
</content>
</entry>
</feed>
