Re: [PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-10 Thread Heikki Krogerus
On Sat, Sep 08, 2018 at 06:37:12AM -0700, Guenter Roeck wrote:
> On 09/08/2018 04:12 AM, Hans de Goede wrote:
> > HI,
> > 
> > On 07-09-18 18:19, Guenter Roeck wrote:
> > > On Fri, Sep 07, 2018 at 05:06:12PM +0300, Heikki Krogerus wrote:
> > > > On Fri, Sep 07, 2018 at 06:35:12AM -0700, Guenter Roeck wrote:
> > > > > On 09/07/2018 05:56 AM, Heikki Krogerus wrote:
> > > > > > Moving all the drivers that depend on the Port Controller
> > > > > > Manager under a new a new directory drivers/usb/typec/tcpci/
> > > > > > and making Guenter Roeck as the designated reviewer of that
> > > > > > code.
> > > > > > 
> > > > > > Signed-off-by: Heikki Krogerus 
> > > > > > ---
> > > > > > 
> > > > > > Hi guys,
> > > > > > 
> > > > > > This should be fairly trivial change. There is no functional effect.
> > > > > > Even menuconfig looks the same. The only interesting thing is that 
> > > > > > I'm
> > > > > > proposing that Guenter is marked as the reviewer/maintainer of all
> > > > > > TCPCI/TCPM drivers.
> > > > > > 
> > > > > > So Guenter, I guess the only question is that are you okay with 
> > > > > > this?
> > > > > > 
> > > > > 
> > > > > NP. I am not sure about the directory name, though. fusb and wcove 
> > > > > don't
> > > > > really support tcpci; only rt1711h does. The common denominator is 
> > > > > really
> > > > > the port manager (tcpm), not the port controller interface (tcpci).
> > > > > 
> > > > > As such, "typec port controller drivers" (without "interface") may be
> > > > > a bit more appropriate.
> > > > 
> > > > Makes sense.
> > > > 
> > > > > Not sure about the directory name, though. Maybe a simple "port" or
> > > > > "controller" would do ? Or anything else that doesn't look like the
> > > > > abbreviation for one of the supported protocols.
> > > > 
> > > > "port" maybe, but not controller. tps6598x.c is also a controller
> > > > driver, but it does not belong to that directory.
> > > > 
> > > > How about "phy"?
> > > > 
> > > Maybe just use 'port'. Seems to me that 'phy' would not really be a good
> > > match for the port manager (tcpm). 'phy' would still be better than tcpci,
> > > though, so I am ok with it if others think it should be used.
> > 
> > I'm not a fan of phy, that makes me expect actual ethernet/sata/usb phy 
> > drivers,
> > which these or not.
> > 
> > Why not just use tcpm ? As Guenter said that is the common denominator.
> > 
> 
> Thinking about it, that makes sense.

OK, tcpm it is. I'll prepare v2.

Thanks guys,

-- 
heikki


Re: [PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-08 Thread Guenter Roeck

On 09/08/2018 04:12 AM, Hans de Goede wrote:

HI,

On 07-09-18 18:19, Guenter Roeck wrote:

On Fri, Sep 07, 2018 at 05:06:12PM +0300, Heikki Krogerus wrote:

On Fri, Sep 07, 2018 at 06:35:12AM -0700, Guenter Roeck wrote:

On 09/07/2018 05:56 AM, Heikki Krogerus wrote:

Moving all the drivers that depend on the Port Controller
Manager under a new a new directory drivers/usb/typec/tcpci/
and making Guenter Roeck as the designated reviewer of that
code.

Signed-off-by: Heikki Krogerus 
---

Hi guys,

This should be fairly trivial change. There is no functional effect.
Even menuconfig looks the same. The only interesting thing is that I'm
proposing that Guenter is marked as the reviewer/maintainer of all
TCPCI/TCPM drivers.

So Guenter, I guess the only question is that are you okay with this?



NP. I am not sure about the directory name, though. fusb and wcove don't
really support tcpci; only rt1711h does. The common denominator is really
the port manager (tcpm), not the port controller interface (tcpci).

As such, "typec port controller drivers" (without "interface") may be
a bit more appropriate.


Makes sense.


Not sure about the directory name, though. Maybe a simple "port" or
"controller" would do ? Or anything else that doesn't look like the
abbreviation for one of the supported protocols.


"port" maybe, but not controller. tps6598x.c is also a controller
driver, but it does not belong to that directory.

How about "phy"?


Maybe just use 'port'. Seems to me that 'phy' would not really be a good
match for the port manager (tcpm). 'phy' would still be better than tcpci,
though, so I am ok with it if others think it should be used.


I'm not a fan of phy, that makes me expect actual ethernet/sata/usb phy drivers,
which these or not.

Why not just use tcpm ? As Guenter said that is the common denominator.



Thinking about it, that makes sense.

Guenter



Re: [PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-08 Thread Hans de Goede

HI,

On 07-09-18 18:19, Guenter Roeck wrote:

On Fri, Sep 07, 2018 at 05:06:12PM +0300, Heikki Krogerus wrote:

On Fri, Sep 07, 2018 at 06:35:12AM -0700, Guenter Roeck wrote:

On 09/07/2018 05:56 AM, Heikki Krogerus wrote:

Moving all the drivers that depend on the Port Controller
Manager under a new a new directory drivers/usb/typec/tcpci/
and making Guenter Roeck as the designated reviewer of that
code.

Signed-off-by: Heikki Krogerus 
---

Hi guys,

This should be fairly trivial change. There is no functional effect.
Even menuconfig looks the same. The only interesting thing is that I'm
proposing that Guenter is marked as the reviewer/maintainer of all
TCPCI/TCPM drivers.

So Guenter, I guess the only question is that are you okay with this?



NP. I am not sure about the directory name, though. fusb and wcove don't
really support tcpci; only rt1711h does. The common denominator is really
the port manager (tcpm), not the port controller interface (tcpci).

As such, "typec port controller drivers" (without "interface") may be
a bit more appropriate.


Makes sense.


Not sure about the directory name, though. Maybe a simple "port" or
"controller" would do ? Or anything else that doesn't look like the
abbreviation for one of the supported protocols.


"port" maybe, but not controller. tps6598x.c is also a controller
driver, but it does not belong to that directory.

How about "phy"?


Maybe just use 'port'. Seems to me that 'phy' would not really be a good
match for the port manager (tcpm). 'phy' would still be better than tcpci,
though, so I am ok with it if others think it should be used.


I'm not a fan of phy, that makes me expect actual ethernet/sata/usb phy drivers,
which these or not.

Why not just use tcpm ? As Guenter said that is the common denominator.

Anyways this change is fine with me regardless of the name.

Regards,

Hans


Re: [PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-07 Thread Guenter Roeck
On Fri, Sep 07, 2018 at 05:06:12PM +0300, Heikki Krogerus wrote:
> On Fri, Sep 07, 2018 at 06:35:12AM -0700, Guenter Roeck wrote:
> > On 09/07/2018 05:56 AM, Heikki Krogerus wrote:
> > > Moving all the drivers that depend on the Port Controller
> > > Manager under a new a new directory drivers/usb/typec/tcpci/
> > > and making Guenter Roeck as the designated reviewer of that
> > > code.
> > > 
> > > Signed-off-by: Heikki Krogerus 
> > > ---
> > > 
> > > Hi guys,
> > > 
> > > This should be fairly trivial change. There is no functional effect.
> > > Even menuconfig looks the same. The only interesting thing is that I'm
> > > proposing that Guenter is marked as the reviewer/maintainer of all
> > > TCPCI/TCPM drivers.
> > > 
> > > So Guenter, I guess the only question is that are you okay with this?
> > > 
> > 
> > NP. I am not sure about the directory name, though. fusb and wcove don't
> > really support tcpci; only rt1711h does. The common denominator is really
> > the port manager (tcpm), not the port controller interface (tcpci).
> > 
> > As such, "typec port controller drivers" (without "interface") may be
> > a bit more appropriate.
> 
> Makes sense.
> 
> > Not sure about the directory name, though. Maybe a simple "port" or
> > "controller" would do ? Or anything else that doesn't look like the
> > abbreviation for one of the supported protocols.
> 
> "port" maybe, but not controller. tps6598x.c is also a controller
> driver, but it does not belong to that directory.
> 
> How about "phy"?
> 
Maybe just use 'port'. Seems to me that 'phy' would not really be a good
match for the port manager (tcpm). 'phy' would still be better than tcpci,
though, so I am ok with it if others think it should be used.

Guenter

> Does anybody have a proposal/vote what we should use?
> 
> 
> Thanks,
> 
> -- 
> heikki


Re: [PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-07 Thread Heikki Krogerus
On Fri, Sep 07, 2018 at 06:35:12AM -0700, Guenter Roeck wrote:
> On 09/07/2018 05:56 AM, Heikki Krogerus wrote:
> > Moving all the drivers that depend on the Port Controller
> > Manager under a new a new directory drivers/usb/typec/tcpci/
> > and making Guenter Roeck as the designated reviewer of that
> > code.
> > 
> > Signed-off-by: Heikki Krogerus 
> > ---
> > 
> > Hi guys,
> > 
> > This should be fairly trivial change. There is no functional effect.
> > Even menuconfig looks the same. The only interesting thing is that I'm
> > proposing that Guenter is marked as the reviewer/maintainer of all
> > TCPCI/TCPM drivers.
> > 
> > So Guenter, I guess the only question is that are you okay with this?
> > 
> 
> NP. I am not sure about the directory name, though. fusb and wcove don't
> really support tcpci; only rt1711h does. The common denominator is really
> the port manager (tcpm), not the port controller interface (tcpci).
> 
> As such, "typec port controller drivers" (without "interface") may be
> a bit more appropriate.

Makes sense.

> Not sure about the directory name, though. Maybe a simple "port" or
> "controller" would do ? Or anything else that doesn't look like the
> abbreviation for one of the supported protocols.

"port" maybe, but not controller. tps6598x.c is also a controller
driver, but it does not belong to that directory.

How about "phy"?

Does anybody have a proposal/vote what we should use?


Thanks,

-- 
heikki


Re: [PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-07 Thread Guenter Roeck

On 09/07/2018 05:56 AM, Heikki Krogerus wrote:

Moving all the drivers that depend on the Port Controller
Manager under a new a new directory drivers/usb/typec/tcpci/
and making Guenter Roeck as the designated reviewer of that
code.

Signed-off-by: Heikki Krogerus 
---

Hi guys,

This should be fairly trivial change. There is no functional effect.
Even menuconfig looks the same. The only interesting thing is that I'm
proposing that Guenter is marked as the reviewer/maintainer of all
TCPCI/TCPM drivers.

So Guenter, I guess the only question is that are you okay with this?



NP. I am not sure about the directory name, though. fusb and wcove don't
really support tcpci; only rt1711h does. The common denominator is really
the port manager (tcpm), not the port controller interface (tcpci).

As such, "typec port controller drivers" (without "interface") may be
a bit more appropriate. Not sure about the directory name, though.
Maybe a simple "port" or "controller" would do ? Or anything else that
doesn't look like the abbreviation for one of the supported protocols.

Guenter



thanks,

---
  MAINTAINERS   |  6 +++
  drivers/usb/typec/Kconfig | 45 +---
  drivers/usb/typec/Makefile|  6 +--
  drivers/usb/typec/fusb302/Kconfig |  7 ---
  drivers/usb/typec/fusb302/Makefile|  2 -
  drivers/usb/typec/tcpci/Kconfig   | 52 +++
  drivers/usb/typec/tcpci/Makefile  |  7 +++
  .../usb/typec/{fusb302 => tcpci}/fusb302.c|  0
  .../typec/{fusb302 => tcpci}/fusb302_reg.h|  0
  drivers/usb/typec/{ => tcpci}/tcpci.c |  0
  drivers/usb/typec/{ => tcpci}/tcpci.h |  0
  drivers/usb/typec/{ => tcpci}/tcpci_rt1711h.c |  0
  drivers/usb/typec/{ => tcpci}/tcpm.c  |  0
  .../typec/{typec_wcove.c => tcpci/wcove.c}|  0
  14 files changed, 67 insertions(+), 58 deletions(-)
  delete mode 100644 drivers/usb/typec/fusb302/Kconfig
  delete mode 100644 drivers/usb/typec/fusb302/Makefile
  create mode 100644 drivers/usb/typec/tcpci/Kconfig
  create mode 100644 drivers/usb/typec/tcpci/Makefile
  rename drivers/usb/typec/{fusb302 => tcpci}/fusb302.c (100%)
  rename drivers/usb/typec/{fusb302 => tcpci}/fusb302_reg.h (100%)
  rename drivers/usb/typec/{ => tcpci}/tcpci.c (100%)
  rename drivers/usb/typec/{ => tcpci}/tcpci.h (100%)
  rename drivers/usb/typec/{ => tcpci}/tcpci_rt1711h.c (100%)
  rename drivers/usb/typec/{ => tcpci}/tcpm.c (100%)
  rename drivers/usb/typec/{typec_wcove.c => tcpci/wcove.c} (100%)

diff --git a/MAINTAINERS b/MAINTAINERS
index d5382b224f80..22702a40fa23 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15301,6 +15301,12 @@ F: Documentation/driver-api/usb/typec_bus.rst
  F:drivers/usb/typec/altmodes/
  F:include/linux/usb/typec_altmode.h
  
+USB TYPEC PORT CONTROLLER INTERFACE DRIVERS

+M: Guenter Roeck 
+L: linux-usb@vger.kernel.org
+S: Maintained
+F: drivers/usb/typec/tcpci/
+
  USB UHCI DRIVER
  M:Alan Stern 
  L:linux-usb@vger.kernel.org
diff --git a/drivers/usb/typec/Kconfig b/drivers/usb/typec/Kconfig
index 00878c386dd0..64e8aeabb368 100644
--- a/drivers/usb/typec/Kconfig
+++ b/drivers/usb/typec/Kconfig
@@ -45,50 +45,7 @@ menuconfig TYPEC
  
  if TYPEC
  
-config TYPEC_TCPM

-   tristate "USB Type-C Port Controller Manager"
-   depends on USB
-   select USB_ROLE_SWITCH
-   select POWER_SUPPLY
-   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
-   tristate "Type-C Port Controller Interface driver"
-   depends on I2C
-   select REGMAP_I2C
-   help
- Type-C Port Controller driver for TCPCI-compliant controller.
-
-config TYPEC_RT1711H
-   tristate "Richtek RT1711H Type-C chip driver"
-   depends on I2C
-   select TYPEC_TCPCI
-   help
- Richtek RT1711H Type-C chip driver that works with
- Type-C Port Controller Manager to provide USB PD and USB
- Type-C functionalities.
-
-source "drivers/usb/typec/fusb302/Kconfig"
-
-config TYPEC_WCOVE
-   tristate "Intel WhiskeyCove PMIC USB Type-C PHY driver"
-   depends on ACPI
-   depends on INTEL_SOC_PMIC
-   depends on INTEL_PMC_IPC
-   depends on BXT_WC_PMIC_OPREGION
-   help
- This driver adds support for USB Type-C detection on Intel Broxton
- platforms that have Intel Whiskey Cove PMIC. The driver can detect the
- role and cable orientation.
-
- To compile this driver as module, choose M here: the module will be
- called typec_wcove
-
-endif # TYPEC_TCPM
+source "drivers/usb/typec/tcpci/Kconfig"
  
  source "drivers/usb/typec/ucsi/Kconfig"
  
diff --git a/drivers/usb/typec/Makefile b/drivers/usb/typec/Makefile

index 45b0aef428a8..7fa8dd301d72 100644
--- a/drivers/usb/typec/Makefile
++

[PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-07 Thread Heikki Krogerus
Moving all the drivers that depend on the Port Controller
Manager under a new a new directory drivers/usb/typec/tcpci/
and making Guenter Roeck as the designated reviewer of that
code.

Signed-off-by: Heikki Krogerus 
---

Hi guys,

This should be fairly trivial change. There is no functional effect.
Even menuconfig looks the same. The only interesting thing is that I'm
proposing that Guenter is marked as the reviewer/maintainer of all
TCPCI/TCPM drivers.

So Guenter, I guess the only question is that are you okay with this?


thanks,

---
 MAINTAINERS   |  6 +++
 drivers/usb/typec/Kconfig | 45 +---
 drivers/usb/typec/Makefile|  6 +--
 drivers/usb/typec/fusb302/Kconfig |  7 ---
 drivers/usb/typec/fusb302/Makefile|  2 -
 drivers/usb/typec/tcpci/Kconfig   | 52 +++
 drivers/usb/typec/tcpci/Makefile  |  7 +++
 .../usb/typec/{fusb302 => tcpci}/fusb302.c|  0
 .../typec/{fusb302 => tcpci}/fusb302_reg.h|  0
 drivers/usb/typec/{ => tcpci}/tcpci.c |  0
 drivers/usb/typec/{ => tcpci}/tcpci.h |  0
 drivers/usb/typec/{ => tcpci}/tcpci_rt1711h.c |  0
 drivers/usb/typec/{ => tcpci}/tcpm.c  |  0
 .../typec/{typec_wcove.c => tcpci/wcove.c}|  0
 14 files changed, 67 insertions(+), 58 deletions(-)
 delete mode 100644 drivers/usb/typec/fusb302/Kconfig
 delete mode 100644 drivers/usb/typec/fusb302/Makefile
 create mode 100644 drivers/usb/typec/tcpci/Kconfig
 create mode 100644 drivers/usb/typec/tcpci/Makefile
 rename drivers/usb/typec/{fusb302 => tcpci}/fusb302.c (100%)
 rename drivers/usb/typec/{fusb302 => tcpci}/fusb302_reg.h (100%)
 rename drivers/usb/typec/{ => tcpci}/tcpci.c (100%)
 rename drivers/usb/typec/{ => tcpci}/tcpci.h (100%)
 rename drivers/usb/typec/{ => tcpci}/tcpci_rt1711h.c (100%)
 rename drivers/usb/typec/{ => tcpci}/tcpm.c (100%)
 rename drivers/usb/typec/{typec_wcove.c => tcpci/wcove.c} (100%)

diff --git a/MAINTAINERS b/MAINTAINERS
index d5382b224f80..22702a40fa23 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15301,6 +15301,12 @@ F: Documentation/driver-api/usb/typec_bus.rst
 F: drivers/usb/typec/altmodes/
 F: include/linux/usb/typec_altmode.h
 
+USB TYPEC PORT CONTROLLER INTERFACE DRIVERS
+M: Guenter Roeck 
+L: linux-usb@vger.kernel.org
+S: Maintained
+F: drivers/usb/typec/tcpci/
+
 USB UHCI DRIVER
 M: Alan Stern 
 L: linux-usb@vger.kernel.org
diff --git a/drivers/usb/typec/Kconfig b/drivers/usb/typec/Kconfig
index 00878c386dd0..64e8aeabb368 100644
--- a/drivers/usb/typec/Kconfig
+++ b/drivers/usb/typec/Kconfig
@@ -45,50 +45,7 @@ menuconfig TYPEC
 
 if TYPEC
 
-config TYPEC_TCPM
-   tristate "USB Type-C Port Controller Manager"
-   depends on USB
-   select USB_ROLE_SWITCH
-   select POWER_SUPPLY
-   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
-   tristate "Type-C Port Controller Interface driver"
-   depends on I2C
-   select REGMAP_I2C
-   help
- Type-C Port Controller driver for TCPCI-compliant controller.
-
-config TYPEC_RT1711H
-   tristate "Richtek RT1711H Type-C chip driver"
-   depends on I2C
-   select TYPEC_TCPCI
-   help
- Richtek RT1711H Type-C chip driver that works with
- Type-C Port Controller Manager to provide USB PD and USB
- Type-C functionalities.
-
-source "drivers/usb/typec/fusb302/Kconfig"
-
-config TYPEC_WCOVE
-   tristate "Intel WhiskeyCove PMIC USB Type-C PHY driver"
-   depends on ACPI
-   depends on INTEL_SOC_PMIC
-   depends on INTEL_PMC_IPC
-   depends on BXT_WC_PMIC_OPREGION
-   help
- This driver adds support for USB Type-C detection on Intel Broxton
- platforms that have Intel Whiskey Cove PMIC. The driver can detect the
- role and cable orientation.
-
- To compile this driver as module, choose M here: the module will be
- called typec_wcove
-
-endif # TYPEC_TCPM
+source "drivers/usb/typec/tcpci/Kconfig"
 
 source "drivers/usb/typec/ucsi/Kconfig"
 
diff --git a/drivers/usb/typec/Makefile b/drivers/usb/typec/Makefile
index 45b0aef428a8..7fa8dd301d72 100644
--- a/drivers/usb/typec/Makefile
+++ b/drivers/usb/typec/Makefile
@@ -2,11 +2,7 @@
 obj-$(CONFIG_TYPEC)+= typec.o
 typec-y:= class.o mux.o bus.o
 obj-$(CONFIG_TYPEC)+= altmodes/
-obj-$(CONFIG_TYPEC_TCPM)   += tcpm.o
-obj-y  += fusb302/
-obj-$(CONFIG_TYPEC_WCOVE)  += typec_wcove.o
+obj-$(CONFIG_TYPEC_TCPM)   += tcpci/
 obj-$(CONFIG_TYPEC_UCSI)   += ucsi/
 obj-$(CONFIG_TYPEC_TPS6598X)   += tps6598x.o
 obj-$(CONFIG_TYPEC)+= mux/
-obj-$(CONFIG_TYPEC_TCPCI)  += tcpci.o
-obj-$(CONFIG_TYPEC_RT1711H)+= tcpci_rt1711h