Marvell mv64xxx i2c driver
PATCH 1/1 Marvell mv64xxx i2c driver
Forgot to cc: this list...
--
Greg, Philip,
Marvell makes a line of host bridge for PPC and MIPS systems. On those bridges is an i2c controller. This patch adds the driver for that i2c controller.
Please let me know if you see any problems with this patch.
Also, if you're not the correct person(s), please point me to who is.
Thanks,
Mark
Signed-off-by Mark A. Greer <[email protected]>
drivers/i2c/busses/Kconfig +10 -0
@@ -476,4 +476,14 @@ This driver can also be built as a module. If so, the module will be called i2c-pca-isa. +config I2C_MV64XXX + tristate "Marvell mv64xxx I2C Controller" + depends on I2C && MV64X60 + help + If you say yes to this option, support will be included for the + built-in I2C interface on the Marvell 64xxx line of host bridges + + This driver can also be built as a module. If so, the module + will be called i2c-mv64xxx. + endmenu
drivers/i2c/busses/Makefile +1 -0
@@ -20,6 +20,7 @@ obj-$(CONFIG_I2C_IXP4XX) += i2c-ixp4xx.o obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o obj-$(CONFIG_I2C_MPC) += i2c-mpc.o +obj-$(CONFIG_I2C_MV64XXX) += i2c-mv64xxx.o obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o obj-$(CONFIG_I2C_PARPORT) += i2c-parport.o obj-$(CONFIG_I2C_PARPORT_LIGHT) += i2c-parport-light.o
drivers/i2c/busses/i2c-mv64xxx.c new file +550 -0
550 lines not on this page · raw message
drivers/i2c/busses/i2c-mv64xxx.h new file +99 -0
99 lines not on this page · raw message
include/linux/i2c-id.h +4 -0
@@ -200,6 +200,7 @@#define I2C_ALGO_SIBYTE 0x150000/* Broadcom SiByte SOCs */ #define I2C_ALGO_SGI 0x160000/* SGI algorithm */ +#define I2C_ALGO_MV64XXX 0x170000/* Marvell mv64xxx i2c ctlr */ #define I2C_ALGO_EXP 0x800000/* experimental */
@@ -304,5 +305,8 @@/* --- MCP107 adapter */ #define I2C_HW_MPC107 0x00 + +/* --- Marvell mv64xxx i2c adapter */ +#define I2C_HW_MV64XXX 0x00#endif /* LINUX_I2C_ID_H */
include/linux/mv643xx.h +11 -6
@@ -977,12 +977,9 @@/* I2C Registers */ /****************************************/ -#define MV64340_I2C_SLAVE_ADDR 0xc000 -#define MV64340_I2C_EXTENDED_SLAVE_ADDR 0xc010 -#define MV64340_I2C_DATA 0xc004 -#define MV64340_I2C_CONTROL 0xc008 -#define MV64340_I2C_STATUS_BAUDE_RATE 0xc00C -#define MV64340_I2C_SOFT_RESET 0xc01c +#define MV64XXX_I2C_CTLR_NAME "mv64xxx i2c" +#define MV64XXX_I2C_OFFSET 0xc000 +#define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020/****************************************/ /* GPP Interface Registers */
@@ -1083,6 +1080,14 @@u8 brg_can_tune;u8 brg_clk_src; u32 brg_clk_freq; +}; + +/* i2c Platform Device, Driver Data */ +struct mv64xxx_i2c_pdata { +u32 freq_m; +u32 freq_n; +u32 timeout;/* In milliseconds */ +u32 retries; };#endif /* __ASM_MV64340_H */