i2c: Add device tree support to i2c-pnx.c
PATCH v6 1/1 i2c: Add device tree support to i2c-pnx.c
This patch adds device tree support to the pnx-i2c driver by using platform resources for memory region and irq and removing dependency on mach includes.
The following platforms are affected:
* PNX
* LPC31xx (WIP)
* LPC32xx
The patch is based on a patch by Jon Smirl, working on lpc31xx integration
---
Applies to v3.4-rc3 + already applied i2c-pnx.c patches from this series
NOTE: I separated out this patch from the first patch series of the LPC32xx device tree conversion because most of those patches are already applied to -next. This is the last patch of this first series, a precondition for the LPC32xx device tree switch.
Changes since v5:
* Removed OF slave-addr property
* Removed whitespace fix
Thanks to Wolfram Sang for reviewing!
Documentation/devicetree/bindings/i2c/pnx.txt | 36 ++++++++++++++ drivers/i2c/busses/i2c-pnx.c | 63 +++++++++++++++++++------- include/linux/i2c-pnx.h | 1 3 files changed, 84 insertions(+), 16 deletions(-)
Documentation/devicetree/bindings/i2c/pnx.txt new file +36 -0
@@ -0,0 +1,36 @@ +* NXP PNX I2C Controller + +Required properties: + + - reg: Offset and length of the register set for the device + - compatible: should be "nxp,pnx-i2c" + - interrupts: configure one interrupt line + - #address-cells: always 1 (for i2c addresses) + - #size-cells: always 0 + - interrupt-parent: the phandle for the interrupt controller that + services interrupts for this device. + +Optional properties: + + - clock-frequency: desired I2C bus clock frequency in Hz, Default: 100000 Hz + +Examples: + + i2c1: i2c at 400a0000 { + compatible = "nxp,pnx-i2c"; + reg = <0x400a0000 0x100>; + interrupt-parent = <&mic>; + interrupts = <51 0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c2: i2c at 400a8000 { + compatible = "nxp,pnx-i2c"; + reg = <0x400a8000 0x100>; + interrupt-parent = <&mic>; + interrupts = <50 0>; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <100000>; + };
drivers/i2c/busses/i2c-pnx.c +47 -16
175 lines not on this page · raw message
include/linux/i2c-pnx.h +1 -0
@@ -32,6 +32,7 @@ struct i2c_pnx_algo_data {struct i2c_adapter adapter;phys_addr_t base;int irq; + u32 timeout; };#endif /* __I2C_PNX_H__ */
Wolfram Sang
AppliedQuoted 5 lines · Roland Stigge
This patch adds device tree support to the pnx-i2c driver by using platform resources for memory region and irq and removing dependency on mach includes.
The following platforms are affected:
Quoted 7 lines
* PNX
* LPC31xx (WIP)
* LPC32xxThe patch is based on a patch by Jon Smirl, working on lpc31xx integration
Signed-off-by Roland Stigge <[email protected]>
Applied to next \o/
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120420/f7154605/attachment-0001.sig>