FROMLIST: extcon: Add EXTCON_DISP_DP and the property for USB Type-C
authorChris Zhong <zyw@rock-chips.com>
Thu, 21 Jul 2016 16:13:02 +0000 (01:13 +0900)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 5 Aug 2016 02:10:21 +0000 (10:10 +0800)
Add EXTCON_DISP_DP for the Display external connector. For Type-C
connector the DisplayPort can work as an Alternate Mode(VESA DisplayPort
Alt Mode on USB Type-C Standard). The Type-C support both normal
and flipped orientation, so add a property to extcon.

Change-Id: I490f82cdf278aa84db9c21ba8d0b7b0e9dfa4cff
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chris Zhong <zyw@rock-chips.com>
Tested-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
(cherry picked from commit e49de5133573
 git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-test)
Signed-off-by: Guenter Roeck <groeck@chromium.org>
drivers/extcon/extcon.c
include/linux/extcon.h

index ec35bfda9701dc5b7f46cb3810c17425e84f8f8e..519ac5c8bed14e3e77af3c0320fe1c9ca522f182 100644 (file)
@@ -157,6 +157,11 @@ struct __extcon_info {
                .id = EXTCON_DISP_VGA,
                .name = "VGA",
        },
+       [EXTCON_DISP_DP] = {
+               .type = EXTCON_TYPE_DISP | EXTCON_TYPE_USB,
+               .id = EXTCON_DISP_DP,
+               .name = "DP",
+       },
 
        /* Miscellaneous external connector */
        [EXTCON_DOCK] = {
index 664db79940b45d24b40a72b8d94b893851201f82..950f8491fa6ad50b8cad5783e00f2ade76a14832 100644 (file)
@@ -69,6 +69,7 @@
 #define EXTCON_DISP_MHL                41      /* Mobile High-Definition Link */
 #define EXTCON_DISP_DVI                42      /* Digital Visual Interface */
 #define EXTCON_DISP_VGA                43      /* Video Graphics Array */
+#define EXTCON_DISP_DP         44      /* Display Port */
 
 /* Miscellaneous external connector */
 #define EXTCON_DOCK            60
  * @type:      integer (intval)
  * @value:     0 (low) or 1 (high)
  * @default:   0 (low)
+ * - EXTCON_PROP_USB_TYPEC_POLARITY
+ * @type:      integer (intval)
+ * @value:     0 (normal) or 1 (flip)
+ * @default:   0 (normal)
  */
 #define EXTCON_PROP_USB_ID             0
 #define EXTCON_PROP_USB_VBUS           1
+#define EXTCON_PROP_USB_TYPEC_POLARITY 2
 
 #define EXTCON_PROP_USB_MIN            0
-#define EXTCON_PROP_USB_MAX            1
+#define EXTCON_PROP_USB_MAX            2
 #define EXTCON_PROP_USB_CNT    (EXTCON_PROP_USB_MAX - EXTCON_PROP_USB_MIN + 1)
 
 /* Properties of EXTCON_TYPE_CHG. */