Commit 92de378b authored by Philip Rakity's avatar Philip Rakity Committed by Anton Vorontsov

max8925_power: No temperature interrupts if temperature not connected

Brownstone does not have temperature reading circuit hooked up.
This leads to spurious interrupts.

Allow the platform layer to indicate no temperature circuit
and do not activate interrupts if no temperature control is set
Signed-off-by: default avatarPhilip Rakity <prakity@marvell.com>
Signed-off-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
parent 9c9cf9e2
...@@ -78,6 +78,7 @@ struct max8925_power_info { ...@@ -78,6 +78,7 @@ struct max8925_power_info {
unsigned batt_detect:1; /* detecing MB by ID pin */ unsigned batt_detect:1; /* detecing MB by ID pin */
unsigned topoff_threshold:2; unsigned topoff_threshold:2;
unsigned fast_charge:3; unsigned fast_charge:3;
unsigned no_temp_support:1;
int (*set_charger) (int); int (*set_charger) (int);
}; };
...@@ -116,7 +117,7 @@ static irqreturn_t max8925_charger_handler(int irq, void *data) ...@@ -116,7 +117,7 @@ static irqreturn_t max8925_charger_handler(int irq, void *data)
case MAX8925_IRQ_VCHG_DC_F: case MAX8925_IRQ_VCHG_DC_F:
info->ac_online = 0; info->ac_online = 0;
__set_charger(info, 0); __set_charger(info, 0);
dev_dbg(chip->dev, "Adapter is removal\n"); dev_dbg(chip->dev, "Adapter removed\n");
break; break;
case MAX8925_IRQ_VCHG_USB_R: case MAX8925_IRQ_VCHG_USB_R:
info->usb_online = 1; info->usb_online = 1;
...@@ -126,7 +127,7 @@ static irqreturn_t max8925_charger_handler(int irq, void *data) ...@@ -126,7 +127,7 @@ static irqreturn_t max8925_charger_handler(int irq, void *data)
case MAX8925_IRQ_VCHG_USB_F: case MAX8925_IRQ_VCHG_USB_F:
info->usb_online = 0; info->usb_online = 0;
__set_charger(info, 0); __set_charger(info, 0);
dev_dbg(chip->dev, "USB is removal\n"); dev_dbg(chip->dev, "USB removed\n");
break; break;
case MAX8925_IRQ_VCHG_THM_OK_F: case MAX8925_IRQ_VCHG_THM_OK_F:
/* Battery is not ready yet */ /* Battery is not ready yet */
...@@ -369,8 +370,10 @@ static __devinit int max8925_init_charger(struct max8925_chip *chip, ...@@ -369,8 +370,10 @@ static __devinit int max8925_init_charger(struct max8925_chip *chip,
REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_OVP, "usb-ovp"); REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_OVP, "usb-ovp");
REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_F, "usb-remove"); REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_F, "usb-remove");
REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_R, "usb-insert"); REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_R, "usb-insert");
if (!info->no_temp_support) {
REQUEST_IRQ(MAX8925_IRQ_VCHG_THM_OK_R, "batt-temp-in-range"); REQUEST_IRQ(MAX8925_IRQ_VCHG_THM_OK_R, "batt-temp-in-range");
REQUEST_IRQ(MAX8925_IRQ_VCHG_THM_OK_F, "batt-temp-out-range"); REQUEST_IRQ(MAX8925_IRQ_VCHG_THM_OK_F, "batt-temp-out-range");
}
REQUEST_IRQ(MAX8925_IRQ_VCHG_SYSLOW_F, "vsys-high"); REQUEST_IRQ(MAX8925_IRQ_VCHG_SYSLOW_F, "vsys-high");
REQUEST_IRQ(MAX8925_IRQ_VCHG_SYSLOW_R, "vsys-low"); REQUEST_IRQ(MAX8925_IRQ_VCHG_SYSLOW_R, "vsys-low");
REQUEST_IRQ(MAX8925_IRQ_VCHG_RST, "charger-reset"); REQUEST_IRQ(MAX8925_IRQ_VCHG_RST, "charger-reset");
...@@ -477,6 +480,7 @@ static __devinit int max8925_power_probe(struct platform_device *pdev) ...@@ -477,6 +480,7 @@ static __devinit int max8925_power_probe(struct platform_device *pdev)
info->topoff_threshold = pdata->topoff_threshold; info->topoff_threshold = pdata->topoff_threshold;
info->fast_charge = pdata->fast_charge; info->fast_charge = pdata->fast_charge;
info->set_charger = pdata->set_charger; info->set_charger = pdata->set_charger;
info->no_temp_support = pdata->no_temp_support;
max8925_init_charger(chip, info); max8925_init_charger(chip, info);
return 0; return 0;
......
...@@ -223,6 +223,7 @@ struct max8925_power_pdata { ...@@ -223,6 +223,7 @@ struct max8925_power_pdata {
unsigned batt_detect:1; unsigned batt_detect:1;
unsigned topoff_threshold:2; unsigned topoff_threshold:2;
unsigned fast_charge:3; /* charge current */ unsigned fast_charge:3; /* charge current */
unsigned no_temp_support:1; /* set if no temperature detect */
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment