Skip to content

Commit

Permalink
max8925_power: Do not detect ac insert if handled by other code
Browse files Browse the repository at this point in the history
On brownstone rev 4 ac-insert detect is handled by vbus.

allow the platform code to configure the disabling of insert
by setting no_insert_detect.

Signed-off-by: Philip Rakity <prakity@marvell.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
  • Loading branch information
Philip Rakity authored and Anton Vorontsov committed Nov 25, 2011
1 parent 92de378 commit 5ba1fa0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/power/max8925_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct max8925_power_info {
unsigned topoff_threshold:2;
unsigned fast_charge:3;
unsigned no_temp_support:1;
unsigned no_insert_detect:1;

int (*set_charger) (int);
};
Expand Down Expand Up @@ -365,8 +366,10 @@ static __devinit int max8925_init_charger(struct max8925_chip *chip,
int ret;

REQUEST_IRQ(MAX8925_IRQ_VCHG_DC_OVP, "ac-ovp");
REQUEST_IRQ(MAX8925_IRQ_VCHG_DC_F, "ac-remove");
REQUEST_IRQ(MAX8925_IRQ_VCHG_DC_R, "ac-insert");
if (!info->no_insert_detect) {
REQUEST_IRQ(MAX8925_IRQ_VCHG_DC_F, "ac-remove");
REQUEST_IRQ(MAX8925_IRQ_VCHG_DC_R, "ac-insert");
}
REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_OVP, "usb-ovp");
REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_F, "usb-remove");
REQUEST_IRQ(MAX8925_IRQ_VCHG_USB_R, "usb-insert");
Expand Down Expand Up @@ -481,6 +484,7 @@ static __devinit int max8925_power_probe(struct platform_device *pdev)
info->fast_charge = pdata->fast_charge;
info->set_charger = pdata->set_charger;
info->no_temp_support = pdata->no_temp_support;
info->no_insert_detect = pdata->no_insert_detect;

max8925_init_charger(chip, info);
return 0;
Expand Down
1 change: 1 addition & 0 deletions include/linux/mfd/max8925.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ struct max8925_power_pdata {
unsigned topoff_threshold:2;
unsigned fast_charge:3; /* charge current */
unsigned no_temp_support:1; /* set if no temperature detect */
unsigned no_insert_detect:1; /* set if no ac insert detect */
};

/*
Expand Down

0 comments on commit 5ba1fa0

Please sign in to comment.