diff options
author | Rupesh Kumar <rupesh.kumar@stericsson.com> | 2012-07-16 03:15:19 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-03-06 23:35:42 -0500 |
commit | da9e83d496039458fe9863540cf52b3f9b450675 (patch) | |
tree | 7909a08e41ba53b641c41602a46e02d5a351c323 /drivers/power/pm2301_charger.c | |
parent | f7470b5d246294761892f4bafc0eeedaa4369d92 (diff) |
pm2301-charger: Die temp thermal protection
This patch adds support for die temperature thermal protection
in pm2301 driver.
Signed-off-by: Rupesh Kumar <rupesh.kumar@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Hakan BERG <hakan.berg@stericsson.com>
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Diffstat (limited to 'drivers/power/pm2301_charger.c')
-rw-r--r-- | drivers/power/pm2301_charger.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/power/pm2301_charger.c b/drivers/power/pm2301_charger.c index a95edae925f8..ae647c41c535 100644 --- a/drivers/power/pm2301_charger.c +++ b/drivers/power/pm2301_charger.c | |||
@@ -876,7 +876,27 @@ static void pm2xxx_charger_check_hw_failure_work(struct work_struct *work) | |||
876 | static void pm2xxx_charger_check_main_thermal_prot_work( | 876 | static void pm2xxx_charger_check_main_thermal_prot_work( |
877 | struct work_struct *work) | 877 | struct work_struct *work) |
878 | { | 878 | { |
879 | }; | 879 | int ret; |
880 | u8 val; | ||
881 | |||
882 | struct pm2xxx_charger *pm2 = container_of(work, struct pm2xxx_charger, | ||
883 | check_main_thermal_prot_work); | ||
884 | |||
885 | /* Check if die temp warning is still active */ | ||
886 | ret = pm2xxx_reg_read(pm2, PM2XXX_SRCE_REG_INT5, &val); | ||
887 | if (ret < 0) { | ||
888 | dev_err(pm2->dev, "%s pm2xxx read failed\n", __func__); | ||
889 | return; | ||
890 | } | ||
891 | if (val & (PM2XXX_INT5_S_ITTHERMALWARNINGRISE | ||
892 | | PM2XXX_INT5_S_ITTHERMALSHUTDOWNRISE)) | ||
893 | pm2->flags.main_thermal_prot = true; | ||
894 | else if (val & (PM2XXX_INT5_S_ITTHERMALWARNINGFALL | ||
895 | | PM2XXX_INT5_S_ITTHERMALSHUTDOWNFALL)) | ||
896 | pm2->flags.main_thermal_prot = false; | ||
897 | |||
898 | power_supply_changed(&pm2->ac_chg.psy); | ||
899 | } | ||
880 | 900 | ||
881 | static struct pm2xxx_interrupts pm2xxx_int = { | 901 | static struct pm2xxx_interrupts pm2xxx_int = { |
882 | .handler[0] = pm2_int_reg0, | 902 | .handler[0] = pm2_int_reg0, |