Skip to contentSkip to conversation

i2c: npcm7xx: new driver for I2C controller

PATCH Superseded Tali Perry 3 participants 6 messages Aug 7, 2018 – Aug 13, 2018

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Tali Perry

author maintainer
#0 lore raw

v2 cover i2c: npcm7xx: new driver for I2C controller

Nuvoton NPCM7XX I2C Controller
NPCM7xx includes 16 I2C contollers. THis driver operates the controller. This module also includes a slave mode, which will be submitted later on.

Any feedback would be appreciated.

v2 -> v1:
- run check patch in strict mode.
- use linux crc.
- define regs in constant offset without base.
- remove debug prints.
- no declerations for local functions.

v1: initial version

---
Tali Perry (2):
dt-binding: i2c: npcm7xx: add binding for i2c controller
i2c: npcm7xx: add i2c controller master mode only

 .../devicetree/bindings/i2c/i2c-npcm7xx.txt        |   27 +
 MAINTAINERS                                        |    8 +
 drivers/i2c/busses/Kconfig                         |   11 +
 drivers/i2c/busses/Makefile                        |    1 +
 drivers/i2c/busses/i2c-npcm7xx.c                   | 2017 ++++++++++++++++++++
 5 files changed, 2064 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt
 create mode 100644 drivers/i2c/busses/i2c-npcm7xx.c
Signature · 1 line
2.14.1
author maintainer
#1 lore raw

PATCH v2 1/2 dt-binding: i2c: npcm7xx: add binding for i2c controller

Nuvoton NPCM7XX I2C Controller
NPCM7xx includes 16 I2C contollers. THis driver operates the controller. This module also includes a slave mode, which will be submitted later on.

Any feedback would be appreciated.

v2 -> v1:
- run check patch in strict mode.
- use linux crc.
- define regs in constant offset without base.
- remove debug prints.
- no declerations for local functions.

v1: initial version

