summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Troast <ntroast@codeaurora.org>2016-12-16 13:24:43 -0800
committerNicholas Troast <ntroast@codeaurora.org>2017-02-07 13:39:38 -0800
commite2cc95080f0969297f0c77bf3bbcfca211ff8e9d (patch)
tree5e99a08a8887b1f8fa45200babffede9d1ee48c9
parent6611bb8976d1857c36c7bca5510cfe6623a6bfc3 (diff)
smb138x-charger: handle temperature change IRQ
The temperature change IRQ is used to notify the CTM driver that the connector temperature has changed. Enable it. Change-Id: Ibda88fcac6044c0f9a1db96be70b7e7f99e6fb73 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
-rw-r--r--drivers/power/supply/qcom/smb138x-charger.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/power/supply/qcom/smb138x-charger.c b/drivers/power/supply/qcom/smb138x-charger.c
index 2d13745a02b9..dd14d164c49a 100644
--- a/drivers/power/supply/qcom/smb138x-charger.c
+++ b/drivers/power/supply/qcom/smb138x-charger.c
@@ -902,6 +902,23 @@ static int smb138x_setup_wa_flags(struct smb138x *chip)
* DETERMINE INITIAL STATUS *
****************************/
+static irqreturn_t smb138x_handle_temperature_change(int irq, void *data)
+{
+ struct smb_irq_data *irq_data = data;
+ struct smb138x *chip = irq_data->parent_data;
+
+ power_supply_changed(chip->parallel_psy);
+ return IRQ_HANDLED;
+}
+
+static int smb138x_determine_initial_slave_status(struct smb138x *chip)
+{
+ struct smb_irq_data irq_data = {chip, "determine-initial-status"};
+
+ smb138x_handle_temperature_change(0, &irq_data);
+ return 0;
+}
+
static int smb138x_determine_initial_status(struct smb138x *chip)
{
struct smb_irq_data irq_data = {chip, "determine-initial-status"};
@@ -909,7 +926,6 @@ static int smb138x_determine_initial_status(struct smb138x *chip)
smblib_handle_usb_plugin(0, &irq_data);
smblib_handle_usb_typec_change(0, &irq_data);
smblib_handle_usb_source_change(0, &irq_data);
-
return 0;
}
@@ -1078,7 +1094,7 @@ static const struct smb138x_irq_info smb138x_irqs[] = {
},
{
.name = "temperature-change",
- .handler = smblib_handle_debug,
+ .handler = smb138x_handle_temperature_change,
},
{
.name = "switcher-power-ok",
@@ -1275,6 +1291,12 @@ static int smb138x_slave_probe(struct smb138x *chip)
goto cleanup;
}
+ rc = smb138x_determine_initial_slave_status(chip);
+ if (rc < 0) {
+ pr_err("Couldn't determine initial status rc=%d\n", rc);
+ goto cleanup;
+ }
+
rc = smb138x_request_interrupts(chip);
if (rc < 0) {
pr_err("Couldn't request interrupts rc=%d\n", rc);