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-fsample.c7
-rw-r--r--arch/arm/mach-omap1/board-h2.c24
-rw-r--r--arch/arm/mach-omap1/board-h3.c9
-rw-r--r--arch/arm/mach-omap1/board-innovator.c2
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c12
-rw-r--r--arch/arm/mach-omap1/board-osk.c43
-rw-r--r--arch/arm/mach-omap1/board-palmte.c14
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c2
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c23
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c7
-rw-r--r--arch/arm/mach-omap1/board-sx1.c11
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c49
-rw-r--r--arch/arm/mach-omap1/fpga.c6
-rw-r--r--arch/arm/mach-omap1/id.c53
-rw-r--r--arch/arm/mach-omap1/io.c2
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c10
-rw-r--r--arch/arm/mach-omap1/leds-osk.c4
-rw-r--r--arch/arm/mach-omap1/leds.c8
-rw-r--r--arch/arm/mach-omap1/pm.c6
-rw-r--r--arch/arm/mach-omap1/serial.c10
20 files changed, 165 insertions, 137 deletions
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
206static int nand_dev_ready(struct omap_nand_platform_data *data) 206static 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
211static struct omap_uart_config fsample_uart_config __initdata = { 211static struct omap_uart_config fsample_uart_config __initdata = {
@@ -223,8 +223,9 @@ static struct omap_board_config_kernel fsample_config[] = {
223 223
224static void __init omap_fsample_init(void) 224static 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.c b/arch/arm/mach-omap1/board-h2.c
index 3b65914b9141..c5b4a3b718cf 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)
251static int h2_transceiver_mode(struct device *dev, int state) 251static 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,7 +339,7 @@ static struct platform_device *h2_devices[] __initdata = {
342 339
343static void __init h2_init_smc91x(void) 340static 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 }
@@ -409,7 +406,7 @@ static struct omap_board_config_kernel h2_config[] __initdata = {
409 406
410static int h2_nand_dev_ready(struct omap_nand_platform_data *data) 407static int h2_nand_dev_ready(struct omap_nand_platform_data *data)
411{ 408{
412 return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); 409 return gpio_get_value(H2_NAND_RB_GPIO_PIN);
413} 410}
414 411
415static void __init h2_init(void) 412static void __init h2_init(void)
@@ -428,8 +425,9 @@ static void __init h2_init(void)
428 425
429 h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; 426 h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS;
430 h2_nand_resource.end += SZ_4K - 1; 427 h2_nand_resource.end += SZ_4K - 1;
431 if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) 428 if (gpio_request(H2_NAND_RB_GPIO_PIN, "NAND ready") < 0)
432 h2_nand_data.dev_ready = h2_nand_dev_ready; 429 BUG();
430 gpio_direction_input(H2_NAND_RB_GPIO_PIN);
433 431
434 omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 432 omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
435 omap_cfg_reg(M8_1610_FLASH_CS2B_WE); 433 omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
@@ -441,10 +439,10 @@ static void __init h2_init(void)
441 /* Irda */ 439 /* Irda */
442#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) 440#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
443 omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A); 441 omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
444 if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) { 442 if (gpio_request(H2_IRDA_FIRSEL_GPIO_PIN, "IRDA mode") < 0)
445 omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0); 443 BUG();
446 h2_irda_data.transceiver_mode = h2_transceiver_mode; 444 gpio_direction_output(H2_IRDA_FIRSEL_GPIO_PIN, 0);
447 } 445 h2_irda_data.transceiver_mode = h2_transceiver_mode;
448#endif 446#endif
449 447
450 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); 448 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index adfcd7b51393..0332203bd53d 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -498,7 +498,7 @@ static struct omap_gpio_switch h3_gpio_switches[] __initdata = {
498 498
499static int nand_dev_ready(struct omap_nand_platform_data *data) 499static int nand_dev_ready(struct omap_nand_platform_data *data)
500{ 500{
501 return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN); 501 return gpio_get_value(H3_NAND_RB_GPIO_PIN);
502} 502}
503 503
504static void __init h3_init(void) 504static void __init h3_init(void)
@@ -516,8 +516,9 @@ static void __init h3_init(void)
516 516
517 nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS; 517 nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS;
518 nand_resource.end += SZ_4K - 1; 518 nand_resource.end += SZ_4K - 1;
519 if (!(omap_request_gpio(H3_NAND_RB_GPIO_PIN))) 519 if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0)
520 nand_data.dev_ready = nand_dev_ready; 520 BUG();
521 nand_data.dev_ready = nand_dev_ready;
521 522
522 /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ 523 /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */
523 /* GPIO10 pullup/down register, Enable pullup on GPIO10 */ 524 /* GPIO10 pullup/down register, Enable pullup on GPIO10 */
@@ -537,7 +538,7 @@ static void __init h3_init(void)
537static void __init h3_init_smc91x(void) 538static void __init h3_init_smc91x(void)
538{ 539{
539 omap_cfg_reg(W15_1710_GPIO40); 540 omap_cfg_reg(W15_1710_GPIO40);
540 if (omap_request_gpio(40) < 0) { 541 if (gpio_request(40, "SMC91x irq") < 0) {
541 printk("Error requesting gpio 40 for smc91x irq\n"); 542 printk("Error requesting gpio 40 for smc91x irq\n");
542 return; 543 return;
543 } 544 }
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index cbc11be5cd2a..a21e365a7a87 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -301,7 +301,7 @@ static void __init innovator_init_smc91x(void)
301 OMAP1510_FPGA_RST); 301 OMAP1510_FPGA_RST);
302 udelay(750); 302 udelay(750);
303 } else { 303 } else {
304 if ((omap_request_gpio(0)) < 0) { 304 if (gpio_request(0, "SMC91x irq") < 0) {
305 printk("Error requesting gpio 0 for smc91x irq\n"); 305 printk("Error requesting gpio 0 for smc91x irq\n");
306 return; 306 return;
307 } 307 }
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 38d9783ac6d6..b26782471e59 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -102,7 +102,7 @@ static void mipid_shutdown(struct mipid_platform_data *pdata)
102{ 102{
103 if (pdata->nreset_gpio != -1) { 103 if (pdata->nreset_gpio != -1) {
104 printk(KERN_INFO "shutdown LCD\n"); 104 printk(KERN_INFO "shutdown LCD\n");
105 omap_set_gpio_dataout(pdata->nreset_gpio, 0); 105 gpio_set_value(pdata->nreset_gpio, 0);
106 msleep(120); 106 msleep(120);
107 } 107 }
108} 108}
@@ -124,13 +124,13 @@ static void mipid_dev_init(void)
124 124
125static void ads7846_dev_init(void) 125static void ads7846_dev_init(void)
126{ 126{
127 if (omap_request_gpio(ADS7846_PENDOWN_GPIO) < 0) 127 if (gpio_request(ADS7846_PENDOWN_GPIO, "ADS7846 pendown") < 0)
128 printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); 128 printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
129} 129}
130 130
131static int ads7846_get_pendown_state(void) 131static int ads7846_get_pendown_state(void)
132{ 132{
133 return !omap_get_gpio_datain(ADS7846_PENDOWN_GPIO); 133 return !gpio_get_value(ADS7846_PENDOWN_GPIO);
134} 134}
135 135
136static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { 136static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {
@@ -228,9 +228,9 @@ static void nokia770_audio_pwr_up(void)
228 /* Turn on codec */ 228 /* Turn on codec */
229 aic23_power_up(); 229 aic23_power_up();
230 230
231 if (omap_get_gpio_datain(HEADPHONE_GPIO)) 231 if (gpio_get_value(HEADPHONE_GPIO))
232 /* HP not connected, turn on amplifier */ 232 /* HP not connected, turn on amplifier */
233 omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 1); 233 gpio_set_value(AMPLIFIER_CTRL_GPIO, 1);
234 else 234 else
235 /* HP connected, do not turn on amplifier */ 235 /* HP connected, do not turn on amplifier */
236 printk("HP connected\n"); 236 printk("HP connected\n");
@@ -250,7 +250,7 @@ static DECLARE_DELAYED_WORK(codec_power_down_work, codec_delayed_power_down);
250static void nokia770_audio_pwr_down(void) 250static void nokia770_audio_pwr_down(void)
251{ 251{
252 /* Turn off amplifier */ 252 /* Turn off amplifier */
253 omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 0); 253 gpio_set_value(AMPLIFIER_CTRL_GPIO, 0);
254 254
255 /* Turn off codec: schedule delayed work */ 255 /* Turn off codec: schedule delayed work */
256 schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */ 256 schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */
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
294static void __init osk_init_irq(void) 294static 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
346static struct at24_platform_data at24c04 = {
347 .byte_len = SZ_4K / 8,
348 .page_size = 16,
349};
350
351static 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
345static const int osk_keymap[] = { 362static 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..4141e3917d7c 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;
@@ -335,11 +335,11 @@ static void palmte_headphones_detect(void *data, int state)
335{ 335{
336 if (state) { 336 if (state) {
337 /* Headphones connected, disable speaker */ 337 /* Headphones connected, disable speaker */
338 omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 0); 338 gpio_set_value(PALMTE_SPEAKER_GPIO, 0);
339 printk(KERN_INFO "PM: speaker off\n"); 339 printk(KERN_INFO "PM: speaker off\n");
340 } else { 340 } else {
341 /* Headphones unplugged, re-enable speaker */ 341 /* Headphones unplugged, re-enable speaker */
342 omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 1); 342 gpio_set_value(PALMTE_SPEAKER_GPIO, 1);
343 printk(KERN_INFO "PM: speaker on\n"); 343 printk(KERN_INFO "PM: speaker on\n");
344 } 344 }
345} 345}
@@ -347,18 +347,18 @@ static void palmte_headphones_detect(void *data, int state)
347static void __init palmte_misc_gpio_setup(void) 347static void __init palmte_misc_gpio_setup(void)
348{ 348{
349 /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */ 349 /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */
350 if (omap_request_gpio(PALMTE_PINTDAV_GPIO)) { 350 if (gpio_request(PALMTE_PINTDAV_GPIO, "TSC2102 PINTDAV") < 0) {
351 printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n"); 351 printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n");
352 return; 352 return;
353 } 353 }
354 omap_set_gpio_direction(PALMTE_PINTDAV_GPIO, 1); 354 gpio_direction_input(PALMTE_PINTDAV_GPIO);
355 355
356 /* Set USB-or-DC-IN pin as input (unused) */ 356 /* Set USB-or-DC-IN pin as input (unused) */
357 if (omap_request_gpio(PALMTE_USB_OR_DC_GPIO)) { 357 if (gpio_request(PALMTE_USB_OR_DC_GPIO, "USB/DC-IN") < 0) {
358 printk(KERN_ERR "Could not reserve cable signal GPIO!\n"); 358 printk(KERN_ERR "Could not reserve cable signal GPIO!\n");
359 return; 359 return;
360 } 360 }
361 omap_set_gpio_direction(PALMTE_USB_OR_DC_GPIO, 1); 361 gpio_direction_input(PALMTE_USB_OR_DC_GPIO);
362} 362}
363 363
364static void __init omap_palmte_init(void) 364static 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
269static int palmtt_get_pendown_state(void) 269static 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
274static const struct ads7846_platform_data palmtt_ts_info = { 274static 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..801fb5f62ed7 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 = {
239static int 239static int
240palmz71_get_pendown_state(void) 240palmz71_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
245static const struct ads7846_platform_data palmz71_ts_info = { 245static const struct ads7846_platform_data palmz71_ts_info = {
@@ -295,13 +295,13 @@ static struct omap_board_config_kernel palmz71_config[] __initdata = {
295static irqreturn_t 295static irqreturn_t
296palmz71_powercable(int irq, void *dev_id) 296palmz71_powercable(int irq, void *dev_id)
297{ 297{
298 if (omap_get_gpio_datain(PALMZ71_USBDETECT_GPIO)) { 298 if (gpio_get_value(PALMZ71_USBDETECT_GPIO)) {
299 printk(KERN_INFO "PM: Power cable connected\n"); 299 printk(KERN_INFO "PM: Power cable connected\n");
300 set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 300 set_irq_type(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
301 IRQ_TYPE_EDGE_FALLING); 301 IRQ_TYPE_EDGE_FALLING);
302 } else { 302 } else {
303 printk(KERN_INFO "PM: Power cable disconnected\n"); 303 printk(KERN_INFO "PM: Power cable disconnected\n");
304 set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 304 set_irq_type(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
305 IRQ_TYPE_EDGE_RISING); 305 IRQ_TYPE_EDGE_RISING);
306 } 306 }
307 return IRQ_HANDLED; 307 return IRQ_HANDLED;
@@ -323,29 +323,28 @@ palmz71_gpio_setup(int early)
323{ 323{
324 if (early) { 324 if (early) {
325 /* Only set GPIO1 so we have a working serial */ 325 /* Only set GPIO1 so we have a working serial */
326 omap_set_gpio_dataout(1, 1); 326 gpio_direction_output(1, 1);
327 omap_set_gpio_direction(1, 0);
328 } else { 327 } else {
329 /* Set MMC/SD host WP pin as input */ 328 /* Set MMC/SD host WP pin as input */
330 if (omap_request_gpio(PALMZ71_MMC_WP_GPIO)) { 329 if (gpio_request(PALMZ71_MMC_WP_GPIO, "MMC WP") < 0) {
331 printk(KERN_ERR "Could not reserve WP GPIO!\n"); 330 printk(KERN_ERR "Could not reserve WP GPIO!\n");
332 return; 331 return;
333 } 332 }
334 omap_set_gpio_direction(PALMZ71_MMC_WP_GPIO, 1); 333 gpio_direction_input(PALMZ71_MMC_WP_GPIO);
335 334
336 /* Monitor the Power-cable-connected signal */ 335 /* Monitor the Power-cable-connected signal */
337 if (omap_request_gpio(PALMZ71_USBDETECT_GPIO)) { 336 if (gpio_request(PALMZ71_USBDETECT_GPIO, "USB detect") < 0) {
338 printk(KERN_ERR 337 printk(KERN_ERR
339 "Could not reserve cable signal GPIO!\n"); 338 "Could not reserve cable signal GPIO!\n");
340 return; 339 return;
341 } 340 }
342 omap_set_gpio_direction(PALMZ71_USBDETECT_GPIO, 1); 341 gpio_direction_input(PALMZ71_USBDETECT_GPIO);
343 if (request_irq(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 342 if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
344 palmz71_powercable, IRQF_SAMPLE_RANDOM, 343 palmz71_powercable, IRQF_SAMPLE_RANDOM,
345 "palmz71-cable", 0)) 344 "palmz71-cable", 0))
346 printk(KERN_ERR 345 printk(KERN_ERR
347 "IRQ request for power cable failed!\n"); 346 "IRQ request for power cable failed!\n");
348 palmz71_powercable(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 0); 347 palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 0);
349 } 348 }
350} 349}
351 350
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
206static int nand_dev_ready(struct omap_nand_platform_data *data) 206static 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
211static struct omap_uart_config perseus2_uart_config __initdata = { 211static struct omap_uart_config perseus2_uart_config __initdata = {
@@ -223,8 +223,9 @@ static struct omap_board_config_kernel perseus2_config[] __initdata = {
223 223
224static void __init omap_perseus2_init(void) 224static 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.c b/arch/arm/mach-omap1/board-sx1.c
index 130bcc6fd082..93bd395b9972 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -436,14 +436,9 @@ static void __init omap_sx1_init(void)
436 omap_request_gpio(1); /* A_IRDA_OFF */ 436 omap_request_gpio(1); /* A_IRDA_OFF */
437 omap_request_gpio(11); /* A_SWITCH */ 437 omap_request_gpio(11); /* A_SWITCH */
438 omap_request_gpio(15); /* A_USB_ON */ 438 omap_request_gpio(15); /* A_USB_ON */
439 omap_set_gpio_direction(1, 0);/* gpio1 -> output */ 439 gpio_direction_output(1, 1); /*A_IRDA_OFF = 1 */
440 omap_set_gpio_direction(11, 0);/* gpio11 -> output */ 440 gpio_direction_output(11, 0); /*A_SWITCH = 0 */
441 omap_set_gpio_direction(15, 0);/* gpio15 -> output */ 441 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} 442}
448/*----------------------------------------*/ 443/*----------------------------------------*/
449static void __init omap_sx1_init_irq(void) 444static 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..92c9de1090a9 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -168,29 +168,27 @@ static void __init voiceblue_init_irq(void)
168static void __init voiceblue_init(void) 168static void __init voiceblue_init(void)
169{ 169{
170 /* Watchdog */ 170 /* Watchdog */
171 omap_request_gpio(0); 171 gpio_request(0, "Watchdog");
172 /* smc91x reset */ 172 /* smc91x reset */
173 omap_request_gpio(7); 173 gpio_request(7, "SMC91x reset");
174 omap_set_gpio_direction(7, 0); 174 gpio_direction_output(7, 1);
175 omap_set_gpio_dataout(7, 1);
176 udelay(2); /* wait at least 100ns */ 175 udelay(2); /* wait at least 100ns */
177 omap_set_gpio_dataout(7, 0); 176 gpio_set_value(7, 0);
178 mdelay(50); /* 50ms until PHY ready */ 177 mdelay(50); /* 50ms until PHY ready */
179 /* smc91x interrupt pin */ 178 /* smc91x interrupt pin */
180 omap_request_gpio(8); 179 gpio_request(8, "SMC91x irq");
181 /* 16C554 reset*/ 180 /* 16C554 reset*/
182 omap_request_gpio(6); 181 gpio_request(6, "16C554 reset");
183 omap_set_gpio_direction(6, 0); 182 gpio_direction_output(6, 0);
184 omap_set_gpio_dataout(6, 0);
185 /* 16C554 interrupt pins */ 183 /* 16C554 interrupt pins */
186 omap_request_gpio(12); 184 gpio_request(12, "16C554 irq");
187 omap_request_gpio(13); 185 gpio_request(13, "16C554 irq");
188 omap_request_gpio(14); 186 gpio_request(14, "16C554 irq");
189 omap_request_gpio(15); 187 gpio_request(15, "16C554 irq");
190 set_irq_type(OMAP_GPIO_IRQ(12), IRQ_TYPE_EDGE_RISING); 188 set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING);
191 set_irq_type(OMAP_GPIO_IRQ(13), IRQ_TYPE_EDGE_RISING); 189 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
192 set_irq_type(OMAP_GPIO_IRQ(14), IRQ_TYPE_EDGE_RISING); 190 set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING);
193 set_irq_type(OMAP_GPIO_IRQ(15), IRQ_TYPE_EDGE_RISING); 191 set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING);
194 192
195 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); 193 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
196 omap_board_config = voiceblue_config; 194 omap_board_config = voiceblue_config;
@@ -244,19 +242,18 @@ static int wdt_gpio_state;
244 242
245void voiceblue_wdt_enable(void) 243void voiceblue_wdt_enable(void)
246{ 244{
247 omap_set_gpio_direction(0, 0); 245 gpio_direction_output(0, 0);
248 omap_set_gpio_dataout(0, 0); 246 gpio_set_value(0, 1);
249 omap_set_gpio_dataout(0, 1); 247 gpio_set_value(0, 0);
250 omap_set_gpio_dataout(0, 0);
251 wdt_gpio_state = 0; 248 wdt_gpio_state = 0;
252} 249}
253 250
254void voiceblue_wdt_disable(void) 251void voiceblue_wdt_disable(void)
255{ 252{
256 omap_set_gpio_dataout(0, 0); 253 gpio_set_value(0, 0);
257 omap_set_gpio_dataout(0, 1); 254 gpio_set_value(0, 1);
258 omap_set_gpio_dataout(0, 0); 255 gpio_set_value(0, 0);
259 omap_set_gpio_direction(0, 1); 256 gpio_direction_input(0);
260} 257}
261 258
262void voiceblue_wdt_ping(void) 259void voiceblue_wdt_ping(void)
@@ -265,7 +262,7 @@ void voiceblue_wdt_ping(void)
265 return; 262 return;
266 263
267 wdt_gpio_state = !wdt_gpio_state; 264 wdt_gpio_state = !wdt_gpio_state;
268 omap_set_gpio_dataout(0, wdt_gpio_state); 265 gpio_set_value(0, wdt_gpio_state);
269} 266}
270 267
271void voiceblue_reset(void) 268void voiceblue_reset(void)
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
34static unsigned int omap_revision;
35
33/* Register values to detect the OMAP version */ 36/* Register values to detect the OMAP version */
34static struct omap_id omap_ids[] __initdata = { 37static 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
59unsigned int omap_rev(void)
60{
61 return omap_revision;
62}
63EXPORT_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 */
131void __init omap1_init_common_hw() 131void __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
265static int __init omap_serial_wakeup_init(void) 265static int __init omap_serial_wakeup_init(void)