summaryrefslogtreecommitdiffstats
path: root/include/linux/power_supply.h
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-10-07 17:47:36 +0200
committerSebastian Reichel <sre@kernel.org>2014-10-28 03:30:19 +0100
commita69d82b9bdf1e53e94423048e8bda8c5f5a3dd4e (patch)
tree0ae915d15ee164e2682f03b636504f05722babc4 /include/linux/power_supply.h
parent21e863b233553998737e1b506c823a00bf012e00 (diff)
downloadblackbird-obmc-linux-a69d82b9bdf1e53e94423048e8bda8c5f5a3dd4e.tar.gz
blackbird-obmc-linux-a69d82b9bdf1e53e94423048e8bda8c5f5a3dd4e.zip
power_supply: Add no_thermal property to prevent recursive get_temp calls
Add a 'no_thermal' property to the power supply class. If true then thermal zone won't be created for this power supply in power_supply_register(). Power supply drivers may want to set it if they support POWER_SUPPLY_PROP_TEMP and they are forwarding this get property call to other thermal zone. If they won't set it lockdep may report false positive deadlock for thermal zone's mutex because of nested calls to thermal_zone_get_temp(). First is the call to thermal_zone_get_temp() of the driver's thermal zone. Thermal core gets POWER_SUPPLY_PROP_TEMP property from this driver. The driver then calls other thermal zone thermal_zone_get_temp() and returns result. Example of such driver is charger manager. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'include/linux/power_supply.h')
-rw-r--r--include/linux/power_supply.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 3ed049673022..096dbced02ac 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -200,6 +200,12 @@ struct power_supply {
void (*external_power_changed)(struct power_supply *psy);
void (*set_charged)(struct power_supply *psy);
+ /*
+ * Set if thermal zone should not be created for this power supply.
+ * For example for virtual supplies forwarding calls to actual
+ * sensors or other supplies.
+ */
+ bool no_thermal;
/* For APM emulation, think legacy userspace. */
int use_for_apm;
OpenPOWER on IntegriCloud