Skip to contentSkip to conversation

staging: typec: rt1711h typec driver and dt-bindings

PATCH In review ShuFan Lee 2 participants 4 messages Apr 9, 2018 – Apr 13, 2018

Subsystems (3)
lore
Share & tools
lore

ShuFan Lee

author
#0 lore raw

v5 cover staging: typec: rt1711h typec driver and dt-bindings

From: ShuFan Lee <[email protected]>

This patch series add rt1711h typec chip driver and dt-bindings

changelogs between v1 & v2
- use gpiod_* instead of gpio_*

changelogs between v2 & v3
- add dt-bindings for rt1711h typec driver

changelogs between v3 & v4
- add definition of RT1711H_VID and RT1711H_PID
- modify the way of using RT1711H_RTCTRL8_SET in rt1711h_set_vconn

changelogs between v4 & v5
- remove rt,intr-gpios in binding file and always use interrupts property
- remove parsing rt,intr-gpios and just use client->irq in rt1711h typec driver

ShuFan Lee (2):
staging: typec: rt1711h typec chip driver
dt-bindings: usb: rt1711h device tree binding document

 .../devicetree/bindings/usb/richtek,rt1711h.txt    |  17 ++
 drivers/staging/typec/Kconfig                      |   8 +
 drivers/staging/typec/Makefile                     |   1 +
 drivers/staging/typec/tcpci.h                      |   1 +
 drivers/staging/typec/tcpci_rt1711h.c              | 312 +++++++++++++++++++++
 5 files changed, 339 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/richtek,rt1711h.txt
 create mode 100644 drivers/staging/typec/tcpci_rt1711h.c
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v5 1/2 staging: typec: rt1711h typec chip driver

From: ShuFan Lee <[email protected]>

Richtek RT1711H Type-C chip driver that works with Type-C Port Controller Manager to provide USB PD and USB Type-C functionalities.
Add definition of TCPC_CC_STATUS_TOGGLING.

---
 drivers/staging/typec/Kconfig         |   8 +
 drivers/staging/typec/Makefile        |   1 +
 drivers/staging/typec/tcpci.h         |   1 +
 drivers/staging/typec/tcpci_rt1711h.c | 312 ++++++++++++++++++++++++++++++++++
 4 files changed, 322 insertions(+)
 create mode 100644 drivers/staging/typec/tcpci_rt1711h.c

changelogs between v1 & v2
- use gpiod_* instead of gpio_*

changelogs between v3 & v4
- add definition of RT1711H_VID and RT1711H_PID
- modify the way of using RT1711H_RTCTRL8_SET in rt1711h_set_vconn

changelogs between v4 & v5
- remove parsing rt,intr-gpios and just use client->irq parsed from interrupts property

drivers/staging/typec/Kconfig +8 -0
index 5359f556d203..3aa981fbc8f5 100644
@@ -9,6 +9,14 @@ config TYPEC_TCPCI
 	help
 	  Type-C Port Controller driver for TCPCI-compliant controller.
 
+config TYPEC_RT1711H
+	tristate "Richtek RT1711H Type-C chip driver"
+	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.
+
 endif
 
 endmenu
drivers/staging/typec/Makefile +1 -0
index 53d649abcb53..7803d485e1b3 100644
@@ -1 +1,2 @@
 obj-$(CONFIG_TYPEC_TCPCI)	+= tcpci.o
+obj-$(CONFIG_TYPEC_RT1711H)	+= tcpci_rt1711h.o
drivers/staging/typec/tcpci.h +1 -0
index 34c865f0dcf6..303ebde26546 100644
@@ -59,6 +59,7 @@
 #define TCPC_POWER_CTRL_VCONN_ENABLE	BIT(0)
 
 #define TCPC_CC_STATUS			0x1d
+#define TCPC_CC_STATUS_TOGGLING		BIT(5)
 #define TCPC_CC_STATUS_TERM		BIT(4)
 #define TCPC_CC_STATUS_CC2_SHIFT	2
 #define TCPC_CC_STATUS_CC2_MASK		0x3
drivers/staging/typec/tcpci_rt1711h.c new file +312 -0

312 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v5 2/2 dt-bindings: usb: rt1711h device tree binding document

In reply to ShuFan Lee

From: ShuFan Lee <[email protected]>

Add device tree binding document for Richtek RT1711H Type-C chip driver

---
 .../devicetree/bindings/usb/richtek,rt1711h.txt         | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/richtek,rt1711h.txt

changelogs between v2 & v3
- add dt-bindings for rt1711h typec driver

changelogs between v4 & v5
- remove rt,intr-gpios, always use interrupts property

Documentation/devicetree/bindings/usb/richtek,rt1711h.txt new file +17 -0
new file mode 100644
index 000000000000..09e847e92e5e
@@ -0,0 +1,17 @@
+Richtek RT1711H TypeC PD Controller.
+
+Required properties:
+ - compatible : Must be "richtek,rt1711h".
+ - reg : Must be 0x4e, it's slave address of RT1711H.
+ - interrupt-parent : the phandle for the interrupt controller that
+   provides interrupts for this device.
+ - interrupts : <a b> where a is the interrupt number and b represents an
+   encoding of the sense and level information for the interrupt.
+
+Example :
+rt1711h@4e {
+	compatible = "richtek,rt1711h";
+	reg = <0x4e>;
+	interrupt-parent = <&gpio26>;
+	interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+};
Signature · 1 line
1.9.1
maintainer Reviewed-by on v5 2/2
#3 lore raw

Re: [PATCH v5 2/2] dt-bindings: usb: rt1711h device tree binding document

Quoted 9 lines · ShuFan Lee

From: ShuFan Lee <[email protected]>

Add device tree binding document for Richtek RT1711H Type-C chip driver

---
 .../devicetree/bindings/usb/richtek,rt1711h.txt         | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/richtek,rt1711h.txt