diff options
Diffstat (limited to 'arch/arm/mach-omap1')
28 files changed, 450 insertions, 412 deletions
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index 79f0b1f8497b..10a301e32434 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig | |||
@@ -4,16 +4,19 @@ comment "OMAP Core Type" | |||
4 | config ARCH_OMAP730 | 4 | config ARCH_OMAP730 |
5 | depends on ARCH_OMAP1 | 5 | depends on ARCH_OMAP1 |
6 | bool "OMAP730 Based System" | 6 | bool "OMAP730 Based System" |
7 | select CPU_ARM926T | ||
7 | select ARCH_OMAP_OTG | 8 | select ARCH_OMAP_OTG |
8 | 9 | ||
9 | config ARCH_OMAP15XX | 10 | config ARCH_OMAP15XX |
10 | depends on ARCH_OMAP1 | 11 | depends on ARCH_OMAP1 |
11 | default y | 12 | default y |
12 | bool "OMAP15xx Based System" | 13 | bool "OMAP15xx Based System" |
14 | select CPU_ARM925T | ||
13 | 15 | ||
14 | config ARCH_OMAP16XX | 16 | config ARCH_OMAP16XX |
15 | depends on ARCH_OMAP1 | 17 | depends on ARCH_OMAP1 |
16 | bool "OMAP16xx Based System" | 18 | bool "OMAP16xx Based System" |
19 | select CPU_ARM926T | ||
17 | select ARCH_OMAP_OTG | 20 | select ARCH_OMAP_OTG |
18 | 21 | ||
19 | comment "OMAP Board Type" | 22 | comment "OMAP Board Type" |
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index db789461fca4..30308294e7c1 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c | |||
@@ -205,7 +205,7 @@ static struct platform_device *devices[] __initdata = { | |||
205 | 205 | ||
206 | static int nand_dev_ready(struct omap_nand_platform_data *data) | 206 | static int nand_dev_ready(struct omap_nand_platform_data *data) |
207 | { | 207 | { |
208 | return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); | 208 | return gpio_get_value(P2_NAND_RB_GPIO_PIN); |
209 | } | 209 | } |
210 | 210 | ||
211 | static struct omap_uart_config fsample_uart_config __initdata = { | 211 | static struct omap_uart_config fsample_uart_config __initdata = { |
@@ -223,8 +223,9 @@ static struct omap_board_config_kernel fsample_config[] = { | |||
223 | 223 | ||
224 | static void __init omap_fsample_init(void) | 224 | static void __init omap_fsample_init(void) |
225 | { | 225 | { |
226 | if (!(omap_request_gpio(P2_NAND_RB_GPIO_PIN))) | 226 | if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) |
227 | nand_data.dev_ready = nand_dev_ready; | 227 | BUG(); |
228 | nand_data.dev_ready = nand_dev_ready; | ||
228 | 229 | ||
229 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 230 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
230 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 231 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |
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) |
19 | static int slot_cover_open; | ||
20 | static struct device *mmc_device; | ||
21 | 23 | ||
22 | static int h2_mmc_set_power(struct device *dev, int slot, int power_on, | 24 | static 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 | ||
37 | static int h2_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) | 35 | static 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 | ||
51 | static 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 | |||
58 | void 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 | |||
67 | static 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 | ||
76 | static void h2_mmc_cleanup(struct device *dev) | 48 | static void mmc_shutdown(struct device *dev) |
77 | { | 49 | { |
50 | gpio_free(H2_TPS_GPIO_MMC_PWR_EN); | ||
78 | } | 51 | } |
79 | 52 | ||
80 | static 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 | */ | ||
58 | static 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 | ||
71 | static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC]; | ||
72 | |||
96 | void __init h2_mmc_init(void) | 73 | void __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 | ||
107 | void 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 3b65914b9141..b240c5f861da 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -250,11 +250,8 @@ static struct platform_device h2_kp_device = { | |||
250 | #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) | 250 | #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) |
251 | static int h2_transceiver_mode(struct device *dev, int state) | 251 | static int h2_transceiver_mode(struct device *dev, int state) |
252 | { | 252 | { |
253 | if (state & IR_SIRMODE) | 253 | /* SIR when low, else MIR/FIR when HIGH */ |
254 | omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 0); | 254 | gpio_set_value(H2_IRDA_FIRSEL_GPIO_PIN, !(state & IR_SIRMODE)); |
255 | else /* MIR/FIR */ | ||
256 | omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 1); | ||
257 | |||
258 | return 0; | 255 | return 0; |
259 | } | 256 | } |
260 | #endif | 257 | #endif |
@@ -342,16 +339,31 @@ static struct platform_device *h2_devices[] __initdata = { | |||
342 | 339 | ||
343 | static void __init h2_init_smc91x(void) | 340 | static void __init h2_init_smc91x(void) |
344 | { | 341 | { |
345 | if ((omap_request_gpio(0)) < 0) { | 342 | if (gpio_request(0, "SMC91x irq") < 0) { |
346 | printk("Error requesting gpio 0 for smc91x irq\n"); | 343 | printk("Error requesting gpio 0 for smc91x irq\n"); |
347 | return; | 344 | return; |
348 | } | 345 | } |
349 | } | 346 | } |
350 | 347 | ||
348 | static 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 | |||
356 | static struct tps65010_board tps_board = { | ||
357 | .base = H2_TPS_GPIO_BASE, | ||
358 | .outmask = 0x0f, | ||
359 | .setup = tps_setup, | ||
360 | }; | ||
361 | |||
351 | static struct i2c_board_info __initdata h2_i2c_board_info[] = { | 362 | static struct i2c_board_info __initdata h2_i2c_board_info[] = { |
352 | { | 363 | { |
353 | I2C_BOARD_INFO("tps65010", 0x48), | 364 | I2C_BOARD_INFO("tps65010", 0x48), |
354 | .irq = OMAP_GPIO_IRQ(58), | 365 | .irq = OMAP_GPIO_IRQ(58), |
366 | .platform_data = &tps_board, | ||
355 | }, { | 367 | }, { |
356 | I2C_BOARD_INFO("isp1301_omap", 0x2d), | 368 | I2C_BOARD_INFO("isp1301_omap", 0x2d), |
357 | .irq = OMAP_GPIO_IRQ(2), | 369 | .irq = OMAP_GPIO_IRQ(2), |
@@ -381,15 +393,6 @@ static struct omap_usb_config h2_usb_config __initdata = { | |||
381 | .pins[1] = 3, | 393 | .pins[1] = 3, |
382 | }; | 394 | }; |
383 | 395 | ||
384 | static struct omap_mmc_config h2_mmc_config __initdata = { | ||
385 | .mmc[0] = { | ||
386 | .enabled = 1, | ||
387 | .wire4 = 1, | ||
388 | }, | ||
389 | }; | ||
390 | |||
391 | extern struct omap_mmc_platform_data h2_mmc_data; | ||
392 | |||
393 | static struct omap_uart_config h2_uart_config __initdata = { | 396 | static struct omap_uart_config h2_uart_config __initdata = { |
394 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), | 397 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), |
395 | }; | 398 | }; |
@@ -400,7 +403,6 @@ static struct omap_lcd_config h2_lcd_config __initdata = { | |||
400 | 403 | ||
401 | static struct omap_board_config_kernel h2_config[] __initdata = { | 404 | static struct omap_board_config_kernel h2_config[] __initdata = { |
402 | { OMAP_TAG_USB, &h2_usb_config }, | 405 | { OMAP_TAG_USB, &h2_usb_config }, |
403 | { OMAP_TAG_MMC, &h2_mmc_config }, | ||
404 | { OMAP_TAG_UART, &h2_uart_config }, | 406 | { OMAP_TAG_UART, &h2_uart_config }, |
405 | { OMAP_TAG_LCD, &h2_lcd_config }, | 407 | { OMAP_TAG_LCD, &h2_lcd_config }, |
406 | }; | 408 | }; |
@@ -409,7 +411,7 @@ static struct omap_board_config_kernel h2_config[] __initdata = { | |||
409 | 411 | ||
410 | static int h2_nand_dev_ready(struct omap_nand_platform_data *data) | 412 | static int h2_nand_dev_ready(struct omap_nand_platform_data *data) |
411 | { | 413 | { |
412 | return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); | 414 | return gpio_get_value(H2_NAND_RB_GPIO_PIN); |
413 | } | 415 | } |
414 | 416 | ||
415 | static void __init h2_init(void) | 417 | static void __init h2_init(void) |
@@ -428,8 +430,9 @@ static void __init h2_init(void) | |||
428 | 430 | ||
429 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; | 431 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; |
430 | h2_nand_resource.end += SZ_4K - 1; | 432 | h2_nand_resource.end += SZ_4K - 1; |
431 | if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) | 433 | if (gpio_request(H2_NAND_RB_GPIO_PIN, "NAND ready") < 0) |
432 | h2_nand_data.dev_ready = h2_nand_dev_ready; | 434 | BUG(); |
435 | gpio_direction_input(H2_NAND_RB_GPIO_PIN); | ||
433 | 436 | ||
434 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 437 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
435 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 438 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |
@@ -441,10 +444,10 @@ static void __init h2_init(void) | |||
441 | /* Irda */ | 444 | /* Irda */ |
442 | #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) | 445 | #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) |
443 | omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A); | 446 | omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A); |
444 | if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) { | 447 | if (gpio_request(H2_IRDA_FIRSEL_GPIO_PIN, "IRDA mode") < 0) |
445 | omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0); | 448 | BUG(); |
446 | h2_irda_data.transceiver_mode = h2_transceiver_mode; | 449 | gpio_direction_output(H2_IRDA_FIRSEL_GPIO_PIN, 0); |
447 | } | 450 | h2_irda_data.transceiver_mode = h2_transceiver_mode; |
448 | #endif | 451 | #endif |
449 | 452 | ||
450 | platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); | 453 | platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); |
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) |
19 | static int slot_cover_open; | ||
20 | static struct device *mmc_device; | ||
21 | 23 | ||
22 | static int h3_mmc_set_power(struct device *dev, int slot, int power_on, | 24 | static 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 | ||
37 | static 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, | 40 | static 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 | |||
55 | static 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 | |||
62 | void 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 | |||
71 | static int h3_mmc_late_init(struct device *dev) | ||
72 | { | ||
73 | int ret = 0; | ||
74 | |||
75 | mmc_device = dev; | ||
76 | |||
77 | return ret; | ||
78 | } | ||
79 | |||
80 | static void h3_mmc_cleanup(struct device *dev) | ||
81 | { | ||
82 | } | ||
83 | |||
84 | static 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 | ||
51 | static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC]; | ||
52 | |||
100 | void __init h3_mmc_init(void) | 53 | void __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 | ||
111 | void 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 adfcd7b51393..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 | ||
450 | static struct omap_mmc_config h3_mmc_config __initdata = { | ||
451 | .mmc[0] = { | ||
452 | .enabled = 1, | ||
453 | .wire4 = 1, | ||
454 | }, | ||
455 | }; | ||
456 | |||
457 | extern struct omap_mmc_platform_data h3_mmc_data; | ||
458 | |||
459 | static struct omap_uart_config h3_uart_config __initdata = { | 450 | static 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 | ||
467 | static struct omap_board_config_kernel h3_config[] __initdata = { | 458 | static 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 | }; |
@@ -498,7 +488,7 @@ static struct omap_gpio_switch h3_gpio_switches[] __initdata = { | |||
498 | 488 | ||
499 | static int nand_dev_ready(struct omap_nand_platform_data *data) | 489 | static int nand_dev_ready(struct omap_nand_platform_data *data) |
500 | { | 490 | { |
501 | return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN); | 491 | return gpio_get_value(H3_NAND_RB_GPIO_PIN); |
502 | } | 492 | } |
503 | 493 | ||
504 | static void __init h3_init(void) | 494 | static void __init h3_init(void) |
@@ -516,8 +506,9 @@ static void __init h3_init(void) | |||
516 | 506 | ||
517 | nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS; | 507 | nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS; |
518 | nand_resource.end += SZ_4K - 1; | 508 | nand_resource.end += SZ_4K - 1; |
519 | if (!(omap_request_gpio(H3_NAND_RB_GPIO_PIN))) | 509 | if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0) |
520 | nand_data.dev_ready = nand_dev_ready; | 510 | BUG(); |
511 | nand_data.dev_ready = nand_dev_ready; | ||
521 | 512 | ||
522 | /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ | 513 | /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ |
523 | /* GPIO10 pullup/down register, Enable pullup on GPIO10 */ | 514 | /* GPIO10 pullup/down register, Enable pullup on GPIO10 */ |
@@ -537,7 +528,7 @@ static void __init h3_init(void) | |||
537 | static void __init h3_init_smc91x(void) | 528 | static void __init h3_init_smc91x(void) |
538 | { | 529 | { |
539 | omap_cfg_reg(W15_1710_GPIO40); | 530 | omap_cfg_reg(W15_1710_GPIO40); |
540 | if (omap_request_gpio(40) < 0) { | 531 | if (gpio_request(40, "SMC91x irq") < 0) { |
541 | printk("Error requesting gpio 40 for smc91x irq\n"); | 532 | printk("Error requesting gpio 40 for smc91x irq\n"); |
542 | return; | 533 | return; |
543 | } | 534 | } |
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c index cbc11be5cd2a..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 | ||
43 | static int innovator_keymap[] = { | 44 | static int innovator_keymap[] = { |
44 | KEY(0, 0, KEY_F1), | 45 | KEY(0, 0, KEY_F1), |
@@ -301,7 +302,7 @@ static void __init innovator_init_smc91x(void) | |||
301 | OMAP1510_FPGA_RST); | 302 | OMAP1510_FPGA_RST); |
302 | udelay(750); | 303 | udelay(750); |
303 | } else { | 304 | } else { |
304 | if ((omap_request_gpio(0)) < 0) { | 305 | if (gpio_request(0, "SMC91x irq") < 0) { |
305 | printk("Error requesting gpio 0 for smc91x irq\n"); | 306 | printk("Error requesting gpio 0 for smc91x irq\n"); |
306 | return; | 307 | return; |
307 | } | 308 | } |
@@ -360,16 +361,49 @@ static struct omap_lcd_config innovator1610_lcd_config __initdata = { | |||
360 | }; | 361 | }; |
361 | #endif | 362 | #endif |
362 | 363 | ||
363 | static 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, | 366 | static 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 | */ | ||
384 | static 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 | ||
393 | static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC]; | ||
394 | |||
395 | void __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 | ||
402 | static inline void innovator_mmc_init(void) | ||
403 | { | ||
404 | } | ||
405 | #endif | ||
406 | |||
373 | static struct omap_uart_config innovator_uart_config __initdata = { | 407 | static 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 = { | |||
377 | static struct omap_board_config_kernel innovator_config[] = { | 411 | static 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 | ||
417 | static void __init innovator_map_io(void) | 451 | static 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 38d9783ac6d6..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 | ||
@@ -102,7 +103,7 @@ static void mipid_shutdown(struct mipid_platform_data *pdata) | |||
102 | { | 103 | { |
103 | if (pdata->nreset_gpio != -1) { | 104 | if (pdata->nreset_gpio != -1) { |
104 | printk(KERN_INFO "shutdown LCD\n"); | 105 | printk(KERN_INFO "shutdown LCD\n"); |
105 | omap_set_gpio_dataout(pdata->nreset_gpio, 0); | 106 | gpio_set_value(pdata->nreset_gpio, 0); |
106 | msleep(120); | 107 | msleep(120); |
107 | } | 108 | } |
108 | } | 109 | } |
@@ -124,13 +125,13 @@ static void mipid_dev_init(void) | |||
124 | 125 | ||
125 | static void ads7846_dev_init(void) | 126 | static void ads7846_dev_init(void) |
126 | { | 127 | { |
127 | if (omap_request_gpio(ADS7846_PENDOWN_GPIO) < 0) | 128 | if (gpio_request(ADS7846_PENDOWN_GPIO, "ADS7846 pendown") < 0) |
128 | printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); | 129 | printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); |
129 | } | 130 | } |
130 | 131 | ||
131 | static int ads7846_get_pendown_state(void) | 132 | static int ads7846_get_pendown_state(void) |
132 | { | 133 | { |
133 | return !omap_get_gpio_datain(ADS7846_PENDOWN_GPIO); | 134 | return !gpio_get_value(ADS7846_PENDOWN_GPIO); |
134 | } | 135 | } |
135 | 136 | ||
136 | static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { | 137 | static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { |
@@ -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 | ||
176 | static 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, | 182 | static 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 | |||
193 | static int nokia770_mmc_get_cover_state(struct device *dev, int slot) | ||
194 | { | ||
195 | return gpio_get_value(NOKIA770_GPIO_MMC_SWITCH); | ||
196 | } | ||
197 | |||
198 | static 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 | ||
208 | static struct omap_mmc_platform_data *nokia770_mmc_data[OMAP16XX_NR_MMC]; | ||
209 | |||
210 | static 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 | ||
232 | static inline void nokia770_mmc_init(void) | ||
233 | { | ||
234 | } | ||
235 | #endif | ||
236 | |||
193 | static struct omap_board_config_kernel nokia770_config[] __initdata = { | 237 | static 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) |
@@ -228,9 +271,9 @@ static void nokia770_audio_pwr_up(void) | |||
228 | /* Turn on codec */ | 271 | /* Turn on codec */ |
229 | aic23_power_up(); | 272 | aic23_power_up(); |
230 | 273 | ||
231 | if (omap_get_gpio_datain(HEADPHONE_GPIO)) | 274 | if (gpio_get_value(HEADPHONE_GPIO)) |
232 | /* HP not connected, turn on amplifier */ | 275 | /* HP not connected, turn on amplifier */ |
233 | omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 1); | 276 | gpio_set_value(AMPLIFIER_CTRL_GPIO, 1); |
234 | else | 277 | else |
235 | /* HP connected, do not turn on amplifier */ | 278 | /* HP connected, do not turn on amplifier */ |
236 | printk("HP connected\n"); | 279 | printk("HP connected\n"); |
@@ -250,7 +293,7 @@ static DECLARE_DELAYED_WORK(codec_power_down_work, codec_delayed_power_down); | |||
250 | static void nokia770_audio_pwr_down(void) | 293 | static void nokia770_audio_pwr_down(void) |
251 | { | 294 | { |
252 | /* Turn off amplifier */ | 295 | /* Turn off amplifier */ |
253 | omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 0); | 296 | gpio_set_value(AMPLIFIER_CTRL_GPIO, 0); |
254 | 297 | ||
255 | /* Turn off codec: schedule delayed work */ | 298 | /* Turn off codec: schedule delayed work */ |
256 | schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */ | 299 | schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */ |
@@ -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 | ||
340 | static void __init omap_nokia770_map_io(void) | 384 | static void __init omap_nokia770_map_io(void) |
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index 3e766e49f7cc..ff9e67baa5c9 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c | |||
@@ -188,7 +188,8 @@ static struct gpio_led tps_leds[] = { | |||
188 | /* NOTE: D9 and D2 have hardware blink support. | 188 | /* NOTE: D9 and D2 have hardware blink support. |
189 | * Also, D9 requires non-battery power. | 189 | * Also, D9 requires non-battery power. |
190 | */ | 190 | */ |
191 | { .gpio = OSK_TPS_GPIO_LED_D9, .name = "d9", }, | 191 | { .gpio = OSK_TPS_GPIO_LED_D9, .name = "d9", |
192 | .default_trigger = "ide-disk", }, | ||
192 | { .gpio = OSK_TPS_GPIO_LED_D2, .name = "d2", }, | 193 | { .gpio = OSK_TPS_GPIO_LED_D2, .name = "d2", }, |
193 | { .gpio = OSK_TPS_GPIO_LED_D3, .name = "d3", .active_low = 1, | 194 | { .gpio = OSK_TPS_GPIO_LED_D3, .name = "d3", .active_low = 1, |
194 | .default_trigger = "heartbeat", }, | 195 | .default_trigger = "heartbeat", }, |
@@ -260,7 +261,6 @@ static struct i2c_board_info __initdata osk_i2c_board_info[] = { | |||
260 | }, | 261 | }, |
261 | /* TODO when driver support is ready: | 262 | /* TODO when driver support is ready: |
262 | * - aic23 audio chip at 0x1a | 263 | * - aic23 audio chip at 0x1a |
263 | * - on Mistral, 24c04 eeprom at 0x50 | ||
264 | * - optionally on Mistral, ov9640 camera sensor at 0x30 | 264 | * - optionally on Mistral, ov9640 camera sensor at 0x30 |
265 | */ | 265 | */ |
266 | }; | 266 | }; |
@@ -288,7 +288,7 @@ static void __init osk_init_cf(void) | |||
288 | return; | 288 | return; |
289 | } | 289 | } |
290 | /* the CF I/O IRQ is really active-low */ | 290 | /* the CF I/O IRQ is really active-low */ |
291 | set_irq_type(OMAP_GPIO_IRQ(62), IRQ_TYPE_EDGE_FALLING); | 291 | set_irq_type(gpio_to_irq(62), IRQ_TYPE_EDGE_FALLING); |
292 | } | 292 | } |
293 | 293 | ||
294 | static void __init osk_init_irq(void) | 294 | static void __init osk_init_irq(void) |
@@ -337,11 +337,28 @@ static struct omap_board_config_kernel osk_config[] __initdata = { | |||
337 | #ifdef CONFIG_OMAP_OSK_MISTRAL | 337 | #ifdef CONFIG_OMAP_OSK_MISTRAL |
338 | 338 | ||
339 | #include <linux/input.h> | 339 | #include <linux/input.h> |
340 | #include <linux/i2c/at24.h> | ||
340 | #include <linux/spi/spi.h> | 341 | #include <linux/spi/spi.h> |
341 | #include <linux/spi/ads7846.h> | 342 | #include <linux/spi/ads7846.h> |
342 | 343 | ||
343 | #include <mach/keypad.h> | 344 | #include <mach/keypad.h> |
344 | 345 | ||
346 | static struct at24_platform_data at24c04 = { | ||
347 | .byte_len = SZ_4K / 8, | ||
348 | .page_size = 16, | ||
349 | }; | ||
350 | |||
351 | static struct i2c_board_info __initdata mistral_i2c_board_info[] = { | ||
352 | { | ||
353 | /* NOTE: powered from LCD supply */ | ||
354 | I2C_BOARD_INFO("24c04", 0x50), | ||
355 | .platform_data = &at24c04, | ||
356 | }, | ||
357 | /* TODO when driver support is ready: | ||
358 | * - optionally ov9640 camera sensor at 0x30 | ||
359 | */ | ||
360 | }; | ||
361 | |||
345 | static const int osk_keymap[] = { | 362 | static const int osk_keymap[] = { |
346 | /* KEY(col, row, code) */ | 363 | /* KEY(col, row, code) */ |
347 | KEY(0, 0, KEY_F1), /* SW4 */ | 364 | KEY(0, 0, KEY_F1), /* SW4 */ |
@@ -483,23 +500,30 @@ static void __init osk_mistral_init(void) | |||
483 | omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */ | 500 | omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */ |
484 | gpio_request(4, "ts_int"); | 501 | gpio_request(4, "ts_int"); |
485 | gpio_direction_input(4); | 502 | gpio_direction_input(4); |
486 | set_irq_type(OMAP_GPIO_IRQ(4), IRQ_TYPE_EDGE_FALLING); | 503 | set_irq_type(gpio_to_irq(4), IRQ_TYPE_EDGE_FALLING); |
487 | 504 | ||
488 | spi_register_board_info(mistral_boardinfo, | 505 | spi_register_board_info(mistral_boardinfo, |
489 | ARRAY_SIZE(mistral_boardinfo)); | 506 | ARRAY_SIZE(mistral_boardinfo)); |
490 | 507 | ||
491 | /* the sideways button (SW1) is for use as a "wakeup" button */ | 508 | /* the sideways button (SW1) is for use as a "wakeup" button |
509 | * | ||
510 | * NOTE: The Mistral board has the wakeup button (SW1) wired | ||
511 | * to the LCD 3.3V rail, which is powered down during suspend. | ||
512 | * To allow this button to wake up the omap, work around this | ||
513 | * HW bug by rewiring SW1 to use the main 3.3V rail. | ||
514 | */ | ||
492 | omap_cfg_reg(N15_1610_MPUIO2); | 515 | omap_cfg_reg(N15_1610_MPUIO2); |
493 | if (gpio_request(OMAP_MPUIO(2), "wakeup") == 0) { | 516 | if (gpio_request(OMAP_MPUIO(2), "wakeup") == 0) { |
494 | int ret = 0; | 517 | int ret = 0; |
518 | int irq = gpio_to_irq(OMAP_MPUIO(2)); | ||
495 | 519 | ||
496 | gpio_direction_input(OMAP_MPUIO(2)); | 520 | gpio_direction_input(OMAP_MPUIO(2)); |
497 | set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQ_TYPE_EDGE_RISING); | 521 | set_irq_type(irq, IRQ_TYPE_EDGE_RISING); |
498 | #ifdef CONFIG_PM | 522 | #ifdef CONFIG_PM |
499 | /* share the IRQ in case someone wants to use the | 523 | /* share the IRQ in case someone wants to use the |
500 | * button for more than wakeup from system sleep. | 524 | * button for more than wakeup from system sleep. |
501 | */ | 525 | */ |
502 | ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), | 526 | ret = request_irq(irq, |
503 | &osk_mistral_wake_interrupt, | 527 | &osk_mistral_wake_interrupt, |
504 | IRQF_SHARED, "mistral_wakeup", | 528 | IRQF_SHARED, "mistral_wakeup", |
505 | &osk_mistral_wake_interrupt); | 529 | &osk_mistral_wake_interrupt); |
@@ -508,7 +532,7 @@ static void __init osk_mistral_init(void) | |||
508 | printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n", | 532 | printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n", |
509 | ret); | 533 | ret); |
510 | } else | 534 | } else |
511 | enable_irq_wake(OMAP_GPIO_IRQ(OMAP_MPUIO(2))); | 535 | enable_irq_wake(irq); |
512 | #endif | 536 | #endif |
513 | } else | 537 | } else |
514 | printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n"); | 538 | printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n"); |
@@ -520,6 +544,9 @@ static void __init osk_mistral_init(void) | |||
520 | if (gpio_request(2, "lcd_pwr") == 0) | 544 | if (gpio_request(2, "lcd_pwr") == 0) |
521 | gpio_direction_output(2, 1); | 545 | gpio_direction_output(2, 1); |
522 | 546 | ||
547 | i2c_register_board_info(1, mistral_i2c_board_info, | ||
548 | ARRAY_SIZE(mistral_i2c_board_info)); | ||
549 | |||
523 | platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices)); | 550 | platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices)); |
524 | } | 551 | } |
525 | #else | 552 | #else |
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c index b58043644a6f..75e32d35afd9 100644 --- a/arch/arm/mach-omap1/board-palmte.c +++ b/arch/arm/mach-omap1/board-palmte.c | |||
@@ -255,7 +255,7 @@ static void palmte_get_power_status(struct apm_power_info *info, int *battery) | |||
255 | { | 255 | { |
256 | int charging, batt, hi, lo, mid; | 256 | int charging, batt, hi, lo, mid; |
257 | 257 | ||
258 | charging = !omap_get_gpio_datain(PALMTE_DC_GPIO); | 258 | charging = !gpio_get_value(PALMTE_DC_GPIO); |
259 | batt = battery[0]; | 259 | batt = battery[0]; |
260 | if (charging) | 260 | if (charging) |
261 | batt -= 60; | 261 | batt -= 60; |
@@ -316,7 +316,6 @@ static void palmte_get_power_status(struct apm_power_info *info, int *battery) | |||
316 | 316 | ||
317 | static struct omap_board_config_kernel palmte_config[] __initdata = { | 317 | static 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 | }; |
@@ -335,11 +334,11 @@ static void palmte_headphones_detect(void *data, int state) | |||
335 | { | 334 | { |
336 | if (state) { | 335 | if (state) { |
337 | /* Headphones connected, disable speaker */ | 336 | /* Headphones connected, disable speaker */ |
338 | omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 0); | 337 | gpio_set_value(PALMTE_SPEAKER_GPIO, 0); |
339 | printk(KERN_INFO "PM: speaker off\n"); | 338 | printk(KERN_INFO "PM: speaker off\n"); |
340 | } else { | 339 | } else { |
341 | /* Headphones unplugged, re-enable speaker */ | 340 | /* Headphones unplugged, re-enable speaker */ |
342 | omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 1); | 341 | gpio_set_value(PALMTE_SPEAKER_GPIO, 1); |
343 | printk(KERN_INFO "PM: speaker on\n"); | 342 | printk(KERN_INFO "PM: speaker on\n"); |
344 | } | 343 | } |
345 | } | 344 | } |
@@ -347,18 +346,18 @@ static void palmte_headphones_detect(void *data, int state) | |||
347 | static void __init palmte_misc_gpio_setup(void) | 346 | static void __init palmte_misc_gpio_setup(void) |
348 | { | 347 | { |
349 | /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */ | 348 | /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */ |
350 | if (omap_request_gpio(PALMTE_PINTDAV_GPIO)) { | 349 | if (gpio_request(PALMTE_PINTDAV_GPIO, "TSC2102 PINTDAV") < 0) { |
351 | printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n"); | 350 | printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n"); |
352 | return; | 351 | return; |
353 | } | 352 | } |
354 | omap_set_gpio_direction(PALMTE_PINTDAV_GPIO, 1); | 353 | gpio_direction_input(PALMTE_PINTDAV_GPIO); |
355 | 354 | ||
356 | /* Set USB-or-DC-IN pin as input (unused) */ | 355 | /* Set USB-or-DC-IN pin as input (unused) */ |
357 | if (omap_request_gpio(PALMTE_USB_OR_DC_GPIO)) { | 356 | if (gpio_request(PALMTE_USB_OR_DC_GPIO, "USB/DC-IN") < 0) { |
358 | printk(KERN_ERR "Could not reserve cable signal GPIO!\n"); | 357 | printk(KERN_ERR "Could not reserve cable signal GPIO!\n"); |
359 | return; | 358 | return; |
360 | } | 359 | } |
361 | omap_set_gpio_direction(PALMTE_USB_OR_DC_GPIO, 1); | 360 | gpio_direction_input(PALMTE_USB_OR_DC_GPIO); |
362 | } | 361 | } |
363 | 362 | ||
364 | static void __init omap_palmte_init(void) | 363 | static void __init omap_palmte_init(void) |
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c index 40f9860a09df..5c001afe8062 100644 --- a/arch/arm/mach-omap1/board-palmtt.c +++ b/arch/arm/mach-omap1/board-palmtt.c | |||
@@ -268,7 +268,7 @@ static struct platform_device *palmtt_devices[] __initdata = { | |||
268 | 268 | ||
269 | static int palmtt_get_pendown_state(void) | 269 | static int palmtt_get_pendown_state(void) |
270 | { | 270 | { |
271 | return !omap_get_gpio_datain(6); | 271 | return !gpio_get_value(6); |
272 | } | 272 | } |
273 | 273 | ||
274 | static const struct ads7846_platform_data palmtt_ts_info = { | 274 | static const struct ads7846_platform_data palmtt_ts_info = { |
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c index e719294250b1..cc05257eb1cd 100644 --- a/arch/arm/mach-omap1/board-palmz71.c +++ b/arch/arm/mach-omap1/board-palmz71.c | |||
@@ -239,7 +239,7 @@ static struct platform_device *devices[] __initdata = { | |||
239 | static int | 239 | static int |
240 | palmz71_get_pendown_state(void) | 240 | palmz71_get_pendown_state(void) |
241 | { | 241 | { |
242 | return !omap_get_gpio_datain(PALMZ71_PENIRQ_GPIO); | 242 | return !gpio_get_value(PALMZ71_PENIRQ_GPIO); |
243 | } | 243 | } |
244 | 244 | ||
245 | static const struct ads7846_platform_data palmz71_ts_info = { | 245 | static const struct ads7846_platform_data palmz71_ts_info = { |
@@ -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 | ||
270 | static 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 | |||
280 | static struct omap_lcd_config palmz71_lcd_config __initdata = { | 270 | static 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 | ||
288 | static struct omap_board_config_kernel palmz71_config[] __initdata = { | 278 | static 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 | }; |
@@ -295,13 +284,13 @@ static struct omap_board_config_kernel palmz71_config[] __initdata = { | |||
295 | static irqreturn_t | 284 | static irqreturn_t |
296 | palmz71_powercable(int irq, void *dev_id) | 285 | palmz71_powercable(int irq, void *dev_id) |
297 | { | 286 | { |
298 | if (omap_get_gpio_datain(PALMZ71_USBDETECT_GPIO)) { | 287 | if (gpio_get_value(PALMZ71_USBDETECT_GPIO)) { |
299 | printk(KERN_INFO "PM: Power cable connected\n"); | 288 | printk(KERN_INFO "PM: Power cable connected\n"); |
300 | set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), | 289 | set_irq_type(gpio_to_irq(PALMZ71_USBDETECT_GPIO), |
301 | IRQ_TYPE_EDGE_FALLING); | 290 | IRQ_TYPE_EDGE_FALLING); |
302 | } else { | 291 | } else { |
303 | printk(KERN_INFO "PM: Power cable disconnected\n"); | 292 | printk(KERN_INFO "PM: Power cable disconnected\n"); |
304 | set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), | 293 | set_irq_type(gpio_to_irq(PALMZ71_USBDETECT_GPIO), |
305 | IRQ_TYPE_EDGE_RISING); | 294 | IRQ_TYPE_EDGE_RISING); |
306 | } | 295 | } |
307 | return IRQ_HANDLED; | 296 | return IRQ_HANDLED; |
@@ -323,29 +312,28 @@ palmz71_gpio_setup(int early) | |||
323 | { | 312 | { |
324 | if (early) { | 313 | if (early) { |
325 | /* Only set GPIO1 so we have a working serial */ | 314 | /* Only set GPIO1 so we have a working serial */ |
326 | omap_set_gpio_dataout(1, 1); | 315 | gpio_direction_output(1, 1); |
327 | omap_set_gpio_direction(1, 0); | ||
328 | } else { | 316 | } else { |
329 | /* Set MMC/SD host WP pin as input */ | 317 | /* Set MMC/SD host WP pin as input */ |
330 | if (omap_request_gpio(PALMZ71_MMC_WP_GPIO)) { | 318 | if (gpio_request(PALMZ71_MMC_WP_GPIO, "MMC WP") < 0) { |
331 | printk(KERN_ERR "Could not reserve WP GPIO!\n"); | 319 | printk(KERN_ERR "Could not reserve WP GPIO!\n"); |
332 | return; | 320 | return; |
333 | } | 321 | } |
334 | omap_set_gpio_direction(PALMZ71_MMC_WP_GPIO, 1); | 322 | gpio_direction_input(PALMZ71_MMC_WP_GPIO); |
335 | 323 | ||
336 | /* Monitor the Power-cable-connected signal */ | 324 | /* Monitor the Power-cable-connected signal */ |
337 | if (omap_request_gpio(PALMZ71_USBDETECT_GPIO)) { | 325 | if (gpio_request(PALMZ71_USBDETECT_GPIO, "USB detect") < 0) { |
338 | printk(KERN_ERR | 326 | printk(KERN_ERR |
339 | "Could not reserve cable signal GPIO!\n"); | 327 | "Could not reserve cable signal GPIO!\n"); |
340 | return; | 328 | return; |
341 | } | 329 | } |
342 | omap_set_gpio_direction(PALMZ71_USBDETECT_GPIO, 1); | 330 | gpio_direction_input(PALMZ71_USBDETECT_GPIO); |
343 | if (request_irq(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), | 331 | if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO), |
344 | palmz71_powercable, IRQF_SAMPLE_RANDOM, | 332 | palmz71_powercable, IRQF_SAMPLE_RANDOM, |
345 | "palmz71-cable", 0)) | 333 | "palmz71-cable", 0)) |
346 | printk(KERN_ERR | 334 | printk(KERN_ERR |
347 | "IRQ request for power cable failed!\n"); | 335 | "IRQ request for power cable failed!\n"); |
348 | palmz71_powercable(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 0); | 336 | palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 0); |
349 | } | 337 | } |
350 | } | 338 | } |
351 | 339 | ||
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c index b715917bfdaf..3b9f907aa899 100644 --- a/arch/arm/mach-omap1/board-perseus2.c +++ b/arch/arm/mach-omap1/board-perseus2.c | |||
@@ -205,7 +205,7 @@ static struct platform_device *devices[] __initdata = { | |||
205 | 205 | ||
206 | static int nand_dev_ready(struct omap_nand_platform_data *data) | 206 | static int nand_dev_ready(struct omap_nand_platform_data *data) |
207 | { | 207 | { |
208 | return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); | 208 | return gpio_get_value(P2_NAND_RB_GPIO_PIN); |
209 | } | 209 | } |
210 | 210 | ||
211 | static struct omap_uart_config perseus2_uart_config __initdata = { | 211 | static struct omap_uart_config perseus2_uart_config __initdata = { |
@@ -223,8 +223,9 @@ static struct omap_board_config_kernel perseus2_config[] __initdata = { | |||
223 | 223 | ||
224 | static void __init omap_perseus2_init(void) | 224 | static void __init omap_perseus2_init(void) |
225 | { | 225 | { |
226 | if (!(omap_request_gpio(P2_NAND_RB_GPIO_PIN))) | 226 | if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) |
227 | nand_data.dev_ready = nand_dev_ready; | 227 | BUG(); |
228 | nand_data.dev_ready = nand_dev_ready; | ||
228 | 229 | ||
229 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 230 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
230 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 231 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |
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) |
20 | static int slot_cover_open; | ||
21 | static struct device *mmc_device; | ||
22 | 22 | ||
23 | static int sx1_mmc_set_power(struct device *dev, int slot, int power_on, | 23 | static 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 | ||
51 | static int sx1_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) | 41 | /* Cover switch is at OMAP_MPUIO(3) */ |
52 | { | 42 | static 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 | |||
65 | static 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 | |||
72 | void 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 | |||
81 | static int sx1_mmc_late_init(struct device *dev) | ||
82 | { | ||
83 | int ret = 0; | ||
84 | |||
85 | mmc_device = dev; | ||
86 | |||
87 | return ret; | ||
88 | } | ||
89 | |||
90 | static void sx1_mmc_cleanup(struct device *dev) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | static 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 | ||
52 | static struct omap_mmc_platform_data *mmc_data[OMAP15XX_NR_MMC]; | ||
53 | |||
110 | void __init sx1_mmc_init(void) | 54 | void __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 | ||
121 | void 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 130bcc6fd082..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 | |||
383 | static 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 | ||
392 | static struct platform_device sx1_lcd_device = { | 383 | static struct platform_device sx1_lcd_device = { |
@@ -414,7 +405,6 @@ static struct omap_uart_config sx1_uart_config __initdata = { | |||
414 | 405 | ||
415 | static struct omap_board_config_kernel sx1_config[] __initdata = { | 406 | static 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 | }; |
@@ -436,14 +426,9 @@ static void __init omap_sx1_init(void) | |||
436 | omap_request_gpio(1); /* A_IRDA_OFF */ | 426 | omap_request_gpio(1); /* A_IRDA_OFF */ |
437 | omap_request_gpio(11); /* A_SWITCH */ | 427 | omap_request_gpio(11); /* A_SWITCH */ |
438 | omap_request_gpio(15); /* A_USB_ON */ | 428 | omap_request_gpio(15); /* A_USB_ON */ |
439 | omap_set_gpio_direction(1, 0);/* gpio1 -> output */ | 429 | gpio_direction_output(1, 1); /*A_IRDA_OFF = 1 */ |
440 | omap_set_gpio_direction(11, 0);/* gpio11 -> output */ | 430 | gpio_direction_output(11, 0); /*A_SWITCH = 0 */ |
441 | omap_set_gpio_direction(15, 0);/* gpio15 -> output */ | 431 | gpio_direction_output(15, 0); /*A_USB_ON = 0 */ |
442 | /* set GPIO data */ | ||
443 | omap_set_gpio_dataout(1, 1);/*A_IRDA_OFF = 1 */ | ||
444 | omap_set_gpio_dataout(11, 0);/*A_SWITCH = 0 */ | ||
445 | omap_set_gpio_dataout(15, 0);/*A_USB_ON = 0 */ | ||
446 | |||
447 | } | 432 | } |
448 | /*----------------------------------------*/ | 433 | /*----------------------------------------*/ |
449 | static void __init omap_sx1_init_irq(void) | 434 | static void __init omap_sx1_init_irq(void) |
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c index 45a01311669a..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 | ||
143 | static 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 | |||
151 | static struct omap_uart_config voiceblue_uart_config __initdata = { | 144 | static 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 | ||
155 | static struct omap_board_config_kernel voiceblue_config[] = { | 148 | static 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 | ||
@@ -168,29 +160,27 @@ static void __init voiceblue_init_irq(void) | |||
168 | static void __init voiceblue_init(void) | 160 | static void __init voiceblue_init(void) |
169 | { | 161 | { |
170 | /* Watchdog */ | 162 | /* Watchdog */ |
171 | omap_request_gpio(0); | 163 | gpio_request(0, "Watchdog"); |
172 | /* smc91x reset */ | 164 | /* smc91x reset */ |
173 | omap_request_gpio(7); | 165 | gpio_request(7, "SMC91x reset"); |
174 | omap_set_gpio_direction(7, 0); | 166 | gpio_direction_output(7, 1); |
175 | omap_set_gpio_dataout(7, 1); | ||
176 | udelay(2); /* wait at least 100ns */ | 167 | udelay(2); /* wait at least 100ns */ |
177 | omap_set_gpio_dataout(7, 0); | 168 | gpio_set_value(7, 0); |
178 | mdelay(50); /* 50ms until PHY ready */ | 169 | mdelay(50); /* 50ms until PHY ready */ |
179 | /* smc91x interrupt pin */ | 170 | /* smc91x interrupt pin */ |
180 | omap_request_gpio(8); | 171 | gpio_request(8, "SMC91x irq"); |
181 | /* 16C554 reset*/ | 172 | /* 16C554 reset*/ |
182 | omap_request_gpio(6); | 173 | gpio_request(6, "16C554 reset"); |
183 | omap_set_gpio_direction(6, 0); | 174 | gpio_direction_output(6, 0); |
184 | omap_set_gpio_dataout(6, 0); | ||
185 | /* 16C554 interrupt pins */ | 175 | /* 16C554 interrupt pins */ |
186 | omap_request_gpio(12); | 176 | gpio_request(12, "16C554 irq"); |
187 | omap_request_gpio(13); | 177 | gpio_request(13, "16C554 irq"); |
188 | omap_request_gpio(14); | 178 | gpio_request(14, "16C554 irq"); |
189 | omap_request_gpio(15); | 179 | gpio_request(15, "16C554 irq"); |
190 | set_irq_type(OMAP_GPIO_IRQ(12), IRQ_TYPE_EDGE_RISING); | 180 | set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING); |
191 | set_irq_type(OMAP_GPIO_IRQ(13), IRQ_TYPE_EDGE_RISING); | 181 | set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING); |
192 | set_irq_type(OMAP_GPIO_IRQ(14), IRQ_TYPE_EDGE_RISING); | 182 | set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING); |
193 | set_irq_type(OMAP_GPIO_IRQ(15), IRQ_TYPE_EDGE_RISING); | 183 | set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING); |
194 | 184 | ||
195 | platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); | 185 | platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); |
196 | omap_board_config = voiceblue_config; | 186 | omap_board_config = voiceblue_config; |
@@ -244,19 +234,18 @@ static int wdt_gpio_state; | |||
244 | 234 | ||
245 | void voiceblue_wdt_enable(void) | 235 | void voiceblue_wdt_enable(void) |
246 | { | 236 | { |
247 | omap_set_gpio_direction(0, 0); | 237 | gpio_direction_output(0, 0); |
248 | omap_set_gpio_dataout(0, 0); | 238 | gpio_set_value(0, 1); |
249 | omap_set_gpio_dataout(0, 1); | 239 | gpio_set_value(0, 0); |
250 | omap_set_gpio_dataout(0, 0); | ||
251 | wdt_gpio_state = 0; | 240 | wdt_gpio_state = 0; |
252 | } | 241 | } |
253 | 242 | ||
254 | void voiceblue_wdt_disable(void) | 243 | void voiceblue_wdt_disable(void) |
255 | { | 244 | { |
256 | omap_set_gpio_dataout(0, 0); | 245 | gpio_set_value(0, 0); |
257 | omap_set_gpio_dataout(0, 1); | 246 | gpio_set_value(0, 1); |
258 | omap_set_gpio_dataout(0, 0); | 247 | gpio_set_value(0, 0); |
259 | omap_set_gpio_direction(0, 1); | 248 | gpio_direction_input(0); |
260 | } | 249 | } |
261 | 250 | ||
262 | void voiceblue_wdt_ping(void) | 251 | void voiceblue_wdt_ping(void) |
@@ -265,7 +254,7 @@ void voiceblue_wdt_ping(void) | |||
265 | return; | 254 | return; |
266 | 255 | ||
267 | wdt_gpio_state = !wdt_gpio_state; | 256 | wdt_gpio_state = !wdt_gpio_state; |
268 | omap_set_gpio_dataout(0, wdt_gpio_state); | 257 | gpio_set_value(0, wdt_gpio_state); |
269 | } | 258 | } |
270 | 259 | ||
271 | void voiceblue_reset(void) | 260 | void voiceblue_reset(void) |
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 | ||
706 | static struct clk mmc1_ck = { | 706 | static 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 | ||
721 | static struct clk mmc2_ck = { | 720 | static 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) | |||
99 | static inline void omap_init_mbox(void) { } | 100 | static 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 | |||
107 | static 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 | |||
154 | void __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 |
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c index 04995381aa5c..4f2b8a7adb19 100644 --- a/arch/arm/mach-omap1/fpga.c +++ b/arch/arm/mach-omap1/fpga.c | |||
@@ -177,9 +177,9 @@ void omap1510_fpga_init_irq(void) | |||
177 | * NOTE: For general GPIO/MPUIO access and interrupts, please see | 177 | * NOTE: For general GPIO/MPUIO access and interrupts, please see |
178 | * gpio.[ch] | 178 | * gpio.[ch] |
179 | */ | 179 | */ |
180 | omap_request_gpio(13); | 180 | gpio_request(13, "FPGA irq"); |
181 | omap_set_gpio_direction(13, 1); | 181 | gpio_direction_input(13); |
182 | set_irq_type(OMAP_GPIO_IRQ(13), IRQ_TYPE_EDGE_RISING); | 182 | set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING); |
183 | set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux); | 183 | set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux); |
184 | } | 184 | } |
185 | 185 | ||
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c index 13083d7e692d..89bb8756f450 100644 --- a/arch/arm/mach-omap1/id.c +++ b/arch/arm/mach-omap1/id.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <mach/cpu.h> | ||
18 | 19 | ||
19 | #define OMAP_DIE_ID_0 0xfffe1800 | 20 | #define OMAP_DIE_ID_0 0xfffe1800 |
20 | #define OMAP_DIE_ID_1 0xfffe1804 | 21 | #define OMAP_DIE_ID_1 0xfffe1804 |
@@ -30,6 +31,8 @@ struct omap_id { | |||
30 | u32 type; /* Cpu id bits [31:08], cpu class bits [07:00] */ | 31 | u32 type; /* Cpu id bits [31:08], cpu class bits [07:00] */ |
31 | }; | 32 | }; |
32 | 33 | ||
34 | static unsigned int omap_revision; | ||
35 | |||
33 | /* Register values to detect the OMAP version */ | 36 | /* Register values to detect the OMAP version */ |
34 | static struct omap_id omap_ids[] __initdata = { | 37 | static struct omap_id omap_ids[] __initdata = { |
35 | { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000}, | 38 | { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000}, |
@@ -53,6 +56,12 @@ static struct omap_id omap_ids[] __initdata = { | |||
53 | { .jtag_id = 0xb5f7, .die_rev = 0x2, .omap_id = 0x03330100, .type = 0x17100000}, | 56 | { .jtag_id = 0xb5f7, .die_rev = 0x2, .omap_id = 0x03330100, .type = 0x17100000}, |
54 | }; | 57 | }; |
55 | 58 | ||
59 | unsigned int omap_rev(void) | ||
60 | { | ||
61 | return omap_revision; | ||
62 | } | ||
63 | EXPORT_SYMBOL(omap_rev); | ||
64 | |||
56 | /* | 65 | /* |
57 | * Get OMAP type from PROD_ID. | 66 | * Get OMAP type from PROD_ID. |
58 | * 1710 has the PROD_ID in bits 15:00, not in 16:01 as documented in TRM. | 67 | * 1710 has the PROD_ID in bits 15:00, not in 16:01 as documented in TRM. |
@@ -121,17 +130,18 @@ void __init omap_check_revision(void) | |||
121 | omap_id = omap_readl(OMAP32_ID_0); | 130 | omap_id = omap_readl(OMAP32_ID_0); |
122 | 131 | ||
123 | #ifdef DEBUG | 132 | #ifdef DEBUG |
124 | printk("OMAP_DIE_ID_0: 0x%08x\n", omap_readl(OMAP_DIE_ID_0)); | 133 | printk(KERN_DEBUG "OMAP_DIE_ID_0: 0x%08x\n", omap_readl(OMAP_DIE_ID_0)); |
125 | printk("OMAP_DIE_ID_1: 0x%08x DIE_REV: %i\n", | 134 | printk(KERN_DEBUG "OMAP_DIE_ID_1: 0x%08x DIE_REV: %i\n", |
126 | omap_readl(OMAP_DIE_ID_1), | 135 | omap_readl(OMAP_DIE_ID_1), |
127 | (omap_readl(OMAP_DIE_ID_1) >> 17) & 0xf); | 136 | (omap_readl(OMAP_DIE_ID_1) >> 17) & 0xf); |
128 | printk("OMAP_PRODUCTION_ID_0: 0x%08x\n", omap_readl(OMAP_PRODUCTION_ID_0)); | 137 | printk(KERN_DEBUG "OMAP_PRODUCTION_ID_0: 0x%08x\n", |
129 | printk("OMAP_PRODUCTION_ID_1: 0x%08x JTAG_ID: 0x%04x\n", | 138 | omap_readl(OMAP_PRODUCTION_ID_0)); |
139 | printk(KERN_DEBUG "OMAP_PRODUCTION_ID_1: 0x%08x JTAG_ID: 0x%04x\n", | ||
130 | omap_readl(OMAP_PRODUCTION_ID_1), | 140 | omap_readl(OMAP_PRODUCTION_ID_1), |
131 | omap_readl(OMAP_PRODUCTION_ID_1) & 0xffff); | 141 | omap_readl(OMAP_PRODUCTION_ID_1) & 0xffff); |
132 | printk("OMAP32_ID_0: 0x%08x\n", omap_readl(OMAP32_ID_0)); | 142 | printk(KERN_DEBUG "OMAP32_ID_0: 0x%08x\n", omap_readl(OMAP32_ID_0)); |
133 | printk("OMAP32_ID_1: 0x%08x\n", omap_readl(OMAP32_ID_1)); | 143 | printk(KERN_DEBUG "OMAP32_ID_1: 0x%08x\n", omap_readl(OMAP32_ID_1)); |
134 | printk("JTAG_ID: 0x%04x DIE_REV: %i\n", jtag_id, die_rev); | 144 | printk(KERN_DEBUG "JTAG_ID: 0x%04x DIE_REV: %i\n", jtag_id, die_rev); |
135 | #endif | 145 | #endif |
136 | 146 | ||
137 | system_serial_high = omap_readl(OMAP_DIE_ID_0); | 147 | system_serial_high = omap_readl(OMAP_DIE_ID_0); |
@@ -140,7 +150,7 @@ void __init omap_check_revision(void) | |||
140 | /* First check only the major version in a safe way */ | 150 | /* First check only the major version in a safe way */ |
141 | for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { | 151 | for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { |
142 | if (jtag_id == (omap_ids[i].jtag_id)) { | 152 | if (jtag_id == (omap_ids[i].jtag_id)) { |
143 | system_rev = omap_ids[i].type; | 153 | omap_revision = omap_ids[i].type; |
144 | break; | 154 | break; |
145 | } | 155 | } |
146 | } | 156 | } |
@@ -148,7 +158,7 @@ void __init omap_check_revision(void) | |||
148 | /* Check if we can find the die revision */ | 158 | /* Check if we can find the die revision */ |
149 | for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { | 159 | for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { |
150 | if (jtag_id == omap_ids[i].jtag_id && die_rev == omap_ids[i].die_rev) { | 160 | if (jtag_id == omap_ids[i].jtag_id && die_rev == omap_ids[i].die_rev) { |
151 | system_rev = omap_ids[i].type; | 161 | omap_revision = omap_ids[i].type; |
152 | break; | 162 | break; |
153 | } | 163 | } |
154 | } | 164 | } |
@@ -158,38 +168,35 @@ void __init omap_check_revision(void) | |||
158 | if (jtag_id == omap_ids[i].jtag_id | 168 | if (jtag_id == omap_ids[i].jtag_id |
159 | && die_rev == omap_ids[i].die_rev | 169 | && die_rev == omap_ids[i].die_rev |
160 | && omap_id == omap_ids[i].omap_id) { | 170 | && omap_id == omap_ids[i].omap_id) { |
161 | system_rev = omap_ids[i].type; | 171 | omap_revision = omap_ids[i].type; |
162 | break; | 172 | break; |
163 | } | 173 | } |
164 | } | 174 | } |
165 | 175 | ||
166 | /* Add the cpu class info (7xx, 15xx, 16xx, 24xx) */ | 176 | /* Add the cpu class info (7xx, 15xx, 16xx, 24xx) */ |
167 | cpu_type = system_rev >> 24; | 177 | cpu_type = omap_revision >> 24; |
168 | 178 | ||
169 | switch (cpu_type) { | 179 | switch (cpu_type) { |
170 | case 0x07: | 180 | case 0x07: |
171 | system_rev |= 0x07; | 181 | omap_revision |= 0x07; |
172 | break; | 182 | break; |
173 | case 0x03: | 183 | case 0x03: |
174 | case 0x15: | 184 | case 0x15: |
175 | system_rev |= 0x15; | 185 | omap_revision |= 0x15; |
176 | break; | 186 | break; |
177 | case 0x16: | 187 | case 0x16: |
178 | case 0x17: | 188 | case 0x17: |
179 | system_rev |= 0x16; | 189 | omap_revision |= 0x16; |
180 | break; | ||
181 | case 0x24: | ||
182 | system_rev |= 0x24; | ||
183 | break; | 190 | break; |
184 | default: | 191 | default: |
185 | printk("Unknown OMAP cpu type: 0x%02x\n", cpu_type); | 192 | printk(KERN_INFO "Unknown OMAP cpu type: 0x%02x\n", cpu_type); |
186 | } | 193 | } |
187 | 194 | ||
188 | printk("OMAP%04x", system_rev >> 16); | 195 | printk(KERN_INFO "OMAP%04x", omap_revision >> 16); |
189 | if ((system_rev >> 8) & 0xff) | 196 | if ((omap_revision >> 8) & 0xff) |
190 | printk("%x", (system_rev >> 8) & 0xff); | 197 | printk(KERN_INFO "%x", (omap_revision >> 8) & 0xff); |
191 | printk(" revision %i handled as %02xxx id: %08x%08x\n", | 198 | printk(KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n", |
192 | die_rev, system_rev & 0xff, system_serial_low, | 199 | die_rev, omap_revision & 0xff, system_serial_low, |
193 | system_serial_high); | 200 | system_serial_high); |
194 | } | 201 | } |
195 | 202 | ||
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c index b3bd8ca85118..4c3e582f3d3c 100644 --- a/arch/arm/mach-omap1/io.c +++ b/arch/arm/mach-omap1/io.c | |||
@@ -128,7 +128,7 @@ void __init omap1_map_common_io(void) | |||
128 | * Common low-level hardware init for omap1. This should only get called from | 128 | * Common low-level hardware init for omap1. This should only get called from |
129 | * board specific init. | 129 | * board specific init. |
130 | */ | 130 | */ |
131 | void __init omap1_init_common_hw() | 131 | void __init omap1_init_common_hw(void) |
132 | { | 132 | { |
133 | /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort | 133 | /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort |
134 | * on a Posted Write in the TIPB Bridge". | 134 | * on a Posted Write in the TIPB Bridge". |
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c index 71fe2cc7f7cf..17c9d0e04216 100644 --- a/arch/arm/mach-omap1/leds-h2p2-debug.c +++ b/arch/arm/mach-omap1/leds-h2p2-debug.c | |||
@@ -65,8 +65,8 @@ void h2p2_dbg_leds_event(led_event_t evt) | |||
65 | /* all leds off during suspend or shutdown */ | 65 | /* all leds off during suspend or shutdown */ |
66 | 66 | ||
67 | if (! machine_is_omap_perseus2()) { | 67 | if (! machine_is_omap_perseus2()) { |
68 | omap_set_gpio_dataout(GPIO_TIMER, 0); | 68 | gpio_set_value(GPIO_TIMER, 0); |
69 | omap_set_gpio_dataout(GPIO_IDLE, 0); | 69 | gpio_set_value(GPIO_IDLE, 0); |
70 | } | 70 | } |
71 | 71 | ||
72 | __raw_writew(~0, &fpga->leds); | 72 | __raw_writew(~0, &fpga->leds); |
@@ -94,7 +94,7 @@ void h2p2_dbg_leds_event(led_event_t evt) | |||
94 | if (machine_is_omap_perseus2()) | 94 | if (machine_is_omap_perseus2()) |
95 | hw_led_state ^= H2P2_DBG_FPGA_P2_LED_TIMER; | 95 | hw_led_state ^= H2P2_DBG_FPGA_P2_LED_TIMER; |
96 | else { | 96 | else { |
97 | omap_set_gpio_dataout(GPIO_TIMER, led_state & LED_TIMER_ON); | 97 | gpio_set_value(GPIO_TIMER, led_state & LED_TIMER_ON); |
98 | goto done; | 98 | goto done; |
99 | } | 99 | } |
100 | 100 | ||
@@ -106,7 +106,7 @@ void h2p2_dbg_leds_event(led_event_t evt) | |||
106 | if (machine_is_omap_perseus2()) | 106 | if (machine_is_omap_perseus2()) |
107 | hw_led_state |= H2P2_DBG_FPGA_P2_LED_IDLE; | 107 | hw_led_state |= H2P2_DBG_FPGA_P2_LED_IDLE; |
108 | else { | 108 | else { |
109 | omap_set_gpio_dataout(GPIO_IDLE, 1); | 109 | gpio_set_value(GPIO_IDLE, 1); |
110 | goto done; | 110 | goto done; |
111 | } | 111 | } |
112 | 112 | ||
@@ -116,7 +116,7 @@ void h2p2_dbg_leds_event(led_event_t evt) | |||
116 | if (machine_is_omap_perseus2()) | 116 | if (machine_is_omap_perseus2()) |
117 | hw_led_state &= ~H2P2_DBG_FPGA_P2_LED_IDLE; | 117 | hw_led_state &= ~H2P2_DBG_FPGA_P2_LED_IDLE; |
118 | else { | 118 | else { |
119 | omap_set_gpio_dataout(GPIO_IDLE, 0); | 119 | gpio_set_value(GPIO_IDLE, 0); |
120 | goto done; | 120 | goto done; |
121 | } | 121 | } |
122 | 122 | ||
diff --git a/arch/arm/mach-omap1/leds-osk.c b/arch/arm/mach-omap1/leds-osk.c index 98e789622dfd..499d7ad8697d 100644 --- a/arch/arm/mach-omap1/leds-osk.c +++ b/arch/arm/mach-omap1/leds-osk.c | |||
@@ -44,8 +44,8 @@ static void mistral_setled(void) | |||
44 | green = 1; | 44 | green = 1; |
45 | /* else both sides are disabled */ | 45 | /* else both sides are disabled */ |
46 | 46 | ||
47 | omap_set_gpio_dataout(GPIO_LED_GREEN, green); | 47 | gpio_set_value(GPIO_LED_GREEN, green); |
48 | omap_set_gpio_dataout(GPIO_LED_RED, red); | 48 | gpio_set_value(GPIO_LED_RED, red); |
49 | } | 49 | } |
50 | 50 | ||
51 | #endif | 51 | #endif |
diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c index 6cdad93c4a00..8cbf2562dcaa 100644 --- a/arch/arm/mach-omap1/leds.c +++ b/arch/arm/mach-omap1/leds.c | |||
@@ -47,14 +47,14 @@ omap_leds_init(void) | |||
47 | * that's a different kind of LED (just one color at a time). | 47 | * that's a different kind of LED (just one color at a time). |
48 | */ | 48 | */ |
49 | omap_cfg_reg(P18_1610_GPIO3); | 49 | omap_cfg_reg(P18_1610_GPIO3); |
50 | if (omap_request_gpio(3) == 0) | 50 | if (gpio_request(3, "LED red") == 0) |
51 | omap_set_gpio_direction(3, 0); | 51 | gpio_direction_output(3, 1); |
52 | else | 52 | else |
53 | printk(KERN_WARNING "LED: can't get GPIO3/red?\n"); | 53 | printk(KERN_WARNING "LED: can't get GPIO3/red?\n"); |
54 | 54 | ||
55 | omap_cfg_reg(MPUIO4); | 55 | omap_cfg_reg(MPUIO4); |
56 | if (omap_request_gpio(OMAP_MPUIO(4)) == 0) | 56 | if (gpio_request(OMAP_MPUIO(4), "LED green") == 0) |
57 | omap_set_gpio_direction(OMAP_MPUIO(4), 0); | 57 | gpio_direction_output(OMAP_MPUIO(4), 1); |
58 | else | 58 | else |
59 | printk(KERN_WARNING "LED: can't get MPUIO4/green?\n"); | 59 | printk(KERN_WARNING "LED: can't get MPUIO4/green?\n"); |
60 | } | 60 | } |
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 770d256c790b..9774c1f5311e 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c | |||
@@ -226,7 +226,8 @@ void omap_pm_suspend(void) | |||
226 | { | 226 | { |
227 | unsigned long arg0 = 0, arg1 = 0; | 227 | unsigned long arg0 = 0, arg1 = 0; |
228 | 228 | ||
229 | printk("PM: OMAP%x is trying to enter deep sleep...\n", system_rev); | 229 | printk(KERN_INFO "PM: OMAP%x is trying to enter deep sleep...\n", |
230 | omap_rev()); | ||
230 | 231 | ||
231 | omap_serial_wake_trigger(1); | 232 | omap_serial_wake_trigger(1); |
232 | 233 | ||
@@ -421,7 +422,8 @@ void omap_pm_suspend(void) | |||
421 | 422 | ||
422 | omap_serial_wake_trigger(0); | 423 | omap_serial_wake_trigger(0); |
423 | 424 | ||
424 | printk("PM: OMAP%x is re-starting from deep sleep...\n", system_rev); | 425 | printk(KERN_INFO "PM: OMAP%x is re-starting from deep sleep...\n", |
426 | omap_rev()); | ||
425 | } | 427 | } |
426 | 428 | ||
427 | #if defined(DEBUG) && defined(CONFIG_PROC_FS) | 429 | #if defined(DEBUG) && defined(CONFIG_PROC_FS) |
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c index 528691d5cb51..0002084e0655 100644 --- a/arch/arm/mach-omap1/serial.c +++ b/arch/arm/mach-omap1/serial.c | |||
@@ -244,22 +244,22 @@ static void __init omap_serial_set_port_wakeup(int gpio_nr) | |||
244 | { | 244 | { |
245 | int ret; | 245 | int ret; |
246 | 246 | ||
247 | ret = omap_request_gpio(gpio_nr); | 247 | ret = gpio_request(gpio_nr, "UART wake"); |
248 | if (ret < 0) { | 248 | if (ret < 0) { |
249 | printk(KERN_ERR "Could not request UART wake GPIO: %i\n", | 249 | printk(KERN_ERR "Could not request UART wake GPIO: %i\n", |
250 | gpio_nr); | 250 | gpio_nr); |
251 | return; | 251 | return; |
252 | } | 252 | } |
253 | omap_set_gpio_direction(gpio_nr, 1); | 253 | gpio_direction_input(gpio_nr); |
254 | ret = request_irq(OMAP_GPIO_IRQ(gpio_nr), &omap_serial_wake_interrupt, | 254 | ret = request_irq(gpio_to_irq(gpio_nr), &omap_serial_wake_interrupt, |
255 | IRQF_TRIGGER_RISING, "serial wakeup", NULL); | 255 | IRQF_TRIGGER_RISING, "serial wakeup", NULL); |
256 | if (ret) { | 256 | if (ret) { |
257 | omap_free_gpio(gpio_nr); | 257 | gpio_free(gpio_nr); |
258 | printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n", | 258 | printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n", |
259 | gpio_nr); | 259 | gpio_nr); |
260 | return; | 260 | return; |
261 | } | 261 | } |
262 | enable_irq_wake(OMAP_GPIO_IRQ(gpio_nr)); | 262 | enable_irq_wake(gpio_to_irq(gpio_nr)); |
263 | } | 263 | } |
264 | 264 | ||
265 | static int __init omap_serial_wakeup_init(void) | 265 | static int __init omap_serial_wakeup_init(void) |
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index 2cf7e32bd293..495a32c287b4 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c | |||
@@ -173,7 +173,7 @@ static __init void omap_init_mpu_timer(unsigned long rate) | |||
173 | clockevent_mpu_timer1.min_delta_ns = | 173 | clockevent_mpu_timer1.min_delta_ns = |
174 | clockevent_delta2ns(1, &clockevent_mpu_timer1); | 174 | clockevent_delta2ns(1, &clockevent_mpu_timer1); |
175 | 175 | ||
176 | clockevent_mpu_timer1.cpumask = cpumask_of_cpu(0); | 176 | clockevent_mpu_timer1.cpumask = cpumask_of(0); |
177 | clockevents_register_device(&clockevent_mpu_timer1); | 177 | clockevents_register_device(&clockevent_mpu_timer1); |
178 | } | 178 | } |
179 | 179 | ||
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c index 705367ece174..fd3f7396e162 100644 --- a/arch/arm/mach-omap1/timer32k.c +++ b/arch/arm/mach-omap1/timer32k.c | |||
@@ -187,7 +187,7 @@ static __init void omap_init_32k_timer(void) | |||
187 | clockevent_32k_timer.min_delta_ns = | 187 | clockevent_32k_timer.min_delta_ns = |
188 | clockevent_delta2ns(1, &clockevent_32k_timer); | 188 | clockevent_delta2ns(1, &clockevent_32k_timer); |
189 | 189 | ||
190 | clockevent_32k_timer.cpumask = cpumask_of_cpu(0); | 190 | clockevent_32k_timer.cpumask = cpumask_of(0); |
191 | clockevents_register_device(&clockevent_32k_timer); | 191 | clockevents_register_device(&clockevent_32k_timer); |
192 | } | 192 | } |
193 | 193 | ||