* [PATCH] power: max8925_power. Do not detect ac insert if handled by other code
@ 2011-08-24 22:27 Philip Rakity
2011-08-26 23:29 ` Philip Rakity
0 siblings, 1 reply; 2+ messages in thread
From: Philip Rakity @ 2011-08-24 22:27 UTC (permalink / raw)
To: linux-kernel; +Cc: Haojian Zhuang
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>
---
drivers/power/max8925_power.c | 8 ++++++--
include/linux/mfd/max8925.h | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/power/max8925_power.c b/drivers/power/max8925_power.c
index dba07f3..fd32c08 100644
--- a/drivers/power/max8925_power.c
+++ b/drivers/power/max8925_power.c
@@ -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);
};
@@ -366,8 +367,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");
@@ -482,6 +485,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;
diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h
index 69ec8f0..e742e04 100644
--- a/include/linux/mfd/max8925.h
+++ b/include/linux/mfd/max8925.h
@@ -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 */
};
/*
--
1.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] power: max8925_power. Do not detect ac insert if handled by other code
2011-08-24 22:27 [PATCH] power: max8925_power. Do not detect ac insert if handled by other code Philip Rakity
@ 2011-08-26 23:29 ` Philip Rakity
0 siblings, 0 replies; 2+ messages in thread
From: Philip Rakity @ 2011-08-26 23:29 UTC (permalink / raw)
To: cbou, David Woodhouse; +Cc: linux-kernel, Haojian Zhuang
loop maintainer
On Aug 24, 2011, at 3:27 PM, Philip Rakity wrote:
> 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>
> ---
> drivers/power/max8925_power.c | 8 ++++++--
> include/linux/mfd/max8925.h | 1 +
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/max8925_power.c b/drivers/power/max8925_power.c
> index dba07f3..fd32c08 100644
> --- a/drivers/power/max8925_power.c
> +++ b/drivers/power/max8925_power.c
> @@ -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);
> };
> @@ -366,8 +367,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");
> @@ -482,6 +485,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;
> diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h
> index 69ec8f0..e742e04 100644
> --- a/include/linux/mfd/max8925.h
> +++ b/include/linux/mfd/max8925.h
> @@ -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 */
> };
>
> /*
> --
> 1.7.6
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-26 23:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-24 22:27 [PATCH] power: max8925_power. Do not detect ac insert if handled by other code Philip Rakity
2011-08-26 23:29 ` Philip Rakity
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.