---
 .../devicetree/bindings/i2c/i2c-npcm7xx.txt        | 27 ++++++++++++++++++++++
 MAINTAINERS                                        |  8 +++++++
 2 files changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt
Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt new file +27 -0
new file mode 100644
index 000000000000..e2ee45d7a41e
@@ -0,0 +1,27 @@
+Nuvoton NPCM7XX I2C bus
+
+The NPCM750x includes sixteen I2C busses
+
+Required properties:
+- compatible      : must be "nuvoton,npcm750-i2c-bus"
+- reg             : Offset and length of the register set for the device.
+- interrupts      : Contain the I2C interrupt with flags for falling edge.
+- clocks          : phandle of I2C reference clock.
+
+Optional:
+- bus-frequency   : Contain the I2C bus frequency,
+			the default I2C bus frequency is 100000.
+- pinctrl-0       : must be <&smbX_pins>, X is module number
+			(on NPCM7XX it's 0 to 15)
+- pinctrl-names   : should be set to "default"
+Example:
+
+	i2c0: i2c-bus@80000 {
+		compatible = "nuvoton,npcm750-i2c-bus";
+		reg = <0x80000 0x1000>;
+		clocks = <&clk NPCM7XX_CLK_APB2>;
+		bus-frequency = <100000>;
+		interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&smb0_pins>;
+	};
MAINTAINERS +8 -0
index 192d7f73fd01..13bac916d21d 100644
@@ -1244,6 +1244,14 @@ F:	drivers/i2c/busses/i2c-aspeed.c
 F:	Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-i2c-ic.txt
 F:	Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
 
+ARM/NUVOTON I2C DRIVER
+M:	Tali Perry <[email protected]>
+L:	[email protected]
+L:	[email protected] (moderated for non-subscribers)
+S:	Maintained
+F:	drivers/i2c/busses/i2c-npcm7xx.c
+F:	Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt
+
 ARM/ASPEED MACHINE SUPPORT
 M:	Joel Stanley <[email protected]>
 R:	Andrew Jeffery <[email protected]>
Signature · 1 line
2.14.1
author maintainer
#4 lore raw

PATCH v2 2/2 i2c: npcm7xx: add i2c controller master mode only

In reply to Tali Perry

Nuvoton NPCM7XX I2C Controller
NPCM7xx includes 16 I2C contollers. THis driver operates the controller. This module also includes a slave mode, which will be submitted later on.

Any feedback would be appreciated.

v2 -> v1:
- run check patch in strict mode.
- use linux crc.
- define regs in constant offset without base.
- remove debug prints.
- no declerations for local functions.

v1: initial version

---
 drivers/i2c/busses/Kconfig       |   11 +
 drivers/i2c/busses/Makefile      |    1 +
 drivers/i2c/busses/i2c-npcm7xx.c | 2017 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 2029 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-npcm7xx.c
drivers/i2c/busses/Kconfig +11 -0
index 4f8df2ec87b1..692ce1568fb0 100644
@@ -742,6 +742,17 @@ config I2C_NOMADIK
 	  I2C interface from ST-Ericsson's Nomadik and Ux500 architectures,
 	  as well as the STA2X11 PCIe I/O HUB.
 
+config I2C_NPCM7XX
+	tristate "Nuvoton I2C Controller"
+	depends on ARCH_NPCM7XX
+	select I2C_SLAVE
+	help
+	  If you say yes to this option, support will be included for the
+	  Nuvoton I2C controller.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-npcm7xx.
+
 config I2C_OCORES
 	tristate "OpenCores I2C Controller"
 	help
drivers/i2c/busses/Makefile +1 -0
index 5a869144a0c5..80d4ec8908e1 100644
@@ -74,6 +74,7 @@ obj-$(CONFIG_I2C_MT65XX)	+= i2c-mt65xx.o
 obj-$(CONFIG_I2C_MV64XXX)	+= i2c-mv64xxx.o
 obj-$(CONFIG_I2C_MXS)		+= i2c-mxs.o
 obj-$(CONFIG_I2C_NOMADIK)	+= i2c-nomadik.o
+obj-$(CONFIG_I2C_NPCM7XX)	+= i2c-npcm7xx.o
 obj-$(CONFIG_I2C_OCORES)	+= i2c-ocores.o
 obj-$(CONFIG_I2C_OMAP)		+= i2c-omap.o
 obj-$(CONFIG_I2C_PASEMI)	+= i2c-pasemi.o
drivers/i2c/busses/i2c-npcm7xx.c new file +2017 -0

2,017 lines not on this page · raw message

Signature · 1 line
2.14.1
#5 lore raw

Re: [PATCH v2 2/2] i2c: npcm7xx: add i2c controller master mode only

Quoted 8 lines · Tali Perry

Nuvoton NPCM7XX I2C Controller
NPCM7xx includes 16 I2C contollers. THis driver operates the controller.
This module also includes a slave mode, which will be submitted later on.

Any feedback would be appreciated.

Quoted 8 lines

v2 -> v1:
- run check patch in strict mode.
- use linux crc.
- define regs in constant offset without base.
- remove debug prints.
- no declerations for local functions.

v1: initial version

I don't know / remember why I'm in Cc list here, but you can go through my other reviews and find style recommendations for your code as well.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
maintainer
#2 lore raw

Re: [PATCH v2 1/2] dt-binding: i2c: npcm7xx: add binding for i2c controller

In reply to Tali Perry

Hi, this is an automated email from Rob's (experimental) review bot. I found a couple of common problems with your patch. Please see below.

Quoted 13 lines · Tali Perry

Nuvoton NPCM7XX I2C Controller
NPCM7xx includes 16 I2C contollers. THis driver operates the controller. This module also includes a slave mode, which will be submitted later on.

Any feedback would be appreciated.

v2 -> v1:
- run check patch in strict mode.
- use linux crc.
- define regs in constant offset without base.
- remove debug prints.
- no declerations for local functions.

Quoted 4 lines

v1: initial version

The preferred subject prefix is "dt-bindings: <binding dir>: ...".

Quoted 6 lines
---
 .../devicetree/bindings/i2c/i2c-npcm7xx.txt        | 27 ++++++++++++++++++++++
 MAINTAINERS                                        |  8 +++++++
 2 files changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt
maintainer
#3 lore raw

Re: [PATCH v2 1/2] dt-binding: i2c: npcm7xx: add binding for i2c controller

In reply to Tali Perry
Quoted 29 lines · Tali Perry

Nuvoton NPCM7XX I2C Controller
NPCM7xx includes 16 I2C contollers. THis driver operates the controller. This module also includes a slave mode, which will be submitted later on.

Any feedback would be appreciated.

v2 -> v1:
- run check patch in strict mode.
- use linux crc.
- define regs in constant offset without base.
- remove debug prints.
- no declerations for local functions.

v1: initial version

---
 .../devicetree/bindings/i2c/i2c-npcm7xx.txt        | 27 ++++++++++++++++++++++
 MAINTAINERS                                        |  8 +++++++
 2 files changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt
Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt new file +0 -0
new file mode 100644
index 000000000000..e2ee45d7a41e

Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt line 6

Quoted 6 lines
Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt new file +6 -0
@@ -0,0 +1,27 @@
+Nuvoton NPCM7XX I2C bus
+
+The NPCM750x includes sixteen I2C busses
+
+Required properties:
+- compatible      : must be "nuvoton,npcm750-i2c-bus"

Is 'bus' how the datasheet calls it? If not, I'd drop the '-bus' part as it is really a controller.

Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt line 19

Quoted 13 lines
Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt new file +13 -0
+- reg             : Offset and length of the register set for the device.
+- interrupts      : Contain the I2C interrupt with flags for falling edge.
+- clocks          : phandle of I2C reference clock.
+
+Optional:
+- bus-frequency   : Contain the I2C bus frequency,
+			the default I2C bus frequency is 100000.
+- pinctrl-0       : must be <&smbX_pins>, X is module number
+			(on NPCM7XX it's 0 to 15)
+- pinctrl-names   : should be set to "default"
+Example:
+
+	i2c0: i2c-bus@80000 {

Should be 'i2c@80000'

Quoted 30 lines
Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt new file +8 -0
+		compatible = "nuvoton,npcm750-i2c-bus";
+		reg = <0x80000 0x1000>;
+		clocks = <&clk NPCM7XX_CLK_APB2>;
+		bus-frequency = <100000>;
+		interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&smb0_pins>;
+	};
MAINTAINERS +8 -0
index 192d7f73fd01..13bac916d21d 100644
@@ -1244,6 +1244,14 @@ F:	drivers/i2c/busses/i2c-aspeed.c
 F:	Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-i2c-ic.txt
 F:	Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
 
+ARM/NUVOTON I2C DRIVER
+M:	Tali Perry <[email protected]>
+L:	[email protected]
+L:	[email protected] (moderated for non-subscribers)
+S:	Maintained
+F:	drivers/i2c/busses/i2c-npcm7xx.c
+F:	Documentation/devicetree/bindings/i2c/i2c-npcm7xx.txt
+
 ARM/ASPEED MACHINE SUPPORT
 M:	Joel Stanley <[email protected]>
 R:	Andrew Jeffery <[email protected]>
Signature · 1 line
2.14.1