Skip to content

Commit 92de378

Browse files
Philip Rakityenomsg
authored andcommitted
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: Philip Rakity <prakity@marvell.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
1 parent 9c9cf9e commit 92de378

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎drivers/power/max8925_power.c‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ struct max8925_power_info {
7878
unsigned batt_detect:1; /* detecing MB by ID pin */
7979
unsigned topoff_threshold:2;
8080
unsigned fast_charge:3;
81+
unsigned no_temp_support:1;
8182

8283
int (*set_charger) (int);
8384
};
@@ -116,7 +117,7 @@ static irqreturn_t max8925_charger_handler(int irq, void *data)
116117
case MAX8925_IRQ_VCHG_DC_F:
117118
info->ac_online = 0;
118119
__set_charger(info, 0);
119-
dev_dbg(chip->dev, "Adapter is removal\n");
120+
dev_dbg(chip->dev, "Adapter removed\n");
120121
break;
121122
case MAX8925_IRQ_VCHG_USB_R:
122123
info->usb_online = 1;
@@ -126,7 +127,7 @@ static irqreturn_t max8925_charger_handler(int irq, void *data)
126127
case MAX8925_IRQ_VCHG_USB_F:
127128
info->usb_online = 0;
128129
__set_charger(info, 0);
129-
dev_dbg(chip->dev, "USB is removal\n");
130+
dev_dbg(chip->dev, "USB removed\n");
130131
break;
131132
case MAX8925_IRQ_VCHG_THM_OK_F:
132133
/* Battery is not ready yet */
@@ -369,8 +370,10 @@ static __devinit int max8925_init_charger(struct max8925_chip *chip,
369370
REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_OVP, "usb-ovp");
370371
REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_F, "usb-remove");
371372
REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_R, "usb-insert");
372-
REQUEST_IRQ(MAX8925_IRQ_VCHG_THM_OK_R, "batt-temp-in-range");
373-
REQUEST_IRQ(MAX8925_IRQ_VCHG_THM_OK_F, "batt-temp-out-range");
373+
if (!info->no_temp_support) {
374+
REQUEST_IRQ(MAX8925_IRQ_VCHG_THM_OK_R, "batt-temp-in-range");
375+
REQUEST_IRQ(MAX8925_IRQ_VCHG_THM_OK_F, "batt-temp-out-range");
376+
}
374377
REQUEST_IRQ(MAX8925_IRQ_VCHG_SYSLOW_F, "vsys-high");
375378
REQUEST_IRQ(MAX8925_IRQ_VCHG_SYSLOW_R, "vsys-low");
376379
REQUEST_IRQ(MAX8925_IRQ_VCHG_RST, "charger-reset");
@@ -477,6 +480,7 @@ static __devinit int max8925_power_probe(struct platform_device *pdev)
477480
info->topoff_threshold = pdata->topoff_threshold;
478481
info->fast_charge = pdata->fast_charge;
479482
info->set_charger = pdata->set_charger;
483+
info->no_temp_support = pdata->no_temp_support;
480484

481485
max8925_init_charger(chip, info);
482486
return 0;

‎include/linux/mfd/max8925.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ struct max8925_power_pdata {
223223
unsigned batt_detect:1;
224224
unsigned topoff_threshold:2;
225225
unsigned fast_charge:3; /* charge current */
226+
unsigned no_temp_support:1; /* set if no temperature detect */
226227
};
227228

228229
/*

0 commit comments

Comments
 (0)