Message ID | 1551078369-1654-1-git-send-email-jun.li@nxp.com |
---|---|
State | Superseded, archived |
Headers | show |
Series | [1/2] dt-bindings: usb: add documentation for typec switch via GPIO | expand |
Context | Check | Description |
---|---|---|
robh/checkpatch | warning | "total: 0 errors, 1 warnings, 30 lines checked" |
On Mon, Feb 25, 2019 at 9:27 AM Jun Li <jun.li@nxp.com> wrote: > > This patch adds a simple typec switch driver which only needs > a GPIO to switch the super speed active channel according to > typec orientation. > +#include <linux/module.h> > +#include <linux/mutex.h> > +#include <linux/kernel.h> > +#include <linux/platform_device.h> > +#include <linux/of.h> > +#include <linux/of_gpio.h> I don't see how these are in use.
On Mon, Feb 25, 2019 at 07:27:08AM +0000, Jun Li wrote: > This patch adds a simple typec switch driver which only needs > a GPIO to switch the super speed active channel according to > typec orientation. > > Signed-off-by: Li Jun <jun.li@nxp.com> > --- > drivers/usb/typec/mux/Kconfig | 6 +++ > drivers/usb/typec/mux/Makefile | 1 + > drivers/usb/typec/mux/gpio-switch.c | 105 ++++++++++++++++++++++++++++++++++++ > 3 files changed, 112 insertions(+) > create mode 100644 drivers/usb/typec/mux/gpio-switch.c > > diff --git a/drivers/usb/typec/mux/Kconfig b/drivers/usb/typec/mux/Kconfig > index 01ed0d5..bc7d3c7 100644 > --- a/drivers/usb/typec/mux/Kconfig > +++ b/drivers/usb/typec/mux/Kconfig > @@ -9,4 +9,10 @@ config TYPEC_MUX_PI3USB30532 > Say Y or M if your system has a Pericom PI3USB30532 Type-C cross > switch / mux chip found on some devices with a Type-C port. > > +config TYPEC_SWITCH_GPIO > + tristate "Simple Super Speed Active Switch via GPIO" depends on GPIOLIB? > + help > + Say Y or M if your system has a typec super speed channel > + switch via a simple GPIO control. > + thanks,
Hi > -----Original Message----- > From: Andy Shevchenko <andy.shevchenko@gmail.com> > Sent: 2019年2月26日 15:25 > To: Jun Li <jun.li@nxp.com> > Cc: robh+dt@kernel.org; heikki.krogerus@linux.intel.com; > gregkh@linuxfoundation.org; hdegoede@redhat.com; linux-usb@vger.kernel.org; > devicetree@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com> > Subject: Re: [PATCH 2/2] usb: typec: add typec switch via GPIO control > > On Mon, Feb 25, 2019 at 9:27 AM Jun Li <jun.li@nxp.com> wrote: > > > > This patch adds a simple typec switch driver which only needs a GPIO > > to switch the super speed active channel according to typec > > orientation. > > > +#include <linux/module.h> > > +#include <linux/mutex.h> > > +#include <linux/kernel.h> > > +#include <linux/platform_device.h> > > > +#include <linux/of.h> > > +#include <linux/of_gpio.h> > > I don't see how these are in use. I will use below 2 head files instead for v2. #include <linux/gpio/consumer.h> #include <linux/mod_devicetable.h> Thanks Li Jun > > -- > With Best Regards, > Andy Shevchenko
> -----Original Message----- > From: Heikki Krogerus <heikki.krogerus@linux.intel.com> > Sent: 2019年2月27日 17:41 > To: Jun Li <jun.li@nxp.com> > Cc: robh+dt@kernel.org; gregkh@linuxfoundation.org; hdegoede@redhat.com; > andy.shevchenko@gmail.com; linux-usb@vger.kernel.org; > devicetree@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com> > Subject: Re: [PATCH 2/2] usb: typec: add typec switch via GPIO control > > On Mon, Feb 25, 2019 at 07:27:08AM +0000, Jun Li wrote: > > This patch adds a simple typec switch driver which only needs a GPIO > > to switch the super speed active channel according to typec > > orientation. > > > > Signed-off-by: Li Jun <jun.li@nxp.com> > > --- > > drivers/usb/typec/mux/Kconfig | 6 +++ > > drivers/usb/typec/mux/Makefile | 1 + > > drivers/usb/typec/mux/gpio-switch.c | 105 > > ++++++++++++++++++++++++++++++++++++ > > 3 files changed, 112 insertions(+) > > create mode 100644 drivers/usb/typec/mux/gpio-switch.c > > > > diff --git a/drivers/usb/typec/mux/Kconfig > > b/drivers/usb/typec/mux/Kconfig index 01ed0d5..bc7d3c7 100644 > > --- a/drivers/usb/typec/mux/Kconfig > > +++ b/drivers/usb/typec/mux/Kconfig > > @@ -9,4 +9,10 @@ config TYPEC_MUX_PI3USB30532 > > Say Y or M if your system has a Pericom PI3USB30532 Type-C cross > > switch / mux chip found on some devices with a Type-C port. > > > > +config TYPEC_SWITCH_GPIO > > + tristate "Simple Super Speed Active Switch via GPIO" > > depends on GPIOLIB? Yes, you are right, will add it in v2. Thanks Li Jun > > > + help > > + Say Y or M if your system has a typec super speed channel > > + switch via a simple GPIO control. > > + > > thanks, > > -- > heikki
diff --git a/Documentation/devicetree/bindings/usb/typec-switch-gpio.txt b/Documentation/devicetree/bindings/usb/typec-switch-gpio.txt new file mode 100644 index 0000000..4ef76cf --- /dev/null +++ b/Documentation/devicetree/bindings/usb/typec-switch-gpio.txt @@ -0,0 +1,30 @@ +Typec orientation switch via a GPIO +----------------------------------- + +Required properties: +- compatible: should be set one of following: + - "nxp,ptn36043" for NXP Type-C SuperSpeed active switch. + +- gpios: the GPIO used to switch the super speed active channel, + GPIO_ACTIVE_HIGH: GPIO state high for cc1; + GPIO_ACTIVE_LOW: GPIO state low for cc1. +- orientation-switch: must be present. + +Required sub-node: +- port: specify the remote endpoint of typec switch consumer. + +Example: + +ptn36043 { + compatible = "nxp,ptn36043"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ss_sel>; + gpios = <&gpio3 15 GPIO_ACTIVE_HIGH>; + orientation-switch; + + port { + usb3_data_ss: endpoint { + remote-endpoint = <&typec_con_ss>; + }; + }; +};
Some typec super speed active channel switch can be controlled via a GPIO, this binding can be used to specify the switch node by a GPIO and the remote endpoint of its consumre. Signed-off-by: Li Jun <jun.li@nxp.com> --- .../devicetree/bindings/usb/typec-switch-gpio.txt | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/typec-switch-gpio.txt