lkml.org 
[lkml]   [2015]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/2] extcon: usb-gpio: Update the ID pin state of USB when cable state is changed
Date
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@ti.com>
Cc: Robert Baldyga <r.baldyga@samsung.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.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);
}
--
2.2.0.GIT


\
 
 \ /
  Last update: 2015-05-27 14:41    [W:0.173 / U:2.660 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site