Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730633

[PATCH v3 4/5] typec: tcpm: Move out of staging

Path csiph.com!news.redatomik.org!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From Guenter Roeck <linux@roeck-us.net>
Newsgroups linux.kernel
Subject [PATCH v3 4/5] typec: tcpm: Move out of staging
Date Tue, 12 Sep 2017 05:40:01 +0200
Message-ID <uoKdj-4d7-9@gated-at.bofh.it> (permalink)
References <uoKdj-4d7-1@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=STBE8fxQMKo8HUrwnaYMFnPdPR0hIIa2LHX7yvhbkdw=; b=sTe8FdxOICzI5J5iV+cAz1xHNfYZPRxFhOCmOu+Y/Z9QHXRlyyjDyftG/wYO7pmp2L iy2DWc3QV7zMvhpJCE8DoH9T8FyfnPcYENV2jfcEYfrPgxjJSugOayEIwwcJI7ekNAYN NoFF8l1OzbL1tGJLmi+V5XU2Fuml6K/KHQW3to5+Vt/8kBtfjPDA8dL9Rf3QqzbapPOR Wle1ITuIhZ9pA4HiXX/OlEExl8+Mh11EVEpimPahpQMaGLlCprwoqk2v9m8a3p1CgB3C Be9vKJhGRvW1/GfXeBpyPctDkx3nVFk6Dvhx/IvpjE+5hQR9xd4KcEU9z2jo/D0/I7w+ PSgw==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=STBE8fxQMKo8HUrwnaYMFnPdPR0hIIa2LHX7yvhbkdw=; b=XJRKZlJCqnFupAzAlviNcoTGTkztEAnFxrJjepmAJFRn63VXUUXhYGFM9Awd42ZXuk bIrLjD1vtHAWQIbLuxkIvl/v6LaOhsumXaNJxmg02GkI6HKzZe1g7y1mPri1zx82T3Pw GNary2x1Hw7TKXaVquvlGlxam5YWsLlmqSaw3TKOiKxlLZ7c0wVf5+gVqFl2GheYSj9Z augF2RsO081xAFI9Dv+XaxEGCR0lz7GNlLj/sTgjNDnMuImzyhV0w26etFrGHUzePi/z Qaq7NULFdJr8WnXjxSv8RYhDdq6CPXW9NaV3YwIJnBGk7cpHckvNSUTaaacAnbBqw2AZ uWgQ==
X-Gm-Message-State AHPjjUibQxBns0BfKgVhxlqN6GvLrmxu9ccRL+8YRhudxPWyRmFrvTOE UrTAaQN0hzY27g==
X-Google-SMTP-Source ADKCNb4xBbO5Yh7LKQGupADXmpHnF032oNomc6OPzpOxb60J4IAGHRtYBsSR1/8CaHSqrTcDYSQdjw==
X-Received by 10.99.186.74 with SMTP id l10mr13884244pgu.355.1505187135927; Mon, 11 Sep 2017 20:32:15 -0700 (PDT)
X-Mailer git-send-email 2.7.4
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 178
Organization linux.* mail to news gateway
X-Original-Cc Heikki Krogerus <heikki.krogerus@linux.intel.com>, Yueyao Zhu <yueyao@google.com>, Badhri Jagan Sridharan <badhri@google.com>, Hans de Goede <hdegoede@redhat.com>, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-usb@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>
X-Original-Date Mon, 11 Sep 2017 20:32:07 -0700
X-Original-Message-ID <1505187128-5459-4-git-send-email-linux@roeck-us.net>
X-Original-References <1505187128-5459-1-git-send-email-linux@roeck-us.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1730633

Show key headers only | View raw


Move tcpm (USB Type-C Port Manager) out of staging.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Use format-patch -M
v3: No change

 drivers/staging/typec/Kconfig                         |  8 --------
 drivers/staging/typec/Makefile                        |  1 -
 drivers/staging/typec/TODO                            | 10 ----------
 drivers/staging/typec/fusb302/fusb302.c               |  4 ++--
 drivers/staging/typec/tcpci.c                         |  4 ++--
 drivers/usb/typec/Kconfig                             |  8 ++++++++
 drivers/usb/typec/Makefile                            |  1 +
 drivers/{staging => usb}/typec/tcpm.c                 |  9 ++++-----
 {drivers/staging/typec => include/linux/usb}/pd.h     |  0
 {drivers/staging/typec => include/linux/usb}/pd_bdo.h |  0
 {drivers/staging/typec => include/linux/usb}/pd_vdo.h |  0
 {drivers/staging/typec => include/linux/usb}/tcpm.h   |  0
 12 files changed, 17 insertions(+), 28 deletions(-)
 rename drivers/{staging => usb}/typec/tcpm.c (99%)
 rename {drivers/staging/typec => include/linux/usb}/pd.h (100%)
 rename {drivers/staging/typec => include/linux/usb}/pd_bdo.h (100%)
 rename {drivers/staging/typec => include/linux/usb}/pd_vdo.h (100%)
 rename {drivers/staging/typec => include/linux/usb}/tcpm.h (100%)

diff --git a/drivers/staging/typec/Kconfig b/drivers/staging/typec/Kconfig
index 37a0781b0d0c..31fad23c2553 100644
--- a/drivers/staging/typec/Kconfig
+++ b/drivers/staging/typec/Kconfig
@@ -1,13 +1,5 @@
 menu "USB Power Delivery and Type-C drivers"
 
-config TYPEC_TCPM
-	tristate "USB Type-C Port Controller Manager"
-	depends on USB
-	select TYPEC
-	help
-	  The Type-C Port Controller Manager provides a USB PD and USB Type-C
-	  state machine for use with Type-C Port Controllers.
-
 if TYPEC_TCPM
 
 config TYPEC_TCPCI
