Skip to contentSkip to conversation

Add I2C control driver for Sunplus SP7021 SoC

PATCH Superseded Li-hao Kuo 2 participants 4 messages Jan 21, 2022 – Feb 4, 2022

Subsystems (2)

v4 of 11 Superseded Latest is v11 →

lore
Share & tools
lore

Li-hao Kuo

author
#0 lore raw

v4 cover Add I2C control driver for Sunplus SP7021 SoC

This is a patch series for I2C driver for Sunplus SP7021 SoC.

Sunplus SP7021 is an ARM Cortex A7 (4 cores) based SoC. It integrates many peripherals (ex: UART, I2C, SPI, SDIO, eMMC, USB, SD card and etc.) into a single chip. It is designed for industrial control.

Refer to:
https://sunplus-tibbo.atlassian.net/wiki/spaces/doc/overview
https://tibbo.com/store/plus1.html

Li-hao Kuo (2):
i2c: Add i2c driver for Sunplus SP7021
dt-bindings:i2c: Add Sunplus SP7021 schema

 .../devicetree/bindings/i2c/i2c-sunplus.yaml       |   73 +
 MAINTAINERS                                        |    7 +
 drivers/i2c/busses/Kconfig                         |   10 +
 drivers/i2c/busses/Makefile                        |    1 +
 drivers/i2c/busses/i2c-sunplus.c                   | 1447 ++++++++++++++++++++
 5 files changed, 1538 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
 create mode 100644 drivers/i2c/busses/i2c-sunplus.c
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v4 1/2 i2c: Add i2c driver for Sunplus SP7021

Add i2c driver for Sunplus SP7021.

---
Changes in v4:
- Modified the YAML file : fix indentation issue

 MAINTAINERS                      |    6 +
 drivers/i2c/busses/Kconfig       |   10 +
 drivers/i2c/busses/Makefile      |    1 +
 drivers/i2c/busses/i2c-sunplus.c | 1447 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 1464 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-sunplus.c
MAINTAINERS +6 -0
index b84e2d5..4f83935 100644
@@ -18490,6 +18490,12 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/net/ethernet/dlink/sundance.c
 
+SUNPLUS I2C CONTROLLER INTERFACE DRIVER
+M:	Li-hao Kuo <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/i2c/busses/i2c-sunplus.c
+
 SUPERH
 M:	Yoshinori Sato <[email protected]>
 M:	Rich Felker <[email protected]>
drivers/i2c/busses/Kconfig +10 -0
index 42da31c..df35b0e 100644
@@ -1055,6 +1055,16 @@ config I2C_SUN6I_P2WI
 	  This interface is used to connect to specific PMIC devices (like the
 	  AXP221).
 
+config I2C_SUNPLUS
+	tristate "Sunplus I2C driver"
+	depends on SOC_SP7021 || COMPILE_TEST
+	help
+	  Say Y here to include support for I2C controller in the
+	  Sunplus SoCs.
+
+	  This driver can also be built as a module. If so, the module will be
+	  called as i2c-sunplus.
+
 config I2C_SYNQUACER
 	tristate "Socionext SynQuacer I2C controller"
 	depends on ARCH_SYNQUACER || COMPILE_TEST
drivers/i2c/busses/Makefile +1 -0
index 1d00dce..00f2e9a 100644
@@ -107,6 +107,7 @@ obj-$(CONFIG_I2C_STM32F4)	+= i2c-stm32f4.o
 i2c-stm32f7-drv-objs := i2c-stm32f7.o i2c-stm32.o
 obj-$(CONFIG_I2C_STM32F7)	+= i2c-stm32f7-drv.o
 obj-$(CONFIG_I2C_SUN6I_P2WI)	+= i2c-sun6i-p2wi.o
+obj-$(CONFIG_I2C_SUNPLUS)	+= i2c-sunplus.o
 obj-$(CONFIG_I2C_SYNQUACER)	+= i2c-synquacer.o
 obj-$(CONFIG_I2C_TEGRA)		+= i2c-tegra.o
 obj-$(CONFIG_I2C_TEGRA_BPMP)	+= i2c-tegra-bpmp.o
drivers/i2c/busses/i2c-sunplus.c new file +1447 -0

1,447 lines not on this page · raw message

Signature · 1 line
2.7.4
author
#2 lore raw

PATCH v4 2/2 dt-bindings:i2c: Add Sunplus SP7021 schema

In reply to Li-hao Kuo

Add bindings for Sunplus SP7021 i2c driver

---
Changes in v4:
- Modified the YAML file : fix indentation issue

 .../devicetree/bindings/i2c/i2c-sunplus.yaml       | 73 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 2 files changed, 74 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml new file +73 -0
new file mode 100644
index 0000000..e44a7ff
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/i2c-sunplus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus I2C controller
+
+allOf:
+  - $ref: /schemas/i2c/i2c-controller.yaml#
+
+maintainers:
+  - Li-hao Kuo <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - sunplus,sp7021-i2cm
+      - sunplus,q645-i2cm
+
+  reg:
+    items:
+      - description: I2C registers
+      - description: I2C DMA registers
+      - description: I2C DMA power registers
+
+  reg-names:
+    items:
+      - const: i2cm
+      - const: i2cmdma
+      - const: i2cdmapower
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+  - clocks
+  - resets
+  - clock-frequency
+  - pinctrl-names
+  - pinctrl-0
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/sp-sp7021.h>
+    #include <dt-bindings/reset/sp-sp7021.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c@9C004600 {
+        compatible = "sunplus,sp7021-i2cm";
+        reg = <0x9c004600 0x80>, <0x9c004680 0x80>, <0x9c000000 0x80>;
+        reg-names = "i2cm", "i2cmdma", "i2cdmapower";
+        interrupt-parent = <&intc>;
+        interrupts = <174 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clkc I2CM0>;
+        resets = <&rstc RST_I2CM0>;
+        clock-frequency = <100000>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&i2cm0_pins>;
+    };
+...
MAINTAINERS +1 -0
index 4f83935..44eddba 100644
@@ -18494,6 +18494,7 @@ SUNPLUS I2C CONTROLLER INTERFACE DRIVER
 M:	Li-hao Kuo <[email protected]>
 L:	[email protected]
 S:	Maintained
+F:	Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
 F:	drivers/i2c/busses/i2c-sunplus.c
 
 SUPERH
Signature · 1 line
2.7.4
maintainer Reviewed-by on v4 2/2
#3 lore raw

Re: [PATCH v4 2/2] dt-bindings:i2c: Add Sunplus SP7021 schema

Quoted 12 lines · Li-hao Kuo

Add bindings for Sunplus SP7021 i2c driver

---
Changes in v4:
- Modified the YAML file : fix indentation issue

 .../devicetree/bindings/i2c/i2c-sunplus.yaml       | 73 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 2 files changed, 74 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml