<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/power/power_supply_core.c, branch v3.7.6</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Thermal: Remove tc1/tc2 in generic thermal layer.</title>
<updated>2012-09-24T06:44:36+00:00</updated>
<author>
<name>Zhang Rui</name>
<email>rui.zhang@intel.com</email>
</author>
<published>2012-06-27T01:51:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1b7ddb840c3908464b19d4aa4f6dc4c463302442'/>
<id>1b7ddb840c3908464b19d4aa4f6dc4c463302442</id>
<content type='text'>
Remove tc1/tc2 in generic thermal layer.
.get_trend() callback starts to take effect from this patch.

Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Reviewed-by: Valentin, Eduardo &lt;eduardo.valentin@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove tc1/tc2 in generic thermal layer.
.get_trend() callback starts to take effect from this patch.

Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Reviewed-by: Valentin, Eduardo &lt;eduardo.valentin@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge with upstream to accommodate with thermal changes</title>
<updated>2012-07-31T12:16:47+00:00</updated>
<author>
<name>Anton Vorontsov</name>
<email>anton.vorontsov@linaro.org</email>
</author>
<published>2012-07-31T11:59:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e6db06a53b1dcf4e9da4aba143e2eb4d63418abb'/>
<id>e6db06a53b1dcf4e9da4aba143e2eb4d63418abb</id>
<content type='text'>
This merge is performed to take commit c56f5c0342dfee11a1 ("Thermal: Make
Thermal trip points writeable") out of Linus' tree and then fixup power
supply class. This is needed since thermal stuff added a new argument:

  CC      drivers/power/power_supply_core.o
drivers/power/power_supply_core.c: In function ‘psy_register_thermal’:
drivers/power/power_supply_core.c:204:6: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default]
include/linux/thermal.h:154:29: note: expected ‘int’ but argument is of type ‘struct power_supply *’
drivers/power/power_supply_core.c:204:6: error: too few arguments to function ‘thermal_zone_device_register’
include/linux/thermal.h:154:29: note: declared here
make[1]: *** [drivers/power/power_supply_core.o] Error 1
make: *** [drivers/power/] Error 2

Signed-off-by: Anton Vorontsov &lt;anton.vorontsov@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This merge is performed to take commit c56f5c0342dfee11a1 ("Thermal: Make
Thermal trip points writeable") out of Linus' tree and then fixup power
supply class. This is needed since thermal stuff added a new argument:

  CC      drivers/power/power_supply_core.o
drivers/power/power_supply_core.c: In function ‘psy_register_thermal’:
drivers/power/power_supply_core.c:204:6: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default]
include/linux/thermal.h:154:29: note: expected ‘int’ but argument is of type ‘struct power_supply *’
drivers/power/power_supply_core.c:204:6: error: too few arguments to function ‘thermal_zone_device_register’
include/linux/thermal.h:154:29: note: declared here
make[1]: *** [drivers/power/power_supply_core.o] Error 1
make: *** [drivers/power/] Error 2

Signed-off-by: Anton Vorontsov &lt;anton.vorontsov@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Register battery as a thermal zone</title>
<updated>2012-06-18T04:25:39+00:00</updated>
<author>
<name>Jenny TC</name>
<email>jenny.tc@intel.com</email>
</author>
<published>2012-05-09T15:06:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3be330bf8860dc6079da5acc81295787a04cf4c9'/>
<id>3be330bf8860dc6079da5acc81295787a04cf4c9</id>
<content type='text'>
Battery and charger contribute to Thermals in most of the embedded
devices. So, it makes sense to identify them as Thermal zones in a
particular platform.

This patch registers a thermal zone if the power supply is reporting
a temperature property. The thermal zone will be used by platform's
thermal management solution.

Signed-off-by: Jenny TC &lt;jenny.tc@intel.com&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Battery and charger contribute to Thermals in most of the embedded
devices. So, it makes sense to identify them as Thermal zones in a
particular platform.

This patch registers a thermal zone if the power supply is reporting
a temperature property. The thermal zone will be used by platform's
thermal management solution.

Signed-off-by: Jenny TC &lt;jenny.tc@intel.com&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Drop usage of nowarn variant of sysfs_create_link()</title>
<updated>2012-01-07T11:24:51+00:00</updated>
<author>
<name>Anton Vorontsov</name>
<email>cbouatmailru@gmail.com</email>
</author>
<published>2012-01-05T15:17:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=93278d151e7bd35ccd0e083d7f2d8123cbaf36f8'/>
<id>93278d151e7bd35ccd0e083d7f2d8123cbaf36f8</id>
<content type='text'>
The function is not exported to modules, plus we do want to catch anyone
who tries to create complex hierarchy (in that case we'd need to change
'powers' symlink to a directory, probably under a different name to not
break ABI).

This patch fixes the following build error:

 ERROR: "sysfs_create_link_nowarn" [drivers/power/power_supply.ko] undefined!

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function is not exported to modules, plus we do want to catch anyone
who tries to create complex hierarchy (in that case we'd need to change
'powers' symlink to a directory, probably under a different name to not
break ABI).

This patch fixes the following build error:

 ERROR: "sysfs_create_link_nowarn" [drivers/power/power_supply.ko] undefined!

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Assume mains power by default</title>
<updated>2012-01-06T01:50:32+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2011-12-10T21:53:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2530daa187be3adef2d7cb41bd51f1384e478f2b'/>
<id>2530daa187be3adef2d7cb41bd51f1384e478f2b</id>
<content type='text'>
If no power class device is found in power_supply_is_system_supplied(),
the function currently returns 0, which basically means that the system
is supposed to be running on battery. In practice, mobile devices tend
to always implement at least one power class device and more often two
(battery and AC adapter). Systems with no registered power class
devices are more likely to be desktop systems, where the system is
always powered by mains.

