i2c: Support for Netlogic XLP9XX/5XX I2C controller
Subsystems (3)
v4 cover i2c: Support for Netlogic XLP9XX/5XX I2C controller
Here is v4 of the driver for XLP9xx I2C controller. We have udpated the driver to address review comments Uwe and Arnd.
Please let me know if there are any more comments or suggestions.
Thanks,
JC.
Changes v3->v4:
* Second round of changes from Uwe Kleine-König's review:
- added variable in xlp9xx_i2c_mask_irq & xlp9xx_i2c_unmask_irq
- use DIV_ROUND_UP when calculating prescale
- removed unnecessary braces
- renamed xlp9xx_i2c_set_rx_fifo_thres to xlp9xx_i2c_update_rx_fifo_thres and moved min macro there
* Changes for comments from Arnd Bergmann
- made a separate patch for i2c device tree document
- Use netlogic,xlp980-i2c as DT compatible string
Changes v2->v3:
* Implement changes from Uwe Kleine-König's review:
- add documentation link
- remove unnecessary #includes
- remove DATARDY interrupt
- clean up alignment and whitespace
- set CMD_STOP flag only for the last transfer
- correct freq assignment in xlp9xx_i2c_get_frequency
- remove printing out adap.nr in case of failure
- update writing to control register to make the logic clear
- clean up the #define ordering and naming a bit more
* use correct type in handling return of wait_for_completion_timeout
Changes v1->v2:
* Implement changes from Ray Jui's review
- Support for 0 length transfers
- remove .owner assignment in platform_driver and .data assignment in of_device_id table
- add synchronize_irq and disable interrupt in .remove
- Move most prints to dev_dbg
- add COMPILE_TEST
- align wrapped line in function definitions
- IRQ_NONE return if interrupt is not ours.
- error check frequency setting in DTB
- fix check of return of devm_ioremap_resource() and remove unnecessary prints
- fix incorrect irq check
- include file ordering fixed
- few unneeded variables taken out
- use u32 consistently for unsigned 32 bit int
- add comment for prescale value calculation
* Change clock-frequency parameter to take the bus frequency as expected in i2c subsystem
* Rearrage register definitions to group them better
* Add I2C_FUNC_10BIT_ADDR to xlp9xx_i2c_functionality()
* use reinit_completion before each transfer
* use i2c_add_adapter instead of doing i2c_add_numbered_adapter
Subhendu Sekhar Behera (3):
of: Add vendor prefix 'netlogic'
i2c: xlp9xx: Driver for Netlogic XLP9XX/5XX I2C controller
i2c: xlp9xx: device tree bindings
.../devicetree/bindings/i2c/i2c-xlp9xx.txt | 22 + .../devicetree/bindings/vendor-prefixes.txt | 1 + drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-xlp9xx.c | 444 +++++++++++++++++++++ 5 files changed, 478 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-xlp9xx.txt create mode 100644 drivers/i2c/busses/i2c-xlp9xx.c
Signature · 1 line
1.9.1
A message that is not in the archive (sent off-list or not yet received): 1426679430-26134-1-git-send-email-jchandra-dY08KVG/lbpWk0Htik3J/[email protected]
PATCH v4 1/3 of: Add vendor prefix 'netlogic'
From: Subhendu Sekhar Behera <sbehera-dY08KVG/lbpWk0Htik3J/[email protected]>
Add vendor name "netlogic" in vendor-prefixes.txt, which will be used for the Netlogic XLP and XLPII MIPS SoCs. These processors were from NetLogic Microsystems that is now a part of Broadcom Corporation.
--- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -123,6 +123,7 @@ mxicy Macronix International Co., Ltd. national National Semiconductor neonode Neonode Inc. netgear NETGEAR +netlogic Broadcom Corporation (formerly NetLogic Microsystems) newhaven Newhaven Display International nintendo Nintendo nokia Nokia
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v4 2/3 i2c: xlp9xx: Driver for Netlogic XLP9XX/5XX I2C controller
In reply to a message not in the archiveFrom: Subhendu Sekhar Behera <sbehera-dY08KVG/lbpWk0Htik3J/[email protected]>
Add an I2C bus driver i2c-xlp9xx.c to support the I2C block in the XLP9xx/XLP5xx MIPS SoC. Update Kconfig and Makefile to add the CONFIG_I2C_XLP9XX option.
--- drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-xlp9xx.c | 445 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 456 insertions(+) create mode 100644 drivers/i2c/busses/i2c-xlp9xx.c
drivers/i2c/busses/Kconfig +10 -0
@@ -898,6 +898,16 @@ config I2C_XLR This driver can also be built as a module. If so, the module will be called i2c-xlr. +config I2C_XLP9XX + tristate "XLP9XX I2C support" + depends on CPU_XLP || COMPILE_TEST + help + This driver enables support for the on-chip I2C interface of + the Broadcom XLP9xx/XLP5xx MIPS processors. + + This driver can also be built as a module. If so, the module will + be called i2c-xlp9xx. + config I2C_RCAR tristate "Renesas R-Car I2C Controller" depends on ARCH_SHMOBILE || COMPILE_TEST
drivers/i2c/busses/Makefile +1 -0
@@ -87,6 +87,7 @@ obj-$(CONFIG_I2C_WMT) += i2c-wmt.o obj-$(CONFIG_I2C_OCTEON) += i2c-octeon.o obj-$(CONFIG_I2C_XILINX) += i2c-xiic.o obj-$(CONFIG_I2C_XLR) += i2c-xlr.o +obj-$(CONFIG_I2C_XLP9XX) += i2c-xlp9xx.o obj-$(CONFIG_I2C_RCAR) += i2c-rcar.o # External I2C/SMBus adapter drivers
drivers/i2c/busses/i2c-xlp9xx.c new file +445 -0
445 lines not on this page · raw message
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1426679430-26134-3-git-send-email-jchandra-dY08KVG/lbpWk0Htik3J/[email protected]
Re: [PATCH v4 2/3] i2c: xlp9xx: Driver for Netlogic XLP9XX/5XX I2C controller
drivers/i2c/busses/i2c-xlp9xx.c line 304
Quoted 7 lines
drivers/i2c/busses/i2c-xlp9xx.c new file +6
-0+if (priv->msg_err) { +dev_dbg (priv->dev,"transfer error %x!\n" , priv->msg_err); +if (priv->msg_err &XLP9XX_I2C_INTEN_BUSERR ) +xlp9xx_i2c_init (priv); +return -EAGAIN ; + }
According to Documentation/i2c/fault-codes this should -EIO. I fixed that and applied the series to my local tree. Please send the missing Signed-off for patch 3 for completeness.
PATCH v4 3/3 i2c: xlp9xx: device tree bindings
In reply to a message not in the archiveFrom: Subhendu Sekhar Behera <sbehera-dY08KVG/lbpWk0Htik3J/[email protected]>
Add document Documentation/devicetree/bindings/i2c/i2c-xlp9xx.txt for Netlogic XLP9XX/5XX i2c controller. The compatible string is "netlogic,xlp980-i2c".
--- .../devicetree/bindings/i2c/i2c-xlp9xx.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-xlp9xx.txt
Documentation/devicetree/bindings/i2c/i2c-xlp9xx.txt new file +22 -0
@@ -0,0 +1,22 @@ +Device tree configuration for the I2C controller on the XLP9xx/5xx SoC + +Required properties: +- compatible : should be "netlogic,xlp980-i2c" +- reg : bus address start and address range size of device +- interrupts : interrupt number + +Optional properties: +- clock-frequency : frequency of bus clock in Hz + Defaults to 100 KHz when the property is not specified + +Example: + +i2c0: i2c@113100 { + compatible = "netlogic,xlp980-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0 0x113100 0x100>; + clock-frequency = <400000>; + interrupts = <30>; + interrupt-parent = <&pic>; +};
Signature · 1 line
1.9.1
A message that is not in the archive (sent off-list or not yet received): 1426679430-26134-4-git-send-email-jchandra-dY08KVG/lbpWk0Htik3J/[email protected]
Re: [PATCH v4 3/3] i2c: xlp9xx: device tree bindings
Quoted 5 lines · Jayachandran C
From: Subhendu Sekhar Behera <sbehera-dY08KVG/lbpWk0Htik3J/[email protected]>
Add document
Documentation/devicetree/bindings/i2c/i2c-xlp9xx.txtfor Netlogic XLP9XX/5XX i2c controller. The compatible string is "netlogic,xlp980-i2c".
This one is missing the SoB line. Please use checkpatch before sending patches. Can you send your SoB as a reply to this mail? No need to resend the series.
Quoted 10 lines
Changes
v3->v4:
* Second round of changes from Uwe Kleine-König's review:
* Changes for comments from Arnd BergmannChanges
v2->v3:
* Implement changes from Uwe Kleine-König's review:Changes
v1->v2:
* Implement changes from Ray Jui's review
Thanks to Ray, Uwe, and Arnd for the reviews. Much appreciated!