All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] usb: typec: tps6598x: Move the driver under its own directory
@ 2021-03-10 10:46 Heikki Krogerus
  2021-03-10 10:46 ` [PATCH 1/3] usb: typec: tps6598x: Fix tracepoint header file Heikki Krogerus
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Heikki Krogerus @ 2021-03-10 10:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb

Hi,

The driver is going to be getting new features at one point it seems,
features like alternate mode registration, and firmware upgrading.
Some of those features will need to be implemented in their own files.
Because of that, and because the driver already consist of multiple
files, creating a separate folder for it.

The first patch is a minor fix.

thanks,

Heikki Krogerus (3):
  usb: typec: tps6598x: Fix tracepoint header file
  usb: typec: tps6598x: Move the driver under its own subdirectory
  usb: typec: tipd: Separate file for tracepoint creation

 drivers/usb/typec/Kconfig                         | 15 ++-------------
 drivers/usb/typec/Makefile                        |  5 +----
 drivers/usb/typec/tipd/Kconfig                    | 12 ++++++++++++
 drivers/usb/typec/tipd/Makefile                   |  6 ++++++
 drivers/usb/typec/{tps6598x.c => tipd/core.c}     |  6 ++----
 drivers/usb/typec/{ => tipd}/tps6598x.h           |  0
 drivers/usb/typec/tipd/trace.c                    |  9 +++++++++
 .../usb/typec/{tps6598x_trace.h => tipd/trace.h}  |  6 +++---
 8 files changed, 35 insertions(+), 24 deletions(-)
 create mode 100644 drivers/usb/typec/tipd/Kconfig
 create mode 100644 drivers/usb/typec/tipd/Makefile
 rename drivers/usb/typec/{tps6598x.c => tipd/core.c} (99%)
 rename drivers/usb/typec/{ => tipd}/tps6598x.h (100%)
 create mode 100644 drivers/usb/typec/tipd/trace.c
 rename drivers/usb/typec/{tps6598x_trace.h => tipd/trace.h} (98%)

-- 
2.30.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] usb: typec: tps6598x: Fix tracepoint header file
  2021-03-10 10:46 [PATCH 0/3] usb: typec: tps6598x: Move the driver under its own directory Heikki Krogerus
@ 2021-03-10 10:46 ` Heikki Krogerus
  2021-03-10 10:46 ` [PATCH 2/3] usb: typec: tps6598x: Move the driver under its own subdirectory Heikki Krogerus
  2021-03-10 10:46 ` [PATCH 3/3] usb: typec: tipd: Separate file for tracepoint creation Heikki Krogerus
  2 siblings, 0 replies; 4+ messages in thread
From: Heikki Krogerus @ 2021-03-10 10:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb

There were two typos in the precompiler conditions.

Fixes: 65a2f67d9945 ("usb: typec: tps6598x: Add trace event for IRQ events")
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/tps6598x_trace.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/tps6598x_trace.h b/drivers/usb/typec/tps6598x_trace.h
index 38bfb2f04e46d..21917751d61ee 100644
--- a/drivers/usb/typec/tps6598x_trace.h
+++ b/drivers/usb/typec/tps6598x_trace.h
@@ -9,7 +9,7 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM tps6598x
 
-#if !defined(_TPS6598x_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
+#if !defined(_TPS6598X_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
 #define _TPS6598X_TRACE_H_
 
 #include "tps6598x.h"
