aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-02-12 10:50:02 -0500
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-03-15 08:33:39 -0400
commitb58e5fac96e4f24fc9d5bce8692506ada3e244ca (patch)
treec009ed8714e01d015796e4377e7efdbbd6d83597 /arch/arm/mach-shmobile
parent63d573835f835aab4c44d0e0342cf5976fb14b35 (diff)
ARM: shmobile: sh73a0: Support sparse GPIO numbers
The SH73A0 SoC has sparse GPIO numbers. Declare the pin numbers ranges in the PFC SoC data and use the pin numbers in the GPIO API. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c26
-rw-r--r--arch/arm/mach-shmobile/board-kota2.c42
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c14
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh73a0.h2
4 files changed, 42 insertions, 42 deletions
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 8ff53a19c48c..a4ac46a89b27 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -304,9 +304,9 @@ static int lcd_backlight_set_brightness(int brightness)
304 304
305 if (brightness == 0) { 305 if (brightness == 0) {
306 /* Reset the chip */ 306 /* Reset the chip */
307 gpio_set_value(GPIO_PORT235, 0); 307 gpio_set_value(235, 0);
308 mdelay(24); 308 mdelay(24);
309 gpio_set_value(GPIO_PORT235, 1); 309 gpio_set_value(235, 1);
310 return 0; 310 return 0;
311 } 311 }
312 312
@@ -406,7 +406,7 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
406 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD, 406 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
407 .tmio_caps = MMC_CAP_SD_HIGHSPEED, 407 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
408 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, 408 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
409 .cd_gpio = GPIO_PORT251, 409 .cd_gpio = 251,
410}; 410};
411 411
412static struct resource sdhi0_resources[] = { 412static struct resource sdhi0_resources[] = {
@@ -461,7 +461,7 @@ static struct regulator_init_data cn4_power_init_data = {
461static struct fixed_voltage_config cn4_power_info = { 461static struct fixed_voltage_config cn4_power_info = {
462 .supply_name = "CN4 SD/MMC Vdd", 462 .supply_name = "CN4 SD/MMC Vdd",
463 .microvolts = 3300000, 463 .microvolts = 3300000,
464 .gpio = GPIO_PORT114, 464 .gpio = 114,
465 .enable_high = 1, 465 .enable_high = 1,
466 .init_data = &cn4_power_init_data, 466 .init_data = &cn4_power_init_data,
467}; 467};
@@ -479,10 +479,10 @@ static void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
479 static int power_gpio = -EINVAL; 479 static int power_gpio = -EINVAL;
480 480
481 if (power_gpio < 0) { 481 if (power_gpio < 0) {
482 int ret = gpio_request_one(GPIO_PORT114, GPIOF_OUT_INIT_LOW, 482 int ret = gpio_request_one(114, GPIOF_OUT_INIT_LOW,
483 "sdhi1_power"); 483 "sdhi1_power");
484 if (!ret) 484 if (!ret)
485 power_gpio = GPIO_PORT114; 485 power_gpio = 114;
486 } 486 }
487 487
488 /* 488 /*
@@ -493,7 +493,7 @@ static void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
493 * regulator driver. We have to live with the race in case the driver 493 * regulator driver. We have to live with the race in case the driver
494 * gets unloaded and the GPIO freed between these two steps. 494 * gets unloaded and the GPIO freed between these two steps.
495 */ 495 */
496 gpio_set_value(GPIO_PORT114, state); 496 gpio_set_value(114, state);
497} 497}
498 498
499static struct sh_mobile_sdhi_info sh_sdhi1_info = { 499static struct sh_mobile_sdhi_info sh_sdhi1_info = {
@@ -603,11 +603,11 @@ static void __init ag5evm_init(void)
603 gpio_request(GPIO_FN_MMCD0_5_PU, NULL); 603 gpio_request(GPIO_FN_MMCD0_5_PU, NULL);
604 gpio_request(GPIO_FN_MMCD0_6_PU, NULL); 604 gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
605 gpio_request(GPIO_FN_MMCD0_7_PU, NULL); 605 gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
606 gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */ 606 gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
607 607
608 /* enable SMSC911X */ 608 /* enable SMSC911X */
609 gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */ 609 gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
610 gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */ 610 gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
611 611
612 /* FSI A */ 612 /* FSI A */
613 gpio_request(GPIO_FN_FSIACK, NULL); 613 gpio_request(GPIO_FN_FSIACK, NULL);
@@ -622,13 +622,13 @@ static void __init ag5evm_init(void)
622 gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL); 622 gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL);
623 623
624 /* LCD panel */ 624 /* LCD panel */
625 gpio_request_one(GPIO_PORT217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */ 625 gpio_request_one(217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
626 mdelay(1); 626 mdelay(1);
627 gpio_set_value(GPIO_PORT217, 1); 627 gpio_set_value(217, 1);
628 mdelay(100); 628 mdelay(100);
629 629
630 /* LCD backlight controller */ 630 /* LCD backlight controller */
631 gpio_request_one(GPIO_PORT235, GPIOF_OUT_INIT_LOW, NULL); /* RESET */ 631 gpio_request_one(235, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
632 lcd_backlight_set_brightness(0); 632 lcd_backlight_set_brightness(0);
633 633
634 /* enable SDHI0 on CN15 [SD I/F] */ 634 /* enable SDHI0 on CN15 [SD I/F] */
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c
index 2ccc860403ef..b6f051573b4a 100644
--- a/arch/arm/mach-shmobile/board-kota2.c
+++ b/arch/arm/mach-shmobile/board-kota2.c
@@ -135,17 +135,17 @@ static struct platform_device keysc_device = {
135#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 } 135#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
136 136
137static struct gpio_keys_button gpio_buttons[] = { 137static struct gpio_keys_button gpio_buttons[] = {
138 GPIO_KEY(KEY_VOLUMEUP, GPIO_PORT56, "+"), /* S2: VOL+ [IRQ9] */ 138 GPIO_KEY(KEY_VOLUMEUP, 56, "+"), /* S2: VOL+ [IRQ9] */
139 GPIO_KEY(KEY_VOLUMEDOWN, GPIO_PORT54, "-"), /* S3: VOL- [IRQ10] */ 139 GPIO_KEY(KEY_VOLUMEDOWN, 54, "-"), /* S3: VOL- [IRQ10] */
140 GPIO_KEY(KEY_MENU, GPIO_PORT27, "Menu"), /* S4: MENU [IRQ30] */ 140 GPIO_KEY(KEY_MENU, 27, "Menu"), /* S4: MENU [IRQ30] */
141 GPIO_KEY(KEY_HOMEPAGE, GPIO_PORT26, "Home"), /* S5: HOME [IRQ31] */ 141 GPIO_KEY(KEY_HOMEPAGE, 26, "Home"), /* S5: HOME [IRQ31] */
142 GPIO_KEY(KEY_BACK, GPIO_PORT11, "Back"), /* S6: BACK [IRQ0] */ 142 GPIO_KEY(KEY_BACK, 11, "Back"), /* S6: BACK [IRQ0] */
143 GPIO_KEY(KEY_PHONE, GPIO_PORT238, "Tel"), /* S7: TEL [IRQ11] */ 143 GPIO_KEY(KEY_PHONE, 238, "Tel"), /* S7: TEL [IRQ11] */
144 GPIO_KEY(KEY_POWER, GPIO_PORT239, "C1"), /* S8: CAM [IRQ13] */ 144 GPIO_KEY(KEY_POWER, 239, "C1"), /* S8: CAM [IRQ13] */
145 GPIO_KEY(KEY_MAIL, GPIO_PORT224, "Mail"), /* S9: MAIL [IRQ3] */ 145 GPIO_KEY(KEY_MAIL, 224, "Mail"), /* S9: MAIL [IRQ3] */
146 /* Omitted button "C3?": GPIO_PORT223 - S10: CUST [IRQ8] */ 146 /* Omitted button "C3?": 223 - S10: CUST [IRQ8] */
147 GPIO_KEY(KEY_CAMERA, GPIO_PORT164, "C2"), /* S11: CAM_HALF [IRQ25] */ 147 GPIO_KEY(KEY_CAMERA, 164, "C2"), /* S11: CAM_HALF [IRQ25] */
148 /* Omitted button "?": GPIO_PORT152 - S12: CAM_FULL [No IRQ] */ 148 /* Omitted button "?": 152 - S12: CAM_FULL [No IRQ] */
149}; 149};
150 150
151static struct gpio_keys_platform_data gpio_key_info = { 151static struct gpio_keys_platform_data gpio_key_info = {
@@ -165,9 +165,9 @@ static struct platform_device gpio_keys_device = {
165#define GPIO_LED(n, g) { .name = n, .gpio = g } 165#define GPIO_LED(n, g) { .name = n, .gpio = g }
166 166
167static struct gpio_led gpio_leds[] = { 167static struct gpio_led gpio_leds[] = {
168 GPIO_LED("G", GPIO_PORT20), /* PORT20 [GPO0] -> LED7 -> "G" */ 168 GPIO_LED("G", 20), /* PORT20 [GPO0] -> LED7 -> "G" */
169 GPIO_LED("H", GPIO_PORT21), /* PORT21 [GPO1] -> LED8 -> "H" */ 169 GPIO_LED("H", 21), /* PORT21 [GPO1] -> LED8 -> "H" */
170 GPIO_LED("J", GPIO_PORT22), /* PORT22 [GPO2] -> LED9 -> "J" */ 170 GPIO_LED("J", 22), /* PORT22 [GPO2] -> LED9 -> "J" */
171}; 171};
172 172
173static struct gpio_led_platform_data gpio_leds_info = { 173static struct gpio_led_platform_data gpio_leds_info = {
@@ -187,7 +187,7 @@ static struct platform_device gpio_leds_device = {
187static struct led_renesas_tpu_config led_renesas_tpu12_pdata = { 187static struct led_renesas_tpu_config led_renesas_tpu12_pdata = {
188 .name = "V2513", 188 .name = "V2513",
189 .pin_gpio_fn = GPIO_FN_TPU1TO2, 189 .pin_gpio_fn = GPIO_FN_TPU1TO2,
190 .pin_gpio = GPIO_PORT153, 190 .pin_gpio = 153,
191 .channel_offset = 0x90, 191 .channel_offset = 0x90,
192 .timer_bit = 2, 192 .timer_bit = 2,
193 .max_brightness = 1000, 193 .max_brightness = 1000,
@@ -215,7 +215,7 @@ static struct platform_device leds_tpu12_device = {
215static struct led_renesas_tpu_config led_renesas_tpu41_pdata = { 215static struct led_renesas_tpu_config led_renesas_tpu41_pdata = {
216 .name = "V2514", 216 .name = "V2514",
217 .pin_gpio_fn = GPIO_FN_TPU4TO1, 217 .pin_gpio_fn = GPIO_FN_TPU4TO1,
218 .pin_gpio = GPIO_PORT199, 218 .pin_gpio = 199,
219 .channel_offset = 0x50, 219 .channel_offset = 0x50,
220 .timer_bit = 1, 220 .timer_bit = 1,
221 .max_brightness = 1000, 221 .max_brightness = 1000,
@@ -243,7 +243,7 @@ static struct platform_device leds_tpu41_device = {
243static struct led_renesas_tpu_config led_renesas_tpu21_pdata = { 243static struct led_renesas_tpu_config led_renesas_tpu21_pdata = {
244 .name = "V2515", 244 .name = "V2515",
245 .pin_gpio_fn = GPIO_FN_TPU2TO1, 245 .pin_gpio_fn = GPIO_FN_TPU2TO1,
246 .pin_gpio = GPIO_PORT197, 246 .pin_gpio = 197,
247 .channel_offset = 0x50, 247 .channel_offset = 0x50,
248 .timer_bit = 1, 248 .timer_bit = 1,
249 .max_brightness = 1000, 249 .max_brightness = 1000,
@@ -271,7 +271,7 @@ static struct platform_device leds_tpu21_device = {
271static struct led_renesas_tpu_config led_renesas_tpu30_pdata = { 271static struct led_renesas_tpu_config led_renesas_tpu30_pdata = {
272 .name = "KEYLED", 272 .name = "KEYLED",
273 .pin_gpio_fn = GPIO_FN_TPU3TO0, 273 .pin_gpio_fn = GPIO_FN_TPU3TO0,
274 .pin_gpio = GPIO_PORT163, 274 .pin_gpio = 163,
275 .channel_offset = 0x10, 275 .channel_offset = 0x10,
276 .timer_bit = 0, 276 .timer_bit = 0,
277 .max_brightness = 1000, 277 .max_brightness = 1000,
@@ -474,8 +474,8 @@ static void __init kota2_init(void)
474 gpio_request(GPIO_FN_D15_NAF15, NULL); 474 gpio_request(GPIO_FN_D15_NAF15, NULL);
475 gpio_request(GPIO_FN_CS5A_, NULL); 475 gpio_request(GPIO_FN_CS5A_, NULL);
476 gpio_request(GPIO_FN_WE0__FWE, NULL); 476 gpio_request(GPIO_FN_WE0__FWE, NULL);
477 gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */ 477 gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
478 gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */ 478 gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
479 479
480 /* KEYSC */ 480 /* KEYSC */
481 gpio_request(GPIO_FN_KEYIN0_PU, NULL); 481 gpio_request(GPIO_FN_KEYIN0_PU, NULL);
@@ -507,7 +507,7 @@ static void __init kota2_init(void)
507 gpio_request(GPIO_FN_MMCD0_6, NULL); 507 gpio_request(GPIO_FN_MMCD0_6, NULL);
508 gpio_request(GPIO_FN_MMCD0_7, NULL); 508 gpio_request(GPIO_FN_MMCD0_7, NULL);
509 gpio_request(GPIO_FN_MMCCMD0, NULL); 509 gpio_request(GPIO_FN_MMCCMD0, NULL);
510 gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */ 510 gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
511 511
512 /* SDHI0 (microSD) */ 512 /* SDHI0 (microSD) */
513 gpio_request(GPIO_FN_SDHICD0_PU, NULL); 513 gpio_request(GPIO_FN_SDHICD0_PU, NULL);
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 7f3a6b7e7b7c..65a5e0b80f06 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -433,7 +433,7 @@ static struct sh_mobile_sdhi_info sdhi2_info = {
433 TMIO_MMC_WRPROTECT_DISABLE, 433 TMIO_MMC_WRPROTECT_DISABLE,
434 .tmio_caps = MMC_CAP_SD_HIGHSPEED, 434 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
435 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, 435 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
436 .cd_gpio = GPIO_PORT13, 436 .cd_gpio = 13,
437}; 437};
438 438
439static struct resource sdhi2_resources[] = { 439static struct resource sdhi2_resources[] = {
@@ -672,7 +672,7 @@ static void __init kzm_init(void)
672 gpio_request(GPIO_FN_CS4_, NULL); /* CS4 */ 672 gpio_request(GPIO_FN_CS4_, NULL); /* CS4 */
673 673
674 /* SMSC */ 674 /* SMSC */
675 gpio_request_one(GPIO_PORT224, GPIOF_IN, NULL); /* IRQ3 */ 675 gpio_request_one(224, GPIOF_IN, NULL); /* IRQ3 */
676 676
677 /* LCDC */ 677 /* LCDC */
678 gpio_request(GPIO_FN_LCDD23, NULL); 678 gpio_request(GPIO_FN_LCDD23, NULL);
@@ -702,11 +702,11 @@ static void __init kzm_init(void)
702 gpio_request(GPIO_FN_LCDDISP, NULL); 702 gpio_request(GPIO_FN_LCDDISP, NULL);
703 gpio_request(GPIO_FN_LCDDCK, NULL); 703 gpio_request(GPIO_FN_LCDDCK, NULL);
704 704
705 gpio_request_one(GPIO_PORT222, GPIOF_OUT_INIT_HIGH, NULL); /* LCDCDON */ 705 gpio_request_one(222, GPIOF_OUT_INIT_HIGH, NULL); /* LCDCDON */
706 gpio_request_one(GPIO_PORT226, GPIOF_OUT_INIT_HIGH, NULL); /* SC */ 706 gpio_request_one(226, GPIOF_OUT_INIT_HIGH, NULL); /* SC */
707 707
708 /* Touchscreen */ 708 /* Touchscreen */
709 gpio_request_one(GPIO_PORT223, GPIOF_IN, NULL); /* IRQ8 */ 709 gpio_request_one(223, GPIOF_IN, NULL); /* IRQ8 */
710 710
711 /* enable MMCIF */ 711 /* enable MMCIF */
712 gpio_request(GPIO_FN_MMCCLK0, NULL); 712 gpio_request(GPIO_FN_MMCCLK0, NULL);
@@ -730,7 +730,7 @@ static void __init kzm_init(void)
730 gpio_request(GPIO_FN_SDHID0_1, NULL); 730 gpio_request(GPIO_FN_SDHID0_1, NULL);
731 gpio_request(GPIO_FN_SDHID0_0, NULL); 731 gpio_request(GPIO_FN_SDHID0_0, NULL);
732 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL); 732 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL);
733 gpio_request_one(GPIO_PORT15, GPIOF_OUT_INIT_HIGH, NULL); /* power */ 733 gpio_request_one(15, GPIOF_OUT_INIT_HIGH, NULL); /* power */
734 734
735 /* enable Micro SD */ 735 /* enable Micro SD */
736 gpio_request(GPIO_FN_SDHID2_0, NULL); 736 gpio_request(GPIO_FN_SDHID2_0, NULL);
@@ -739,7 +739,7 @@ static void __init kzm_init(void)
739 gpio_request(GPIO_FN_SDHID2_3, NULL); 739 gpio_request(GPIO_FN_SDHID2_3, NULL);
740 gpio_request(GPIO_FN_SDHICMD2, NULL); 740 gpio_request(GPIO_FN_SDHICMD2, NULL);
741 gpio_request(GPIO_FN_SDHICLK2, NULL); 741 gpio_request(GPIO_FN_SDHICLK2, NULL);
742 gpio_request_one(GPIO_PORT14, GPIOF_OUT_INIT_HIGH, NULL); /* power */ 742 gpio_request_one(14, GPIOF_OUT_INIT_HIGH, NULL); /* power */
743 743
744 /* I2C 3 */ 744 /* I2C 3 */
745 gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL); 745 gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL);
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
index 606d31d02a4e..4dca135f3aa8 100644
--- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
@@ -94,7 +94,7 @@ enum {
94 GPIO_PORT305, GPIO_PORT306, GPIO_PORT307, GPIO_PORT308, GPIO_PORT309, 94 GPIO_PORT305, GPIO_PORT306, GPIO_PORT307, GPIO_PORT308, GPIO_PORT309,
95 95
96 /* Table 25-1 (Function 0-7) */ 96 /* Table 25-1 (Function 0-7) */
97 GPIO_FN_VBUS_0, 97 GPIO_FN_VBUS_0 = 310,
98 GPIO_FN_GPI0, 98 GPIO_FN_GPI0,
99 GPIO_FN_GPI1, 99 GPIO_FN_GPI1,
100 GPIO_FN_GPI2, 100 GPIO_FN_GPI2,