From patchwork Thu Jun 23 12:51:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 9195059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A48896077D for ; Thu, 23 Jun 2016 12:51:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94A272844F for ; Thu, 23 Jun 2016 12:51:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 895C328455; Thu, 23 Jun 2016 12:51:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C6182844F for ; Thu, 23 Jun 2016 12:51:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bG46g-0000n5-5o; Thu, 23 Jun 2016 12:51:42 +0000 Received: from mail-pf0-f195.google.com ([209.85.192.195]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bG46b-0000ej-GV for linux-rockchip@lists.infradead.org; Thu, 23 Jun 2016 12:51:40 +0000 Received: by mail-pf0-f195.google.com with SMTP id 66so6780038pfy.1 for ; Thu, 23 Jun 2016 05:51:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mHjQargrYg9e06oegtwTdDfKWDgJOagHwmB9Gnscm0c=; b=SecOSRhw/5EdDSnocrV60Qi3k9IZk03Ou4JcpZt8uQ+1JeDpgnuKa5v+LPQWLk1RT6 e2CV+w6XKSA/N/ZsnwfYthgPxtL8gApp8XiZiFOZ4/Esf0wTtD1F5bIps23XD7YmrvIi NP1Hbcfd4kIyxeQrd2vOdnwrHwfccy77fDgwGCAk7Zgw3vLqyCdNlCWU3sAN6q0Dw6d5 ZiZc0VKrgdPci3sTqeWryuLDS9o/mrCoYJyjHYk3hhDzOhEL3pCFrPqjbBZX0oIUpyAs XF9jxwQ9ozhqpNSm5n0D5M2QFKwew8OlYUNCxIi5x6KgQ+rSEHgFWOYVEJ8JanRkBPj5 gdzw== X-Gm-Message-State: ALyK8tLJqrHNBT+CdGN0fCpdfW8pPZUIyW63EvOGA0uafz+HFDZnOnFkkGRlS5HfQcdwHA== X-Received: by 10.98.20.216 with SMTP id 207mr42915367pfu.144.1466686279535; Thu, 23 Jun 2016 05:51:19 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id h77sm7271163pfj.86.2016.06.23.05.51.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Jun 2016 05:51:18 -0700 (PDT) From: Chris Zhong To: dianders@chromium.org, tfiga@chromium.org, heiko@sntech.de, yzq@rock-chips.com, groeck@chromium.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com Subject: [v3 PATCH 1/5] extcon: Add Type-C and DP support Date: Thu, 23 Jun 2016 20:51:00 +0800 Message-Id: <1466686264-6744-2-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1466686264-6744-1-git-send-email-zyw@rock-chips.com> References: <1466686264-6744-1-git-send-email-zyw@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160623_055137_765183_7C44DA71 X-CRM114-Status: UNSURE ( 9.47 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Zhong , linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add EXTCON_DISP_DP and EXTCON_DISP_DP_ALT for the Display external connector. The EXTCON_DISP_DP is for DisplayPort, and the EXTCON_DISP_DP_ALT is the DisplayPort as an Alternate Mode for the USB Type-C connector (VESA DisplayPort Alt Mode on USB Type-C Standard). And for the Type-C USB, there is some information need to be supplied by PowerDelivery or other mode detecter: port orientation and pin assignments, so add these 2 virtual cable: EXTCON_TYPEC_POLARITY and EXTCON_TYPEC_PIN_ASSIGN. If EXTCON_TYPEC_POLARITY is attached, the Type-C get flip orientation. IF EXTCON_TYPEC_PIN_ASSIGN is attached, Type-C get Pin_Assignment_C(for DP only mode) or Pin_Assignment_D(for DP alt mode), the default Assignment is A or B. Signed-off-by: Chris Zhong --- Changes in v3: None Changes in v2: None Changes in v1: None drivers/extcon/extcon.c | 6 ++++++ include/linux/extcon.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 21a123c..0522b4d 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -53,6 +53,10 @@ static const char *extcon_name[] = { [EXTCON_CHG_USB_FAST] = "FAST-CHARGER", [EXTCON_CHG_USB_SLOW] = "SLOW-CHARGER", + /* Type-c connector */ + [EXTCON_TYPEC_POLARITY] = "TYPE-C-POLARITY", + [EXTCON_TYPEC_PIN_ASSIGN] = "TYPE-C-PIN-ASSIGN", + /* Jack external connector */ [EXTCON_JACK_MICROPHONE] = "MICROPHONE", [EXTCON_JACK_HEADPHONE] = "HEADPHONE", @@ -68,6 +72,8 @@ static const char *extcon_name[] = { [EXTCON_DISP_MHL] = "MHL", [EXTCON_DISP_DVI] = "DVI", [EXTCON_DISP_VGA] = "VGA", + [EXTCON_DISP_DP] = "DP", + [EXTCON_DISP_DP_ALT] = "DP-ALT", /* Miscellaneous external connector */ [EXTCON_DOCK] = "DOCK", diff --git a/include/linux/extcon.h b/include/linux/extcon.h index 7abf674..98039ad 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h @@ -45,6 +45,10 @@ #define EXTCON_CHG_USB_FAST 9 #define EXTCON_CHG_USB_SLOW 10 +/* Type-c connector */ +#define EXTCON_TYPEC_POLARITY 11 /* Typec-C plug orientation */ +#define EXTCON_TYPEC_PIN_ASSIGN 12 /* Typec-C pin Assignment */ + /* Jack external connector */ #define EXTCON_JACK_MICROPHONE 20 #define EXTCON_JACK_HEADPHONE 21 @@ -60,6 +64,8 @@ #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 */ +#define EXTCON_DISP_DP_ALT 45 /* Display Port Type-C Alternate Mode */ /* Miscellaneous external connector */ #define EXTCON_DOCK 60