@@ -276,7 +276,7 @@ TRACE_EVENT(tps6598x_data_status,
 #endif /* _TPS6598X_TRACE_H_ */
 
 /* This part must be outside protection */
-#undef TRACE_INCLUDE_PATH
+#undef TRACE_INCLUDE_FILE
 #define TRACE_INCLUDE_FILE tps6598x_trace
 #undef TRACE_INCLUDE_PATH
 #define TRACE_INCLUDE_PATH .
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] usb: typec: tps6598x: Move the driver under its own subdirectory
  2021-03-10 10:46 [PATCH 0/3] usb: typec: tps6598x: Move the driver under its own directory Heikki Krogerus
  2021-03-10 10:46 ` [PATCH 1/3] usb: typec: tps6598x: Fix tracepoint header file Heikki Krogerus
@ 2021-03-10 10:46 ` Heikki Krogerus
  2021-03-10 10:46 ` [PATCH 3/3] usb: typec: tipd: Separate file for tracepoint creation Heikki Krogerus
  2 siblings, 0 replies; 4+ messages in thread
From: Heikki Krogerus @ 2021-03-10 10:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb

The driver consist of multiple files. Grouping all of them
under a separate directory drivers/usb/typec/tipd/.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/Kconfig                     | 15 ++-------------
 drivers/usb/typec/Makefile                    |  5 +----
 drivers/usb/typec/tipd/Kconfig                | 12 ++++++++++++
 drivers/usb/typec/tipd/Makefile               |  4 ++++
 drivers/usb/typec/{ => tipd}/tps6598x.c       |  0
 drivers/usb/typec/{ => tipd}/tps6598x.h       |  0
 drivers/usb/typec/{ => tipd}/tps6598x_trace.h |  0
 7 files changed, 19 insertions(+), 17 deletions(-)
 create mode 100644 drivers/usb/typec/tipd/Kconfig
 create mode 100644 drivers/usb/typec/tipd/Makefile
 rename drivers/usb/typec/{ => tipd}/tps6598x.c (100%)
 rename drivers/usb/typec/{ => tipd}/tps6598x.h (100%)
 rename drivers/usb/typec/{ => tipd}/tps6598x_trace.h (100%)

diff --git a/drivers/usb/typec/Kconfig b/drivers/usb/typec/Kconfig
index 270e81c087e92..a0418f23b4aae 100644
--- a/drivers/usb/typec/Kconfig
+++ b/drivers/usb/typec/Kconfig
@@ -50,6 +50,8 @@ source "drivers/usb/typec/tcpm/Kconfig"
 
 source "drivers/usb/typec/ucsi/Kconfig"
 
+source "drivers/usb/typec/tipd/Kconfig"
+
 config TYPEC_HD3SS3220
 	tristate "TI HD3SS3220 Type-C DRP Port controller driver"
 	depends on I2C
@@ -61,19 +63,6 @@ config TYPEC_HD3SS3220
 	  If you choose to build this driver as a dynamically linked module, the
 	  module will be called hd3ss3220.ko.
 
-config TYPEC_TPS6598X
-	tristate "TI TPS6598x USB Power Delivery controller driver"
-	depends on I2C
-	select POWER_SUPPLY
-	select REGMAP_I2C
-	select USB_ROLE_SWITCH
-	help
-	  Say Y or M here if your system has TI TPS65982 or TPS65983 USB Power
-	  Delivery controller.
-
-	  If you choose to build this driver as a dynamically linked module, the
-	  module will be called tps6598x.ko.
-
 config TYPEC_STUSB160X
 	tristate "STMicroelectronics STUSB160x Type-C controller driver"
 	depends on I2C
diff --git a/drivers/usb/typec/Makefile b/drivers/usb/typec/Makefile
index 27aa121291907..1fb8b6668b1ba 100644
--- a/drivers/usb/typec/Makefile
+++ b/drivers/usb/typec/Makefile
@@ -1,14 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0
-# define_trace.h needs to know how to find our header
-CFLAGS_tps6598x.o		:= -I$(src)
-
 obj-$(CONFIG_TYPEC)		+= typec.o
 typec-y				:= class.o mux.o bus.o
 obj-$(CONFIG_TYPEC)		+= altmodes/
 obj-$(CONFIG_TYPEC_TCPM)	+= tcpm/
 obj-$(CONFIG_TYPEC_UCSI)	+= ucsi/
+obj-$(CONFIG_TYPEC_TPS6598X)	+= tipd/
 obj-$(CONFIG_TYPEC_HD3SS3220)	+= hd3ss3220.o
-obj-$(CONFIG_TYPEC_TPS6598X)	+= tps6598x.o
 obj-$(CONFIG_TYPEC_QCOM_PMIC)	+= qcom-pmic-typec.o
 obj-$(CONFIG_TYPEC_STUSB160X) 	+= stusb160x.o
 obj-$(CONFIG_TYPEC)		+= mux/
diff --git a/drivers/usb/typec/tipd/Kconfig b/drivers/usb/typec/tipd/Kconfig
new file mode 100644
index 0000000000000..b827152930728
--- /dev/null
+++ b/drivers/usb/typec/tipd/Kconfig
@@ -0,0 +1,12 @@
+config TYPEC_TPS6598X
+	tristate "TI TPS6598x USB Power Delivery controller driver"
+	depends on I2C
+	select POWER_SUPPLY
+	select REGMAP_I2C
+	select USB_ROLE_SWITCH
+	help
+	  Say Y or M here if your system has TI TPS65982 or TPS65983 USB Power
+	  Delivery controller.
+
+	  If you choose to build this driver as a dynamically linked module, the
+	  module will be called tps6598x.ko.
diff --git a/drivers/usb/typec/tipd/Makefile b/drivers/usb/typec/tipd/Makefile
new file mode 100644
index 0000000000000..4c19eadb5f466
--- /dev/null
+++ b/drivers/usb/typec/tipd/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+CFLAGS_tps6598x.o		:= -I$(src)
+
+obj-$(CONFIG_TYPEC_TPS6598X)	+= tps6598x.o
diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tipd/tps6598x.c
similarity index 100%
rename from drivers/usb/typec/tps6598x.c
rename to drivers/usb/typec/tipd/tps6598x.c
diff --git a/drivers/usb/typec/tps6598x.h b/drivers/usb/typec/tipd/tps6598x.h
similarity index 100%
rename from drivers/usb/typec/tps6598x.h
rename to drivers/usb/typec/tipd/tps6598x.h
diff --git a/drivers/usb/typec/tps6598x_trace.h b/drivers/usb/typec/tipd/tps6598x_trace.h
similarity index 100%
rename from drivers/usb/typec/tps6598x_trace.h
rename to drivers/usb/typec/tipd/tps6598x_trace.h
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] usb: typec: tipd: Separate file for tracepoint creation
  2021-03-10 10:46 [PATCH 0/3] usb: typec: tps6598x: Move the driver under its own directory Heikki Krogerus
  2021-03-10 10:46 ` [PATCH 1/3] usb: typec: tps6598x: Fix tracepoint header file Heikki Krogerus
  2021-03-10 10:46 ` [PATCH 2/3] usb: typec: tps6598x: Move the driver under its own subdirectory Heikki Krogerus
@ 2021-03-10 10:46 ` Heikki Krogerus
  2 siblings, 0 replies; 4+ messages in thread
