arm: mach-sc: usb_switch: report attached and detached usb state only 24/229224/1 accepted/tizen/unified/20200402.155627 submit/tizen/20200331.090714
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 30 Mar 2020 10:59:18 +0000 (19:59 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 30 Mar 2020 10:59:20 +0000 (19:59 +0900)
The sm5504 muic recognizes high current usb cable as CDP, Charging
Downstream Port as value 2 and usb_switch reported the value to
user. But Tizen deviced never expects usb state except attached(1)
and detached(0) and this causes usb connection failure. Fix to
report attached and detached usb state only from usb_switch.

Change-Id: I619d1af72e97120a16f0e88e5b1147b968511c41
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
arch/arm/mach-sc/sec-switch.c

index 39d79ab74a5d79e890029c20462d87a9101117ea..cdb736826afdc76c8d41e8a8bbb8ae5a081018ba 100755 (executable)
@@ -130,12 +130,12 @@ extern void usb_notify_cb(int plug_in);
 
 static void muic_usb_cb(u8 attached)
 {
-       pr_info("%s: usb_mode:%d\n", __func__, attached);
+       pr_info("%s: usb_mode:%d\n", __func__, !!attached);
 
-       usb_notify_cb(attached);
+       usb_notify_cb(!!attached);
 
 #ifdef CONFIG_SWITCH
-       switch_set_state(&switch_usb, attached);
+       switch_set_state(&switch_usb, !!attached);
 #endif
        return;
 }