diff --git a/drivers/staging/typec/Makefile b/drivers/staging/typec/Makefile
index 30a7e29cbc9e..e1df3f0fde10 100644
--- a/drivers/staging/typec/Makefile
+++ b/drivers/staging/typec/Makefile
@@ -1,3 +1,2 @@
-obj-$(CONFIG_TYPEC_TCPM)	+= tcpm.o
 obj-$(CONFIG_TYPEC_TCPCI)	+= tcpci.o
 obj-y				+= fusb302/
diff --git a/drivers/staging/typec/TODO b/drivers/staging/typec/TODO
index bc1f97a2d1bf..53fe2f726c88 100644
--- a/drivers/staging/typec/TODO
+++ b/drivers/staging/typec/TODO
@@ -1,13 +1,3 @@
-tcpm:
-- Add documentation (at the very least for the API to low level drivers)
-- Split PD code into separate file
-- Check if it makes sense to use tracepoints instead of debugfs for debug logs
-- Implement Alternate Mode handling
-- Address "#if 0" code if not addressed with the above
-- Validate all comments marked with "XXX"; either address or remove comments
-- Add support for USB PD 3.0. While not mandatory, at least fast role swap
-  as well as authentication support would be very desirable.
-
 tcpci:
 - Test with real hardware
 
diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
index fc6a3cf74eb3..e790b67d4953 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -37,11 +37,11 @@
 #include <linux/string.h>
 #include <linux/types.h>
 #include <linux/usb/typec.h>
+#include <linux/usb/tcpm.h>
+#include <linux/usb/pd.h>
 #include <linux/workqueue.h>
 
 #include "fusb302_reg.h"
-#include "../tcpm.h"
-#include "../pd.h"
 
 /*
  * When the device is SNK, BC_LVL interrupt is used to monitor cc pins
diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
index df72d8b01e73..4636804ea1a4 100644
--- a/drivers/staging/typec/tcpci.c
+++ b/drivers/staging/typec/tcpci.c
@@ -20,11 +20,11 @@
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/regmap.h>
+#include <linux/usb/pd.h>
+#include <linux/usb/tcpm.h>
 #include <linux/usb/typec.h>
 
-#include "pd.h"
 #include "tcpci.h"
-#include "tcpm.h"
 
 #define PD_RETRY_COUNT 3
 
diff --git a/drivers/usb/typec/Kconfig b/drivers/usb/typec/Kconfig
index bc1b7745f1d4..888605860091 100644
--- a/drivers/usb/typec/Kconfig
+++ b/drivers/usb/typec/Kconfig
@@ -4,6 +4,14 @@ menu "USB Power Delivery and Type-C drivers"
 config TYPEC
 	tristate
 
+config TYPEC_TCPM
+	tristate "USB Type-C Port Controller Manager"
+	depends on USB
+	select TYPEC
+	help
+	  The Type-C Port Controller Manager provides a USB PD and USB Type-C
+	  state machine for use with Type-C Port Controllers.
+
 config TYPEC_WCOVE
 	tristate "Intel WhiskeyCove PMIC USB Type-C PHY driver"
 	depends on ACPI
diff --git a/drivers/usb/typec/Makefile b/drivers/usb/typec/Makefile
index bc214f15f1b5..eb883984724b 100644
--- a/drivers/usb/typec/Makefile
+++ b/drivers/usb/typec/Makefile
@@ -1,3 +1,4 @@
 obj-$(CONFIG_TYPEC)		+= typec.o
+obj-$(CONFIG_TYPEC_TCPM)	+= tcpm.o
 obj-$(CONFIG_TYPEC_WCOVE)	+= typec_wcove.o
 obj-$(CONFIG_TYPEC_UCSI)	+= ucsi/
diff --git a/drivers/staging/typec/tcpm.c b/drivers/usb/typec/tcpm.c
similarity index 99%
rename from drivers/staging/typec/tcpm.c
rename to drivers/usb/typec/tcpm.c
index cb25ec8334b0..f557c479fdc2 100644
--- a/drivers/staging/typec/tcpm.c
+++ b/drivers/usb/typec/tcpm.c
@@ -26,14 +26,13 @@
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <linux/usb/pd.h>
+#include <linux/usb/pd_bdo.h>
+#include <linux/usb/pd_vdo.h>
+#include <linux/usb/tcpm.h>
 #include <linux/usb/typec.h>
 #include <linux/workqueue.h>
 
-#include "pd.h"
-#include "pd_vdo.h"
-#include "pd_bdo.h"
-#include "tcpm.h"
-
 #define FOREACH_STATE(S)			\
 	S(INVALID_STATE),			\
 	S(DRP_TOGGLING),			\
diff --git a/drivers/staging/typec/pd.h b/include/linux/usb/pd.h
similarity index 100%
rename from drivers/staging/typec/pd.h
rename to include/linux/usb/pd.h
diff --git a/drivers/staging/typec/pd_bdo.h b/include/linux/usb/pd_bdo.h
similarity index 100%
rename from drivers/staging/typec/pd_bdo.h
rename to include/linux/usb/pd_bdo.h
diff --git a/drivers/staging/typec/pd_vdo.h b/include/linux/usb/pd_vdo.h
similarity index 100%
rename from drivers/staging/typec/pd_vdo.h
rename to include/linux/usb/pd_vdo.h
diff --git a/drivers/staging/typec/tcpm.h b/include/linux/usb/tcpm.h
similarity index 100%
rename from drivers/staging/typec/tcpm.h
rename to include/linux/usb/tcpm.h
-- 
2.7.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v3 4/5] typec: tcpm: Move out of staging Guenter Roeck <linux@roeck-us.net> - 2017-09-12 05:40 +0200

csiph-web