From: Heikki Krogerus @ 2021-03-10 10:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb

Creating the tracepoints only when tracing is enabled.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/tipd/Makefile                      | 4 +++-
 drivers/usb/typec/tipd/{tps6598x.c => core.c}        | 6 ++----
 drivers/usb/typec/tipd/trace.c                       | 9 +++++++++
 drivers/usb/typec/tipd/{tps6598x_trace.h => trace.h} | 2 +-
 4 files changed, 15 insertions(+), 6 deletions(-)
 rename drivers/usb/typec/tipd/{tps6598x.c => core.c} (99%)
 create mode 100644 drivers/usb/typec/tipd/trace.c
 rename drivers/usb/typec/tipd/{tps6598x_trace.h => trace.h} (99%)

diff --git a/drivers/usb/typec/tipd/Makefile b/drivers/usb/typec/tipd/Makefile
index 4c19eadb5f466..aa439f80a889e 100644
--- a/drivers/usb/typec/tipd/Makefile
+++ b/drivers/usb/typec/tipd/Makefile
@@ -1,4 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
-CFLAGS_tps6598x.o		:= -I$(src)
+CFLAGS_trace.o			:= -I$(src)
 
 obj-$(CONFIG_TYPEC_TPS6598X)	+= tps6598x.o
+tps6598x-y			:= core.o
+tps6598x-$(CONFIG_TRACING)	+= trace.o
diff --git a/drivers/usb/typec/tipd/tps6598x.c b/drivers/usb/typec/tipd/core.c
similarity index 99%
rename from drivers/usb/typec/tipd/tps6598x.c
rename to drivers/usb/typec/tipd/core.c
index 2c4ab90e16e79..9e924db421794 100644
--- a/drivers/usb/typec/tipd/tps6598x.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -6,8 +6,6 @@
  * Author: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  */
 
-#include "tps6598x.h"
-
 #include <linux/i2c.h>
 #include <linux/acpi.h>
 #include <linux/module.h>
@@ -17,8 +15,8 @@
 #include <linux/usb/typec.h>
 #include <linux/usb/role.h>
 
-#define CREATE_TRACE_POINTS
-#include "tps6598x_trace.h"
+#include "tps6598x.h"
+#include "trace.h"
 
 /* Register offsets */
 #define TPS_REG_VID			0x00
diff --git a/drivers/usb/typec/tipd/trace.c b/drivers/usb/typec/tipd/trace.c
new file mode 100644
index 0000000000000..016e68048dc24
--- /dev/null
+++ b/drivers/usb/typec/tipd/trace.c
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * TI TPS6598x USB Power Delivery Controller Trace Support
+ *
+ * Copyright (C) 2021, Intel Corporation
+ * Author: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+ */
+#define CREATE_TRACE_POINTS
+#include "trace.h"
diff --git a/drivers/usb/typec/tipd/tps6598x_trace.h b/drivers/usb/typec/tipd/trace.h
similarity index 99%
rename from drivers/usb/typec/tipd/tps6598x_trace.h
rename to drivers/usb/typec/tipd/trace.h
index 21917751d61ee..5d09d6f789300 100644
--- a/drivers/usb/typec/tipd/tps6598x_trace.h
+++ b/drivers/usb/typec/tipd/trace.h
@@ -277,7 +277,7 @@ TRACE_EVENT(tps6598x_data_status,
 
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_FILE tps6598x_trace
+#define TRACE_INCLUDE_FILE trace
 #undef TRACE_INCLUDE_PATH
 #define TRACE_INCLUDE_PATH .
 #include <trace/define_trace.h>
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-10 10:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 10:46 [PATCH 0/3] usb: typec: tps6598x: Move the driver under its own directory Heikki Krogerus
2021-03-10 10:46 ` [PATCH 1/3] usb: typec: tps6598x: Fix tracepoint header file Heikki Krogerus
2021-03-10 10:46 ` [PATCH 2/3] usb: typec: tps6598x: Move the driver under its own subdirectory Heikki Krogerus
2021-03-10 10:46 ` [PATCH 3/3] usb: typec: tipd: Separate file for tracepoint creation Heikki Krogerus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.