So, change the default return value of
power_supply_is_system_supplied() from 0 (running on battery) to 1
(running on mains.)

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: Matthew Garrett &lt;mjg59@srcf.ucam.org&gt;
Cc: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If no power class device is found in power_supply_is_system_supplied(),
the function currently returns 0, which basically means that the system
is supposed to be running on battery. In practice, mobile devices tend
to always implement at least one power class device and more often two
(battery and AC adapter). Systems with no registered power class
devices are more likely to be desktop systems, where the system is
always powered by mains.

So, change the default return value of
power_supply_is_system_supplied() from 0 (running on battery) to 1
(running on mains.)

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: Matthew Garrett &lt;mjg59@srcf.ucam.org&gt;
Cc: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: allow a power supply to explicitly point to powered device</title>
<updated>2011-12-09T17:52:07+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-07T17:15:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8351665195cec6d2b73cce8b66f02d6dde246a8e'/>
<id>8351665195cec6d2b73cce8b66f02d6dde246a8e</id>
<content type='text'>
If a power supply has a scope of "Device", then allow the power supply
to indicate what device it actually powers. This is represented in the
power supply's sysfs directory as a symlink named "powers", which points to
the sysfs directory of the powered device.

If the device has children, then the sub-devices are also powered by
the same power supply.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
Cc: Richard Hughes &lt;richard@hughsie.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a power supply has a scope of "Device", then allow the power supply
to indicate what device it actually powers. This is represented in the
power supply's sysfs directory as a symlink named "powers", which points to
the sysfs directory of the powered device.

If the device has children, then the sub-devices are also powered by
the same power supply.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
Cc: Richard Hughes &lt;richard@hughsie.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Initialize changed_work before calling device_add</title>
<updated>2011-02-22T10:01:42+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2011-02-21T14:34:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=97774672573ac4355bd12cf84b202555c1131b69'/>
<id>97774672573ac4355bd12cf84b202555c1131b69</id>
<content type='text'>
Calling device_add causes an inital uevent for that device to be generated.
The power_supply uevent function calls the drivers get_property function,
which might causes the driver to update its state, which again might
causes the driver to call power_supply_changed(). Since the power_supplys
changed_work has not been initialized at this point the behavior is
undefined and can result in an OOPS.

This patch fixes the issue by initializing the power_supplys changed_work
prior to adding the power_supplys device to the device tree.

Reported-by: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Tested-by: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Calling device_add causes an inital uevent for that device to be generated.
The power_supply uevent function calls the drivers get_property function,
which might causes the driver to update its state, which again might
causes the driver to call power_supply_changed(). Since the power_supplys
changed_work has not been initialized at this point the behavior is
undefined and can result in an OOPS.

This patch fixes the issue by initializing the power_supplys changed_work
prior to adding the power_supplys device to the device tree.

Reported-by: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Tested-by: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Don't use flush_scheduled_work()</title>
<updated>2010-12-21T23:39:56+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-12-11T16:51:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bc51e7ff521f28a7f14dc2f25307ad9101d1305a'/>
<id>bc51e7ff521f28a7f14dc2f25307ad9101d1305a</id>
<content type='text'>
flush_scheduled_work() is deprecated and scheduled to be removed.

In battery drivers, the work can be canceled on probe failure and
removal and should be flushed on suspend.  Replace
flush_scheduled_work() usages with direct cancels and flushes.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
flush_scheduled_work() is deprecated and scheduled to be removed.

In battery drivers, the work can be canceled on probe failure and
removal and should be flushed on suspend.  Replace
flush_scheduled_work() usages with direct cancels and flushes.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Fix use after free and memory leak</title>
<updated>2010-12-21T23:39:55+00:00</updated>
<author>
<name>Vasiliy Kulikov</name>
<email>segoon@openwall.com</email>
</author>
<published>2010-11-19T18:41:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3a2dbd611b38cf9a026c0099a85701ad183d1949'/>
<id>3a2dbd611b38cf9a026c0099a85701ad183d1949</id>
<content type='text'>
device_unregister() might free its argument.  This leads to freed
memory use in kfree().  Also use put_device() instead of kfree()
as dev may be already used in another layer after call to device_add().

Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
device_unregister() might free its argument.  This leads to freed
memory use in kfree().  Also use put_device() instead of kfree()
as dev may be already used in another layer after call to device_add().

Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>power_supply: Use attribute groups</title>
<updated>2010-05-19T08:14:28+00:00</updated>
<author>
<name>Anton Vorontsov</name>
<email>cbouatmailru@gmail.com</email>
</author>
<published>2010-05-18T19:49:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5f487cd34f4337f9bc27ca19da72a39d1b0a0ab4'/>
<id>5f487cd34f4337f9bc27ca19da72a39d1b0a0ab4</id>
<content type='text'>
This fixes a race between power supply device and initial
attributes creation, plus makes it possible to implement
writable properties.

[Daniel Mack - removed superflous return statement
 and dropped .mode attribute from POWER_SUPPLY_ATTR]

Suggested-by: Greg KH &lt;gregkh@suse.de&gt;
Suggested-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
Tested-by: Daniel Mack &lt;daniel@caiaq.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a race between power supply device and initial
attributes creation, plus makes it possible to implement
writable properties.

[Daniel Mack - removed superflous return statement
 and dropped .mode attribute from POWER_SUPPLY_ATTR]

Suggested-by: Greg KH &lt;gregkh@suse.de&gt;
Suggested-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Anton Vorontsov &lt;cbouatmailru@gmail.com&gt;
Tested-by: Daniel Mack &lt;daniel@caiaq.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
