[PATCH 2/3] isp1704_charger: Handle suspended and resumed events

From: Heikki Krogerus
Date: Wed Jun 08 2011 - 05:44:48 EST


To prevent charging when the bus is suspended, handling
suspended and resumed events.

Signed-off-by: Heikki Krogerus <krohei@xxxxxxxxx>
---
drivers/power/isp1704_charger.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c
index f6d72b4..c0d4e8b 100644
--- a/drivers/power/isp1704_charger.c
+++ b/drivers/power/isp1704_charger.c
@@ -294,6 +294,19 @@ static void isp1704_charger_work(struct work_struct *data)
else
isp->current_max = power;
break;
+ case USB_EVENT_SUSPENDED:
+ /* Ignore SUSPEND with CDP */
+ if (isp->present)
+ goto out;
+ else
+ isp->current_max = 2;
+ break;
+ case USB_EVENT_RESUMED:
+ if (isp->present)
+ goto out;
+ else
+ isp->current_max = power;
+ break;
default:
goto out;
}
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/