Add I2C control driver for Sunplus SP7021 SoC
Subsystems (2)
v3 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
devicetree bindings I2C Add bindings doc for Sunplus SP7021
.../devicetree/bindings/i2c/i2c-sunplus.yaml | 72 + MAINTAINERS | 7 + drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-sunplus.c | 1483 ++++++++++++++++++++ 5 files changed, 1573 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
PATCH v3 1/2 I2C: Add I2C driver for Sunplus SP7021
Add I2C driver for Sunplus SP7021.
---
Changes in v3:
- Addressed all comments from Mr. Rob Herring.
- Modified the structure and register access method.
- Modifiedthe the YAML file.
MAINTAINERS | 6 + drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-sunplus.c | 1483 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 1500 insertions(+) create mode 100644 drivers/i2c/busses/i2c-sunplus.c
MAINTAINERS +6 -0
@@ -18242,6 +18242,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
@@ -1061,6 +1061,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 || SOC_Q645 || 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
@@ -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 +1483 -0
1,483 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v3 2/2 devicetree bindings I2C Add bindings doc for Sunplus SP7021
In reply to Li-hao KuoAdd devicetree bindings I2C Add bindings doc for Sunplus SP7021
---
Changes in v3:
- Addressed all comments from Mr. Rob Herring.
- Modified the structure and register access method.
- Modifiedthe the YAML file.
.../devicetree/bindings/i2c/i2c-sunplus.yaml | 72 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 73 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml new file +72 -0
@@ -0,0 +1,72 @@ +# 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 + - 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
@@ -18246,6 +18246,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
Rob Herring
maintainerRe: [PATCH v3 2/2] devicetree bindings I2C Add bindings doc for Sunplus SP7021
Quoted 73 lines · Li-hao Kuo
Add devicetree bindings I2C Add bindings doc for Sunplus SP7021
Signed-off-by Li-hao Kuo <[email protected]>---
Changes in v3:
- Addressed all comments from Mr. Rob Herring.
- Modified the structure and register access method.
- Modifiedthe the YAML file..../devicetree/bindings/i2c/i2c-sunplus.yaml | 72 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 73 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-sunplus.yamlDocumentation/devicetree/bindings/i2c/i2c-sunplus.yaml new file +53
-0@@ -0,0 +1,72 @@ +# 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 + - pinctrl-names + - pinctrl-0 + +unevaluatedProperties: false
Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml line 63
Quoted 10 lines
Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml new file +10
-0+ +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";
Indentation is messed up. Use spaces.
Quoted 25 lines
Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml new file +9
-0+ 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@@ -18246,6 +18246,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 SUPERHSignature · 1 line
2.7.4
Rob Herring
maintainerRe: [PATCH v3 2/2] devicetree bindings I2C Add bindings doc for Sunplus SP7021
In reply to Li-hao KuoQuoted 1 line · Li-hao Kuo
Add devicetree bindings I2C Add bindings doc for Sunplus SP7021
Please follow the subject format used by other files in the subsystem/directory. This should be clear with 'git log --oneline'. 'dt-bindings: i2c: ...' in this case.
Quoted 107 lines
Signed-off-by Li-hao Kuo <[email protected]>---
Changes in v3:
- Addressed all comments from Mr. Rob Herring.
- Modified the structure and register access method.
- Modifiedthe the YAML file..../devicetree/bindings/i2c/i2c-sunplus.yaml | 72 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 73 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-sunplus.yamlDocumentation/devicetree/bindings/i2c/i2c-sunplus.yaml new file +72
-0@@ -0,0 +1,72 @@ +# 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 + - 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@@ -18246,6 +18246,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 SUPERHSignature · 1 line
2.7.4