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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1432291790-4933-3-git-send-email-cw00.choi@samsung.com>
Date:	Fri, 22 May 2015 19:49:50 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	linux-kernel@...r.kernel.org
Cc:	rogerq@...com, r.baldyga@...sung.com, peter.chen@...escale.com,
	kishon@...com, balbi@...com, iivanov@...sol.com,
	cw00.choi@...sung.com, myungjoo.ham@...sung.com
Subject: [PATCH 2/2] extcon: usb-gpio: Update the ID pin state of USB when
 cable state is changed

This patch updates the ID pin state of USB when cable state is changed
by using the extcon_set_cable_line_state() function. The extcon consumer driver
can receive the changed ID pin state through registered notifier chain of
extcon consumer driver.

Cc: Roger Quadros <rogerq@...com>
Cc: Robert Baldyga <r.baldyga@...sung.com>
Cc: MyungJoo Ham <myungjoo.ham@...sung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@...sung.com>
---
 drivers/extcon/extcon-usb-gpio.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
index 14da94c..9ff3171 100644
--- a/drivers/extcon/extcon-usb-gpio.c
+++ b/drivers/extcon/extcon-usb-gpio.c
@@ -62,12 +62,18 @@ static void usb_extcon_detect_cable(struct work_struct *work)
 		 */
 		extcon_set_cable_state_(info->edev, EXTCON_USB_HOST, false);
 		extcon_set_cable_state_(info->edev, EXTCON_USB, true);
+
+		extcon_set_cable_line_state(info->edev, EXTCON_USB,
+						EXTCON_USB_ID_HIGH);
 	} else {
 		/*
 		 * ID = 0 means USB HOST cable attached.
 		 * As we don't have event for USB peripheral cable detached,
 		 * we simulate USB peripheral detach here.
 		 */
+		extcon_set_cable_line_state(info->edev, EXTCON_USB,
+						EXTCON_USB_ID_LOW);
+
 		extcon_set_cable_state_(info->edev, EXTCON_USB, false);
 		extcon_set_cable_state_(info->edev, EXTCON_USB_HOST, true);
 	}
-- 
1.8.5.5

--
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