aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2008-02-26 14:02:30 -0500
committerTony Lindgren <tony@atomide.com>2008-03-05 03:23:20 -0500
commitcfa9a63a9ad25fd3d3218a4e95f5a93090669f3c (patch)
tree2ce539166306d931a2b774b0c2246939cede17c0 /arch/arm/plat-omap
parent8ba55c5c139f9be26b87d3aab9998f54d8d3057a (diff)
ARM: OMAP: fix omap i2c init (regression)
In mainline, the "old style" I2C registration was only removed for OMAP2, leading to init-time bugs (regressions) like: sysfs: duplicate filename 'i2c_omap.1' can not be created ------------[ cut here ]------------ WARNING: at fs/sysfs/dir.c:424 sysfs_add_one+0x40/0xd4() Modules linked in: ... deletia ... [<c0036a38>] (omap_init_i2c+0x0/0x50) from [<c000cea8>] (omap_init_devices+0x10/0x24) r4:c001e000 [<c000ce98>] (omap_init_devices+0x0/0x24) from [<c0008684>] (do_initcalls+0x78/0x200) ... deletia ... ---[ end trace ca143223eefdc828 ]--- kobject_add_internal failed for i2c_omap.1 with -EEXIST, don't try to register things with the same name in the same directory. The fix is obvious: remove the old init code, it's no longer needed. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/devices.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index c5dab1d6417e..4a53f9ba6c43 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -89,68 +89,6 @@ static inline void omap_init_dsp(void) { }
89#endif /* CONFIG_OMAP_DSP */ 89#endif /* CONFIG_OMAP_DSP */
90 90
91/*-------------------------------------------------------------------------*/ 91/*-------------------------------------------------------------------------*/
92#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
93
94#define OMAP1_I2C_BASE 0xfffb3800
95#define OMAP2_I2C_BASE1 0x48070000
96#define OMAP_I2C_SIZE 0x3f
97#define OMAP1_I2C_INT INT_I2C
98#define OMAP2_I2C_INT1 56
99
100static struct resource i2c_resources1[] = {
101 {
102 .start = 0,
103 .end = 0,
104 .flags = IORESOURCE_MEM,
105 },
106 {
107 .start = 0,
108 .flags = IORESOURCE_IRQ,
109 },
110};
111
112/* DMA not used; works around erratum writing to non-empty i2c fifo */
113
114static struct platform_device omap_i2c_device1 = {
115 .name = "i2c_omap",
116 .id = 1,
117 .num_resources = ARRAY_SIZE(i2c_resources1),
118 .resource = i2c_resources1,
119};
120
121/* See also arch/arm/mach-omap2/devices.c for second I2C on 24xx */
122static void omap_init_i2c(void)
123{
124 if (cpu_is_omap24xx()) {
125 i2c_resources1[0].start = OMAP2_I2C_BASE1;
126 i2c_resources1[0].end = OMAP2_I2C_BASE1 + OMAP_I2C_SIZE;
127 i2c_resources1[1].start = OMAP2_I2C_INT1;
128 } else {
129 i2c_resources1[0].start = OMAP1_I2C_BASE;
130 i2c_resources1[0].end = OMAP1_I2C_BASE + OMAP_I2C_SIZE;
131 i2c_resources1[1].start = OMAP1_I2C_INT;
132 }
133
134 /* FIXME define and use a boot tag, in case of boards that
135 * either don't wire up I2C, or chips that mux it differently...
136 * it can include clocking and address info, maybe more.
137 */
138 if (cpu_is_omap24xx()) {
139 omap_cfg_reg(M19_24XX_I2C1_SCL);
140 omap_cfg_reg(L15_24XX_I2C1_SDA);
141 } else {
142 omap_cfg_reg(I2C_SCL);
143 omap_cfg_reg(I2C_SDA);
144 }
145
146 (void) platform_device_register(&omap_i2c_device1);
147}
148
149#else
150static inline void omap_init_i2c(void) {}
151#endif
152
153/*-------------------------------------------------------------------------*/
154#if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) 92#if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE)
155 93
156static void omap_init_kp(void) 94static void omap_init_kp(void)
@@ -501,7 +439,6 @@ static int __init omap_init_devices(void)
501 * in alphabetical order so they're easier to sort through. 439 * in alphabetical order so they're easier to sort through.
502 */ 440 */
503 omap_init_dsp(); 441 omap_init_dsp();
504 omap_init_i2c();
505 omap_init_kp(); 442 omap_init_kp();
506 omap_init_mmc(); 443 omap_init_mmc();
507 omap_init_uwire(); 444 omap_init_uwire();