lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1307526281-12125-3-git-send-email-krohei@gmail.com>
Date:	Wed,  8 Jun 2011 12:44:40 +0300
From:	Heikki Krogerus <krohei@...il.com>
To:	Greg KH <gregkh@...e.de>, Anton Vorontsov <cbouatmailru@...il.com>
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] isp1704_charger: Handle suspended and resumed events

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

Signed-off-by: Heikki Krogerus <krohei@...il.com>
---
 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