I2C driver for MPC107/824x/85xx/52xx
Subsystems (2)
PATCH 1/1 I2C driver for MPC107/824x/85xx/52xx
This is the latest version of my driver for the I2C controller in the MPC107 and related chips.
Since last posting the driver has been tested on MPC5200, where it works only when interrupts are disabled. I have positive results for MPC107 and MPC8540. There's also a bug fix in error detection on I2C reads, updated timer handling, and clock initialisation is now done only once.
I plan to send this version to Greg KH unless I hear objections in the next few days.
- Adrian Cox
Humboldt Solutions Ltd.
# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/07/30 15:56:50+01:00 [email protected]
# Fix detection of I2C errors during device address on i2c-mpc.
#
# drivers/i2c/busses/i2c-mpc.c # 2004/07/30 15:56:34+01:00 [email protected] +10 -8 # Fix detection of errors while writing device address. # # ChangeSet # 2004/07/07 13:57:51+01:00 [email protected] # Added 52xx support. # # include/asm-ppc/fsl_ocp.h # 2004/07/07 13:57:41+01:00 [email protected] +1 -1 # Added 52xx support. # # drivers/i2c/busses/i2c-mpc.c # 2004/07/07 13:57:41+01:00 [email protected] +10 -2 # Added 52xx support. # # drivers/i2c/busses/Kconfig # 2004/07/07 13:57:40+01:00 [email protected] +3 -2 # Added 52xx support. # # ChangeSet # 2004/07/01 22:10:01+01:00 [email protected] # Switch to time_after for jiffies calculations # # drivers/i2c/busses/i2c-mpc.c # 2004/07/01 22:09:50+01:00 [email protected] +3 -3 # Switch to time_after for jiffies calculations # # ChangeSet # 2004/07/01 22:04:45+01:00 [email protected] # Switch from readl/writel to readb/writeb for MPC85xx compatibility. # # drivers/i2c/busses/i2c-mpc.c # 2004/07/01 22:04:32+01:00 [email protected] +17 -17 # Switch from readl/writel to readb/writeb for MPC85xx compatibility. # # ChangeSet # 2004/07/01 17:53:05+01:00 [email protected] # Add I2C driver for Motorola I2C # # drivers/i2c/busses/i2c-mpc.c # 2004/07/01 17:52:55+01:00 [email protected] +410 -0 # # drivers/i2c/busses/i2c-mpc.c # 2004/07/01 17:52:55+01:00 [email protected] +0 -0 # BitKeeper file /home/adrian/kernels/sa107-2.6/for-upstream/drivers/i2c/busses/i2c-mpc.c # # drivers/i2c/busses/Makefile # 2004/07/01 17:52:55+01:00 [email protected] +1 -0 # Add I2C driver for Motorola I2C # # drivers/i2c/busses/Kconfig # 2004/07/01 17:52:54+01:00 [email protected] +11 -0 # Add I2C driver for Motorola I2C # diff -Nru a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig --- a/drivers/i2c/busses/Kconfig Fri Jul 30 16:11:48 2004 +++ b/drivers/i2c/busses/Kconfig Fri Jul 30 16:11:48 2004 @@ -396,4 +396,16 @@ This driver can also be built as a module. If so, the module will be called i2c-voodoo3.
+config I2C_MPC
+ tristate "MPC107/824x/85xx/52xx"
+ depends on I2C && FSL_OCP
+ help
+ If you say yes to this option, support will be included for the + built-in I2C interface on the MPC107/Tsi107/MPC8240/MPC8245 and + MPC85xx family processors. The driver may also work on 52xx + family processors, though interrupts are known not to work.
+
+ This driver can also be built as a module. If so, the module
+ will be called i2c-mpc.
+
endmenu
drivers/i2c/busses/Makefile +1 -0
@@ -32,6 +32,7 @@ obj-$(CONFIG_I2C_VOODOO3) += i2c-voodoo3.o obj-$(CONFIG_SCx200_ACB) += scx200_acb.o obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o +obj-$(CONFIG_I2C_MPC) += i2c-mpc.o ifeq ($(CONFIG_I2C_DEBUG_BUS),y) EXTRA_CFLAGS += -DDEBUG
drivers/i2c/busses/i2c-mpc.c new file +420 -0
420 lines not on this page · raw message
include/asm-ppc/fsl_ocp.h +1 -1
@@ -48,7 +48,7 @@/* Flags for I2C */ #define FS_I2C_SEPARATE_DFSRR 0x02 -#define FS_I2C_32BIT 0x01 +#define FS_I2C_CLOCK_5200 0x01#endif /* __ASM_FS_OCP_H__ */ #endif /* __KERNEL__ */
Quoted 10 lines · Adrian Cox
This is the latest version of my driver for the I2C controller in the MPC107 and related chips.
Since last posting the driver has been tested on MPC5200, where it works only when interrupts are disabled. I have positive results for MPC107 and MPC8540. There's also a bug fix in error detection on I2C reads, updated timer handling, and clock initialisation is now done only once.
I plan to send this version to Greg KH unless I hear objections in the next few days.
I'll throw in a nit:
Quoted 1 line
diff -Nru
a/drivers/i2c/busses/i2c-mpc.cb/drivers/i2c/busses/i2c-mpc.c
[snip]
Quoted 4 lines
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
...
This can be condensed down to:
* <YEAR> (c) <COMPANY>. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
Or so our lawyers claim.
[snip]
Quoted 1 line
+#include <
linux/kernel.h>
[snip]
drivers/i2c/busses/i2c-mpc.c line 42
Quoted 5 lines
drivers/i2c/busses/i2c-mpc.c new file +5
-0+#ifdef CONFIG_I2C_DEBUG_BUS +#define DPRINTK(args...) printk(KERN_DEBUG __FILE__": " args) +#else +#define DPRINTK(args...) +#endif
<linux/kernel> provides pr_debug (and a few others) that just depend on DEBUG, fwiw.
And maybe Lindent the sources? :)
But as I said, merely nits.
--
Tom Rini
http://gate.crashing.org/~trini/
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 9 lines · Tom Rini
Quoted 5 lines · Adrian Cox
This is the latest version of my driver for the I2C controller in the MPC107 and related chips.
[...]
I plan to send this version to Greg KH unless I hear objections in the next few days.[nits snipped]
But as I said, merely nits.
Good points. I've fixed all those nits in the version I'm going to submit.
- Adrian Cox
Humboldt Solutions Ltd.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/