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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux