aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/board-h2-mmc.c89
-rw-r--r--arch/arm/mach-omap1/board-h2.c25
-rw-r--r--arch/arm/mach-omap1/board-h3-mmc.c100
-rw-r--r--arch/arm/mach-omap1/board-h3.c10
-rw-r--r--arch/arm/mach-omap1/board-innovator.c50
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c74
-rw-r--r--arch/arm/mach-omap1/board-palmte.c1
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c11
-rw-r--r--arch/arm/mach-omap1/board-sx1-mmc.c80
-rw-r--r--arch/arm/mach-omap1/board-sx1.c10
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c10
-rw-r--r--arch/arm/mach-omap1/clock.h3
-rw-r--r--arch/arm/mach-omap1/devices.c90
13 files changed, 280 insertions, 273 deletions
diff --git a/arch/arm/mach-omap1/board-h2-mmc.c b/arch/arm/mach-omap1/board-h2-mmc.c
index ab9ee5820c48..409fa56d0a87 100644
--- a/arch/arm/mach-omap1/board-h2-mmc.c
+++ b/arch/arm/mach-omap1/board-h2-mmc.c
@@ -12,90 +12,68 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#include <linux/platform_device.h>
16
17#include <linux/i2c/tps65010.h>
18
15#include <mach/mmc.h> 19#include <mach/mmc.h>
16#include <mach/gpio.h> 20#include <mach/gpio.h>
17 21
18#ifdef CONFIG_MMC_OMAP 22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
19static int slot_cover_open;
20static struct device *mmc_device;
21 23
22static int h2_mmc_set_power(struct device *dev, int slot, int power_on, 24static int mmc_set_power(struct device *dev, int slot, int power_on,
23 int vdd) 25 int vdd)
24{ 26{
25#ifdef CONFIG_MMC_DEBUG 27 if (power_on)
26 dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, 28 gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 1);
27 power_on ? "on" : "off", vdd); 29 else
28#endif 30 gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 0);
29 if (slot != 0) {
30 dev_err(dev, "No such slot %d\n", slot + 1);
31 return -ENODEV;
32 }
33 31
34 return 0; 32 return 0;
35} 33}
36 34
37static int h2_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) 35static int mmc_late_init(struct device *dev)
38{ 36{
39#ifdef CONFIG_MMC_DEBUG 37 int ret;
40 dev_dbg(dev, "Set slot %d bus_mode %s\n", slot + 1,
41 bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull");
42#endif
43 if (slot != 0) {
44 dev_err(dev, "No such slot %d\n", slot + 1);
45 return -ENODEV;
46 }
47 38
48 return 0; 39 ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power");
49} 40 if (ret < 0)
41 return ret;
50 42
51static int h2_mmc_get_cover_state(struct device *dev, int slot) 43 gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 0);
52{
53 BUG_ON(slot != 0);
54
55 return slot_cover_open;
56}
57
58void h2_mmc_slot_cover_handler(void *arg, int state)
59{
60 if (mmc_device == NULL)
61 return;
62
63 slot_cover_open = state;
64 omap_mmc_notify_cover_event(mmc_device, 0, state);
65}
66
67static int h2_mmc_late_init(struct device *dev)
68{
69 int ret = 0;
70
71 mmc_device = dev;
72 44
73 return ret; 45 return ret;
74} 46}
75 47
76static void h2_mmc_cleanup(struct device *dev) 48static void mmc_shutdown(struct device *dev)
77{ 49{
50 gpio_free(H2_TPS_GPIO_MMC_PWR_EN);
78} 51}
79 52
80static struct omap_mmc_platform_data h2_mmc_data = { 53/*
54 * H2 could use the following functions tested:
55 * - mmc_get_cover_state that uses OMAP_MPUIO(1)
56 * - mmc_get_wp that uses OMAP_MPUIO(3)
57 */
58static struct omap_mmc_platform_data mmc1_data = {
81 .nr_slots = 1, 59 .nr_slots = 1,
82 .switch_slot = NULL, 60 .init = mmc_late_init,
83 .init = h2_mmc_late_init, 61 .shutdown = mmc_shutdown,
84 .cleanup = h2_mmc_cleanup, 62 .dma_mask = 0xffffffff,
85 .slots[0] = { 63 .slots[0] = {
86 .set_power = h2_mmc_set_power, 64 .set_power = mmc_set_power,
87 .set_bus_mode = h2_mmc_set_bus_mode,
88 .get_ro = NULL,
89 .get_cover_state = h2_mmc_get_cover_state,
90 .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 | 65 .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 |
91 MMC_VDD_32_33 | MMC_VDD_33_34, 66 MMC_VDD_32_33 | MMC_VDD_33_34,
92 .name = "mmcblk", 67 .name = "mmcblk",
93 }, 68 },
94}; 69};
95 70
71static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC];
72
96void __init h2_mmc_init(void) 73void __init h2_mmc_init(void)
97{ 74{
98 omap_set_mmc_info(1, &h2_mmc_data); 75 mmc_data[0] = &mmc1_data;
76 omap1_init_mmc(mmc_data, OMAP16XX_NR_MMC);
99} 77}
100 78
101#else 79#else
@@ -104,7 +82,4 @@ void __init h2_mmc_init(void)
104{ 82{
105} 83}
106 84
107void h2_mmc_slot_cover_handler(void *arg, int state)
108{
109}
110#endif 85#endif
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index c5b4a3b718cf..b240c5f861da 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -345,10 +345,25 @@ static void __init h2_init_smc91x(void)
345 } 345 }
346} 346}
347 347
348static int tps_setup(struct i2c_client *client, void *context)
349{
350 tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V |
351 TPS_LDO1_ENABLE | TPS_VLDO1_3_0V);
352
353 return 0;
354}
355
356static struct tps65010_board tps_board = {
357 .base = H2_TPS_GPIO_BASE,
358 .outmask = 0x0f,
359 .setup = tps_setup,
360};
361
348static struct i2c_board_info __initdata h2_i2c_board_info[] = { 362static struct i2c_board_info __initdata h2_i2c_board_info[] = {
349 { 363 {
350 I2C_BOARD_INFO("tps65010", 0x48), 364 I2C_BOARD_INFO("tps65010", 0x48),
351 .irq = OMAP_GPIO_IRQ(58), 365 .irq = OMAP_GPIO_IRQ(58),
366 .platform_data = &tps_board,
352 }, { 367 }, {
353 I2C_BOARD_INFO("isp1301_omap", 0x2d), 368 I2C_BOARD_INFO("isp1301_omap", 0x2d),
354 .irq = OMAP_GPIO_IRQ(2), 369 .irq = OMAP_GPIO_IRQ(2),
@@ -378,15 +393,6 @@ static struct omap_usb_config h2_usb_config __initdata = {
378 .pins[1] = 3, 393 .pins[1] = 3,
379}; 394};
380 395
381static struct omap_mmc_config h2_mmc_config __initdata = {
382 .mmc[0] = {
383 .enabled = 1,
384 .wire4 = 1,
385 },
386};
387
388extern struct omap_mmc_platform_data h2_mmc_data;
389
390static struct omap_uart_config h2_uart_config __initdata = { 396static struct omap_uart_config h2_uart_config __initdata = {
391 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), 397 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
392}; 398};
@@ -397,7 +403,6 @@ static struct omap_lcd_config h2_lcd_config __initdata = {
397 403
398static struct omap_board_config_kernel h2_config[] __initdata = { 404static struct omap_board_config_kernel h2_config[] __initdata = {
399 { OMAP_TAG_USB, &h2_usb_config }, 405 { OMAP_TAG_USB, &h2_usb_config },
400 { OMAP_TAG_MMC, &h2_mmc_config },
401 { OMAP_TAG_UART, &h2_uart_config }, 406 { OMAP_TAG_UART, &h2_uart_config },
402 { OMAP_TAG_LCD, &h2_lcd_config }, 407 { OMAP_TAG_LCD, &h2_lcd_config },
403}; 408};
diff --git a/arch/arm/mach-omap1/board-h3-mmc.c b/arch/arm/mach-omap1/board-h3-mmc.c
index 36085819098c..fdfe793d56f2 100644
--- a/arch/arm/mach-omap1/board-h3-mmc.c
+++ b/arch/arm/mach-omap1/board-h3-mmc.c
@@ -12,94 +12,55 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#include <linux/platform_device.h>
16
17#include <linux/i2c/tps65010.h>
18
15#include <mach/mmc.h> 19#include <mach/mmc.h>
16#include <mach/gpio.h> 20#include <mach/gpio.h>
17 21
18#ifdef CONFIG_MMC_OMAP 22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
19static int slot_cover_open;
20static struct device *mmc_device;
21 23
22static int h3_mmc_set_power(struct device *dev, int slot, int power_on, 24static int mmc_set_power(struct device *dev, int slot, int power_on,
23 int vdd) 25 int vdd)
24{ 26{
25#ifdef CONFIG_MMC_DEBUG 27 if (power_on)
26 dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, 28 gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 1);
27 power_on ? "on" : "off", vdd); 29 else
28#endif 30 gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 0);
29 if (slot != 0) {
30 dev_err(dev, "No such slot %d\n", slot + 1);
31 return -ENODEV;
32 }
33 31
34 return 0; 32 return 0;
35} 33}
36 34
37static int h3_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) 35/*
38{ 36 * H3 could use the following functions tested:
39 int ret = 0; 37 * - mmc_get_cover_state that uses OMAP_MPUIO(1)
40 38 * - mmc_get_wp that maybe uses OMAP_MPUIO(3)
41#ifdef CONFIG_MMC_DEBUG 39 */
42 dev_dbg(dev, "Set slot %d bus_mode %s\n", slot + 1, 40static struct omap_mmc_platform_data mmc1_data = {
43 bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull");
44#endif
45 if (slot != 0) {
46 dev_err(dev, "No such slot %d\n", slot + 1);
47 return -ENODEV;
48 }
49
50 /* Treated on upper level */
51
52 return bus_mode;
53}
54
55static int h3_mmc_get_cover_state(struct device *dev, int slot)
56{
57 BUG_ON(slot != 0);
58
59 return slot_cover_open;
60}
61
62void h3_mmc_slot_cover_handler(void *arg, int state)
63{
64 if (mmc_device == NULL)
65 return;
66
67 slot_cover_open = state;
68 omap_mmc_notify_cover_event(mmc_device, 0, state);
69}
70
71static int h3_mmc_late_init(struct device *dev)
72{
73 int ret = 0;
74
75 mmc_device = dev;
76
77 return ret;
78}
79
80static void h3_mmc_cleanup(struct device *dev)
81{
82}
83
84static struct omap_mmc_platform_data h3_mmc_data = {
85 .nr_slots = 1, 41 .nr_slots = 1,
86 .switch_slot = NULL, 42 .dma_mask = 0xffffffff,
87 .init = h3_mmc_late_init,
88 .cleanup = h3_mmc_cleanup,
89 .slots[0] = { 43 .slots[0] = {
90 .set_power = h3_mmc_set_power, 44 .set_power = mmc_set_power,
91 .set_bus_mode = h3_mmc_set_bus_mode,
92 .get_ro = NULL,
93 .get_cover_state = h3_mmc_get_cover_state,
94 .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 | 45 .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 |
95 MMC_VDD_32_33 | MMC_VDD_33_34, 46 MMC_VDD_32_33 | MMC_VDD_33_34,
96 .name = "mmcblk", 47 .name = "mmcblk",
97 }, 48 },
98}; 49};
99 50
51static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC];
52
100void __init h3_mmc_init(void) 53void __init h3_mmc_init(void)
101{ 54{
102 omap_set_mmc_info(1, &h3_mmc_data); 55 int ret;
56
57 ret = gpio_request(H3_TPS_GPIO_MMC_PWR_EN, "MMC power");
58 if (ret < 0)
59 return;
60 gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 0);
61
62 mmc_data[0] = &mmc1_data;
63 omap1_init_mmc(mmc_data, OMAP16XX_NR_MMC);
103} 64}
104 65
105#else 66#else
@@ -108,7 +69,4 @@ void __init h3_mmc_init(void)
108{ 69{
109} 70}
110 71
111void h3_mmc_slot_cover_handler(void *arg, int state)
112{
113}
114#endif 72#endif
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 0332203bd53d..5157eea9be35 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -447,15 +447,6 @@ static struct omap_usb_config h3_usb_config __initdata = {
447 .pins[1] = 3, 447 .pins[1] = 3,
448}; 448};
449 449
450static struct omap_mmc_config h3_mmc_config __initdata = {
451 .mmc[0] = {
452 .enabled = 1,
453 .wire4 = 1,
454 },
455};
456
457extern struct omap_mmc_platform_data h3_mmc_data;
458
459static struct omap_uart_config h3_uart_config __initdata = { 450static struct omap_uart_config h3_uart_config __initdata = {
460 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), 451 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
461}; 452};
@@ -466,7 +457,6 @@ static struct omap_lcd_config h3_lcd_config __initdata = {
466 457
467static struct omap_board_config_kernel h3_config[] __initdata = { 458static struct omap_board_config_kernel h3_config[] __initdata = {
468 { OMAP_TAG_USB, &h3_usb_config }, 459 { OMAP_TAG_USB, &h3_usb_config },
469 { OMAP_TAG_MMC, &h3_mmc_config },
470 { OMAP_TAG_UART, &h3_uart_config }, 460 { OMAP_TAG_UART, &h3_uart_config },
471 { OMAP_TAG_LCD, &h3_lcd_config }, 461 { OMAP_TAG_LCD, &h3_lcd_config },
472}; 462};
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index a21e365a7a87..af2fb9070083 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -39,6 +39,7 @@
39#include <mach/common.h> 39#include <mach/common.h>
40#include <mach/mcbsp.h> 40#include <mach/mcbsp.h>
41#include <mach/omap-alsa.h> 41#include <mach/omap-alsa.h>
42#include <mach/mmc.h>
42 43
43static int innovator_keymap[] = { 44static int innovator_keymap[] = {
44 KEY(0, 0, KEY_F1), 45 KEY(0, 0, KEY_F1),
@@ -360,16 +361,49 @@ static struct omap_lcd_config innovator1610_lcd_config __initdata = {
360}; 361};
361#endif 362#endif
362 363
363static struct omap_mmc_config innovator_mmc_config __initdata = { 364#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
364 .mmc [0] = { 365
365 .enabled = 1, 366static int mmc_set_power(struct device *dev, int slot, int power_on,
366 .wire4 = 1, 367 int vdd)
367 .wp_pin = OMAP_MPUIO(3), 368{
368 .power_pin = -1, /* FPGA F3 UIO42 */ 369 if (power_on)
369 .switch_pin = -1, /* FPGA F4 UIO43 */ 370 fpga_write(fpga_read(OMAP1510_FPGA_POWER) | (1 << 3),
371 OMAP1510_FPGA_POWER);
372 else
373 fpga_write(fpga_read(OMAP1510_FPGA_POWER) & ~(1 << 3),
374 OMAP1510_FPGA_POWER);
375
376 return 0;
377}
378
379/*
380 * Innovator could use the following functions tested:
381 * - mmc_get_wp that uses OMAP_MPUIO(3)
382 * - mmc_get_cover_state that uses FPGA F4 UIO43
383 */
384static struct omap_mmc_platform_data mmc1_data = {
385 .nr_slots = 1,
386 .slots[0] = {
387 .set_power = mmc_set_power,
388 .wires = 4,
389 .name = "mmcblk",
370 }, 390 },
371}; 391};
372 392
393static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC];
394
395void __init innovator_mmc_init(void)
396{
397 mmc_data[0] = &mmc1_data;
398 omap1_init_mmc(mmc_data, OMAP15XX_NR_MMC);
399}
400
401#else
402static inline void innovator_mmc_init(void)
403{
404}
405#endif
406
373static struct omap_uart_config innovator_uart_config __initdata = { 407static struct omap_uart_config innovator_uart_config __initdata = {
374 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), 408 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
375}; 409};
@@ -377,7 +411,6 @@ static struct omap_uart_config innovator_uart_config __initdata = {
377static struct omap_board_config_kernel innovator_config[] = { 411static struct omap_board_config_kernel innovator_config[] = {
378 { OMAP_TAG_USB, NULL }, 412 { OMAP_TAG_USB, NULL },
379 { OMAP_TAG_LCD, NULL }, 413 { OMAP_TAG_LCD, NULL },
380 { OMAP_TAG_MMC, &innovator_mmc_config },
381 { OMAP_TAG_UART, &innovator_uart_config }, 414 { OMAP_TAG_UART, &innovator_uart_config },
382}; 415};
383 416
@@ -412,6 +445,7 @@ static void __init innovator_init(void)
412 omap_board_config_size = ARRAY_SIZE(innovator_config); 445 omap_board_config_size = ARRAY_SIZE(innovator_config);
413 omap_serial_init(); 446 omap_serial_init();
414 omap_register_i2c_bus(1, 100, NULL, 0); 447 omap_register_i2c_bus(1, 100, NULL, 0);
448 innovator_mmc_init();
415} 449}
416 450
417static void __init innovator_map_io(void) 451static void __init innovator_map_io(void)
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index b26782471e59..4970c402a594 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -35,6 +35,7 @@
35#include <mach/aic23.h> 35#include <mach/aic23.h>
36#include <mach/omapfb.h> 36#include <mach/omapfb.h>
37#include <mach/lcd_mipid.h> 37#include <mach/lcd_mipid.h>
38#include <mach/mmc.h>
38 39
39#define ADS7846_PENDOWN_GPIO 15 40#define ADS7846_PENDOWN_GPIO 15
40 41
@@ -173,26 +174,68 @@ static struct omap_usb_config nokia770_usb_config __initdata = {
173 .pins[0] = 6, 174 .pins[0] = 6,
174}; 175};
175 176
176static struct omap_mmc_config nokia770_mmc_config __initdata = { 177#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
177 .mmc[0] = { 178
178 .enabled = 0, 179#define NOKIA770_GPIO_MMC_POWER 41
179 .wire4 = 0, 180#define NOKIA770_GPIO_MMC_SWITCH 23
180 .wp_pin = -1, 181
181 .power_pin = -1, 182static int nokia770_mmc_set_power(struct device *dev, int slot, int power_on,
182 .switch_pin = -1, 183 int vdd)
183 }, 184{
184 .mmc[1] = { 185 if (power_on)
185 .enabled = 0, 186 gpio_set_value(NOKIA770_GPIO_MMC_POWER, 1);
186 .wire4 = 0, 187 else
187 .wp_pin = -1, 188 gpio_set_value(NOKIA770_GPIO_MMC_POWER, 0);
188 .power_pin = -1, 189
189 .switch_pin = -1, 190 return 0;
191}
192
193static int nokia770_mmc_get_cover_state(struct device *dev, int slot)
194{
195 return gpio_get_value(NOKIA770_GPIO_MMC_SWITCH);
196}
197
198static struct omap_mmc_platform_data nokia770_mmc2_data = {
199 .nr_slots = 1,
200 .dma_mask = 0xffffffff,
201 .slots[0] = {
202 .set_power = nokia770_mmc_set_power,
203 .get_cover_state = nokia770_mmc_get_cover_state,
204 .name = "mmcblk",
190 }, 205 },
191}; 206};
192 207
208static struct omap_mmc_platform_data *nokia770_mmc_data[OMAP16XX_NR_MMC];
209
210static void __init nokia770_mmc_init(void)
211{
212 int ret;
213
214 ret = gpio_request(NOKIA770_GPIO_MMC_POWER, "MMC power");
215 if (ret < 0)
216 return;
217 gpio_direction_output(NOKIA770_GPIO_MMC_POWER, 0);
218
219 ret = gpio_request(NOKIA770_GPIO_MMC_SWITCH, "MMC cover");
220 if (ret < 0) {
221 gpio_free(NOKIA770_GPIO_MMC_POWER);
222 return;
223 }
224 gpio_direction_input(NOKIA770_GPIO_MMC_SWITCH);
225
226 /* Only the second MMC controller is used */
227 nokia770_mmc_data[1] = &nokia770_mmc2_data;
228 omap1_init_mmc(nokia770_mmc_data, OMAP16XX_NR_MMC);
229}
230
231#else
232static inline void nokia770_mmc_init(void)
233{
234}
235#endif
236
193static struct omap_board_config_kernel nokia770_config[] __initdata = { 237static struct omap_board_config_kernel nokia770_config[] __initdata = {
194 { OMAP_TAG_USB, NULL }, 238 { OMAP_TAG_USB, NULL },
195 { OMAP_TAG_MMC, &nokia770_mmc_config },
196}; 239};
197 240
198#if defined(CONFIG_OMAP_DSP) 241#if defined(CONFIG_OMAP_DSP)
@@ -335,6 +378,7 @@ static void __init omap_nokia770_init(void)
335 omap_dsp_init(); 378 omap_dsp_init();
336 ads7846_dev_init(); 379 ads7846_dev_init();
337 mipid_dev_init(); 380 mipid_dev_init();
381 nokia770_mmc_init();
338} 382}
339 383
340static void __init omap_nokia770_map_io(void) 384static void __init omap_nokia770_map_io(void)
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 4141e3917d7c..75e32d35afd9 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -316,7 +316,6 @@ static void palmte_get_power_status(struct apm_power_info *info, int *battery)
316 316
317static struct omap_board_config_kernel palmte_config[] __initdata = { 317static struct omap_board_config_kernel palmte_config[] __initdata = {
318 { OMAP_TAG_USB, &palmte_usb_config }, 318 { OMAP_TAG_USB, &palmte_usb_config },
319 { OMAP_TAG_MMC, &palmte_mmc_config },
320 { OMAP_TAG_LCD, &palmte_lcd_config }, 319 { OMAP_TAG_LCD, &palmte_lcd_config },
321 { OMAP_TAG_UART, &palmte_uart_config }, 320 { OMAP_TAG_UART, &palmte_uart_config },
322}; 321};
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 801fb5f62ed7..cc05257eb1cd 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -267,16 +267,6 @@ static struct omap_usb_config palmz71_usb_config __initdata = {
267 .pins[0] = 2, 267 .pins[0] = 2,
268}; 268};
269 269
270static struct omap_mmc_config palmz71_mmc_config __initdata = {
271 .mmc[0] = {
272 .enabled = 1,
273 .wire4 = 0,
274 .wp_pin = PALMZ71_MMC_WP_GPIO,
275 .power_pin = -1,
276 .switch_pin = PALMZ71_MMC_IN_GPIO,
277 },
278};
279
280static struct omap_lcd_config palmz71_lcd_config __initdata = { 270static struct omap_lcd_config palmz71_lcd_config __initdata = {
281 .ctrl_name = "internal", 271 .ctrl_name = "internal",
282}; 272};
@@ -287,7 +277,6 @@ static struct omap_uart_config palmz71_uart_config __initdata = {
287 277
288static struct omap_board_config_kernel palmz71_config[] __initdata = { 278static struct omap_board_config_kernel palmz71_config[] __initdata = {
289 {OMAP_TAG_USB, &palmz71_usb_config}, 279 {OMAP_TAG_USB, &palmz71_usb_config},
290 {OMAP_TAG_MMC, &palmz71_mmc_config},
291 {OMAP_TAG_LCD, &palmz71_lcd_config}, 280 {OMAP_TAG_LCD, &palmz71_lcd_config},
292 {OMAP_TAG_UART, &palmz71_uart_config}, 281 {OMAP_TAG_UART, &palmz71_uart_config},
293}; 282};
diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c
index 0be4ebaa2842..66a4d7d5255d 100644
--- a/arch/arm/mach-omap1/board-sx1-mmc.c
+++ b/arch/arm/mach-omap1/board-sx1-mmc.c
@@ -12,30 +12,20 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#include <linux/platform_device.h>
16
15#include <mach/hardware.h> 17#include <mach/hardware.h>
16#include <mach/mmc.h> 18#include <mach/mmc.h>
17#include <mach/gpio.h> 19#include <mach/gpio.h>
18 20
19#ifdef CONFIG_MMC_OMAP 21#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
20static int slot_cover_open;
21static struct device *mmc_device;
22 22
23static int sx1_mmc_set_power(struct device *dev, int slot, int power_on, 23static int mmc_set_power(struct device *dev, int slot, int power_on,
24 int vdd) 24 int vdd)
25{ 25{
26 int err; 26 int err;
27 u8 dat = 0; 27 u8 dat = 0;
28 28
29#ifdef CONFIG_MMC_DEBUG
30 dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1,
31 power_on ? "on" : "off", vdd);
32#endif
33
34 if (slot != 0) {
35 dev_err(dev, "No such slot %d\n", slot + 1);
36 return -ENODEV;
37 }
38
39 err = sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); 29 err = sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat);
40 if (err < 0) 30 if (err < 0)
41 return err; 31 return err;
@@ -48,68 +38,23 @@ static int sx1_mmc_set_power(struct device *dev, int slot, int power_on,
48 return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); 38 return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat);
49} 39}
50 40
51static int sx1_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) 41/* Cover switch is at OMAP_MPUIO(3) */
52{ 42static struct omap_mmc_platform_data mmc1_data = {
53#ifdef CONFIG_MMC_DEBUG
54 dev_dbg(dev, "Set slot %d bus_mode %s\n", slot + 1,
55 bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull");
56#endif
57 if (slot != 0) {
58 dev_err(dev, "No such slot %d\n", slot + 1);
59 return -ENODEV;
60 }
61
62 return 0;
63}
64
65static int sx1_mmc_get_cover_state(struct device *dev, int slot)
66{
67 BUG_ON(slot != 0);
68
69 return slot_cover_open;
70}
71
72void sx1_mmc_slot_cover_handler(void *arg, int state)
73{
74 if (mmc_device == NULL)
75 return;
76
77 slot_cover_open = state;
78 omap_mmc_notify_cover_event(mmc_device, 0, state);
79}
80
81static int sx1_mmc_late_init(struct device *dev)
82{
83 int ret = 0;
84
85 mmc_device = dev;
86
87 return ret;
88}
89
90static void sx1_mmc_cleanup(struct device *dev)
91{
92}
93
94static struct omap_mmc_platform_data sx1_mmc_data = {
95 .nr_slots = 1, 43 .nr_slots = 1,
96 .switch_slot = NULL,
97 .init = sx1_mmc_late_init,
98 .cleanup = sx1_mmc_cleanup,
99 .slots[0] = { 44 .slots[0] = {
100 .set_power = sx1_mmc_set_power, 45 .set_power = mmc_set_power,
101 .set_bus_mode = sx1_mmc_set_bus_mode,
102 .get_ro = NULL,
103 .get_cover_state = sx1_mmc_get_cover_state,
104 .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 | 46 .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 |
105 MMC_VDD_32_33 | MMC_VDD_33_34, 47 MMC_VDD_32_33 | MMC_VDD_33_34,
106 .name = "mmcblk", 48 .name = "mmcblk",
107 }, 49 },
108}; 50};
109 51
52static struct omap_mmc_platform_data *mmc_data[OMAP15XX_NR_MMC];
53
110void __init sx1_mmc_init(void) 54void __init sx1_mmc_init(void)
111{ 55{
112 omap_set_mmc_info(1, &sx1_mmc_data); 56 mmc_data[0] = &mmc1_data;
57 omap1_init_mmc(mmc_data, OMAP15XX_NR_MMC);
113} 58}
114 59
115#else 60#else
@@ -118,7 +63,4 @@ void __init sx1_mmc_init(void)
118{ 63{
119} 64}
120 65
121void sx1_mmc_slot_cover_handler(void *arg, int state)
122{
123}
124#endif 66#endif
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 93bd395b9972..8171fe0ca082 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -378,15 +378,6 @@ static struct omap_usb_config sx1_usb_config __initdata = {
378 .pins[2] = 0, 378 .pins[2] = 0,
379}; 379};
380 380
381/*----------- MMC -------------------------*/
382
383static struct omap_mmc_config sx1_mmc_config __initdata = {
384 .mmc [0] = {
385 .enabled = 1,
386 .wire4 = 0,
387 },
388};
389
390/*----------- LCD -------------------------*/ 381/*----------- LCD -------------------------*/
391 382
392static struct platform_device sx1_lcd_device = { 383static struct platform_device sx1_lcd_device = {
@@ -414,7 +405,6 @@ static struct omap_uart_config sx1_uart_config __initdata = {
414 405
415static struct omap_board_config_kernel sx1_config[] __initdata = { 406static struct omap_board_config_kernel sx1_config[] __initdata = {
416 { OMAP_TAG_USB, &sx1_usb_config }, 407 { OMAP_TAG_USB, &sx1_usb_config },
417 { OMAP_TAG_MMC, &sx1_mmc_config },
418 { OMAP_TAG_LCD, &sx1_lcd_config }, 408 { OMAP_TAG_LCD, &sx1_lcd_config },
419 { OMAP_TAG_UART, &sx1_uart_config }, 409 { OMAP_TAG_UART, &sx1_uart_config },
420}; 410};
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 92c9de1090a9..c224f3c64235 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -15,6 +15,7 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/irq.h>
18#include <linux/init.h> 19#include <linux/init.h>
19#include <linux/kernel.h> 20#include <linux/kernel.h>
20#include <linux/notifier.h> 21#include <linux/notifier.h>
@@ -140,21 +141,12 @@ static struct omap_usb_config voiceblue_usb_config __initdata = {
140 .pins[2] = 6, 141 .pins[2] = 6,
141}; 142};
142 143
143static struct omap_mmc_config voiceblue_mmc_config __initdata = {
144 .mmc[0] = {
145 .enabled = 1,
146 .power_pin = 2,
147 .switch_pin = -1,
148 },
149};
150
151static struct omap_uart_config voiceblue_uart_config __initdata = { 144static struct omap_uart_config voiceblue_uart_config __initdata = {
152 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), 145 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
153}; 146};
154 147
155static struct omap_board_config_kernel voiceblue_config[] = { 148static struct omap_board_config_kernel voiceblue_config[] = {
156 { OMAP_TAG_USB, &voiceblue_usb_config }, 149 { OMAP_TAG_USB, &voiceblue_usb_config },
157 { OMAP_TAG_MMC, &voiceblue_mmc_config },
158 { OMAP_TAG_UART, &voiceblue_uart_config }, 150 { OMAP_TAG_UART, &voiceblue_uart_config },
159}; 151};
160 152
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index 5635b511ab6f..c1dcdf18d8dd 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -705,7 +705,6 @@ static struct clk bclk_16xx = {
705 705
706static struct clk mmc1_ck = { 706static struct clk mmc1_ck = {
707 .name = "mmc_ck", 707 .name = "mmc_ck",
708 .id = 1,
709 /* Functional clock is direct from ULPD, interface clock is ARMPER */ 708 /* Functional clock is direct from ULPD, interface clock is ARMPER */
710 .parent = &armper_ck.clk, 709 .parent = &armper_ck.clk,
711 .rate = 48000000, 710 .rate = 48000000,
@@ -720,7 +719,7 @@ static struct clk mmc1_ck = {
720 719
721static struct clk mmc2_ck = { 720static struct clk mmc2_ck = {
722 .name = "mmc_ck", 721 .name = "mmc_ck",
723 .id = 2, 722 .id = 1,
724 /* Functional clock is direct from ULPD, interface clock is ARMPER */ 723 /* Functional clock is direct from ULPD, interface clock is ARMPER */
725 .parent = &armper_ck.clk, 724 .parent = &armper_ck.clk,
726 .rate = 48000000, 725 .rate = 48000000,
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index e382b438c64e..77382d8b6b2f 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -22,6 +22,7 @@
22#include <mach/board.h> 22#include <mach/board.h>
23#include <mach/mux.h> 23#include <mach/mux.h>
24#include <mach/gpio.h> 24#include <mach/gpio.h>
25#include <mach/mmc.h>
25 26
26/*-------------------------------------------------------------------------*/ 27/*-------------------------------------------------------------------------*/
27 28
@@ -99,6 +100,95 @@ static inline void omap_init_mbox(void)
99static inline void omap_init_mbox(void) { } 100static inline void omap_init_mbox(void) { }
100#endif 101#endif
101 102
103/*-------------------------------------------------------------------------*/
104
105#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
106
107static inline void omap1_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
108 int controller_nr)
109{
110 if (controller_nr == 0) {
111 omap_cfg_reg(MMC_CMD);
112 omap_cfg_reg(MMC_CLK);
113 omap_cfg_reg(MMC_DAT0);
114 if (cpu_is_omap1710()) {
115 omap_cfg_reg(M15_1710_MMC_CLKI);
116 omap_cfg_reg(P19_1710_MMC_CMDDIR);
117 omap_cfg_reg(P20_1710_MMC_DATDIR0);
118 }
119 if (mmc_controller->slots[0].wires == 4) {
120 omap_cfg_reg(MMC_DAT1);
121 /* NOTE: DAT2 can be on W10 (here) or M15 */
122 if (!mmc_controller->slots[0].nomux)
123 omap_cfg_reg(MMC_DAT2);
124 omap_cfg_reg(MMC_DAT3);
125 }
126 }
127
128 /* Block 2 is on newer chips, and has many pinout options */
129 if (cpu_is_omap16xx() && controller_nr == 1) {
130 if (!mmc_controller->slots[1].nomux) {
131 omap_cfg_reg(Y8_1610_MMC2_CMD);
132 omap_cfg_reg(Y10_1610_MMC2_CLK);
133 omap_cfg_reg(R18_1610_MMC2_CLKIN);
134 omap_cfg_reg(W8_1610_MMC2_DAT0);
135 if (mmc_controller->slots[1].wires == 4) {
136 omap_cfg_reg(V8_1610_MMC2_DAT1);
137 omap_cfg_reg(W15_1610_MMC2_DAT2);
138 omap_cfg_reg(R10_1610_MMC2_DAT3);
139 }
140
141 /* These are needed for the level shifter */
142 omap_cfg_reg(V9_1610_MMC2_CMDDIR);
143 omap_cfg_reg(V5_1610_MMC2_DATDIR0);
144 omap_cfg_reg(W19_1610_MMC2_DATDIR1);
145 }
146
147 /* Feedback clock must be set on OMAP-1710 MMC2 */
148 if (cpu_is_omap1710())
149 omap_writel(omap_readl(MOD_CONF_CTRL_1) | (1 << 24),
150 MOD_CONF_CTRL_1);
151 }
152}
153
154void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
155 int nr_controllers)
156{
157 int i;
158
159 for (i = 0; i < nr_controllers; i++) {
160 unsigned long base, size;
161 unsigned int irq = 0;
162
163 if (!mmc_data[i])
164 continue;
165
166 omap1_mmc_mux(mmc_data[i], i);
167
168 switch (i) {
169 case 0:
170 base = OMAP1_MMC1_BASE;
171 irq = INT_MMC;
172 break;
173 case 1:
174 if (!cpu_is_omap16xx())
175 return;
176 base = OMAP1_MMC2_BASE;
177 irq = INT_1610_MMC2;
178 break;
179 default:
180 continue;
181 }
182 size = OMAP1_MMC_SIZE;
183
184 omap_mmc_add(i, base, size, irq, mmc_data[i]);
185 };
186}
187
188#endif
189
190/*-------------------------------------------------------------------------*/
191
102#if defined(CONFIG_OMAP_STI) 192#if defined(CONFIG_OMAP_STI)
103 193
104#define OMAP1_STI_BASE 0xfffea000 194#define OMAP1_STI_BASE 0xfffea000