[PATCHv2] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers

Previous thread: [PATCHv2] [POWERPC] Add i2c pins to dts and board setup by Jochen Friedrich on Wednesday, May 21, 2008 - 9:37 am. (1 message)

Next thread: [PATCH] Fix Immediate Values x86_64 support old gcc by Mathieu Desnoyers on Wednesday, May 21, 2008 - 10:01 am. (10 messages)
From: Jochen Friedrich
Date: Wednesday, May 21, 2008 - 9:39 am

This driver uses the port of 2.4 code from Vitaly Bordug
<vitb@kernel.crashing.org> and the actual algorithm used by the i2c
driver of the DBox code on cvs.tuxboc.org from Felix Domke
(tmbinc@gmx.net) and Gillem (htoa@gmx.net) converted to an
of_platform_driver. Tested on CPM1 (MPC823 on dbox2 hardware) and
CPM2 (MPC8272).

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
 drivers/i2c/busses/Kconfig   |   10 +
 drivers/i2c/busses/Makefile  |    1 +
 drivers/i2c/busses/i2c-cpm.c |  745 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 756 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/busses/i2c-cpm.c

Changes since last version:
- change bus-frequency -> clock-frequency to comply to OF standard.

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 7112a50..4aeefa6 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -350,6 +350,16 @@ config I2C_BLACKFIN_TWI_CLK_KHZ
 	help
 	  The unit of the TWI clock is kHz.

+config I2C_CPM
+	tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)"
+	depends on (CPM1 || CPM2) && OF_I2C
+	help
+	  This supports the use of the I2C interface on Freescale
+	  processors with CPM1 or CPM2.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-cpm.
+
 config I2C_DAVINCI
 	tristate "DaVinci I2C driver"
 	depends on ARCH_DAVINCI
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index 3c56bd9..bc6fc36 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_I2C_ACORN)		+= i2c-acorn.o
 obj-$(CONFIG_I2C_AT91)		+= i2c-at91.o
 obj-$(CONFIG_I2C_AU1550)	+= i2c-au1550.o
 obj-$(CONFIG_I2C_BLACKFIN_TWI)	+= i2c-bfin-twi.o
+obj-$(CONFIG_I2C_CPM)		+= i2c-cpm.o
 obj-$(CONFIG_I2C_DAVINCI)	+= i2c-davinci.o
 obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
 obj-$(CONFIG_I2C_GPIO)		+= i2c-gpio.o
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
new file mode ...
From: Jean Delvare
Date: Thursday, May 29, 2008 - 8:52 am

Applied, thanks. And thanks a lot to Wolfram for the review :)

-- 
Jean Delvare
--

Previous thread: [PATCHv2] [POWERPC] Add i2c pins to dts and board setup by Jochen Friedrich on Wednesday, May 21, 2008 - 9:37 am. (1 message)

Next thread: [PATCH] Fix Immediate Values x86_64 support old gcc by Mathieu Desnoyers on Wednesday, May 21, 2008 - 10:01 am. (10 messages)