aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-01-31 22:35:21 -0500
committerOlof Johansson <olof@lixom.net>2013-01-31 22:35:51 -0500
commit4177a7c586e74511b1571063eeaa2ba62ab8af04 (patch)
tree25df1441909ec167d56393ecf2a7c47af9cad84e
parent72e510e88175a0c3a84f6b9bbe3530b80d920171 (diff)
parent2f27c40656fecba44e839c77910f75ee1024df62 (diff)
Merge tag 'renesas-boards2-for-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/boards
From Simon Horman: Second round of Renesas ARM-based SoC board changes for v3.9 * Fix to correct timer initialisation on the armadillo 800 eva board from Hideki EIRAKU * The remaining of the changes relate to updating boards to make use of gpio_request_one(). These changes are from Laurent Pinchart. * tag 'renesas-boards2-for-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: armadillo800eva: set clock rates before timer init ARM: shmobile: mackerel: Use gpio_request_one() ARM: shmobile: kzm9g: Use gpio_request_one() ARM: shmobile: bonito: Use gpio_request_one() ARM: shmobile: kota2: Use gpio_request_one() ARM: shmobile: armadillo800eva: Use gpio_set_value() to set GPIO value ARM: shmobile: armadillo800eva: Use gpio_request_one() ARM: shmobile: ap4evb: Use gpio_request_one() ARM: shmobile: ag5evm: Use gpio_request_one() Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c22
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c33
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c57
-rw-r--r--arch/arm/mach-shmobile/board-bonito.c7
-rw-r--r--arch/arm/mach-shmobile/board-kota2.c9
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c18
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c16
7 files changed, 57 insertions, 105 deletions
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 032d10817e79..5e7fe157f5a6 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -479,11 +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(GPIO_PORT114, "sdhi1_power"); 482 int ret = gpio_request_one(GPIO_PORT114, GPIOF_OUT_INIT_LOW,
483 if (!ret) { 483 "sdhi1_power");
484 if (!ret)
484 power_gpio = GPIO_PORT114; 485 power_gpio = GPIO_PORT114;
485 gpio_direction_output(power_gpio, 0);
486 }
487 } 486 }
488 487
489 /* 488 /*
@@ -604,14 +603,11 @@ static void __init ag5evm_init(void)
604 gpio_request(GPIO_FN_MMCD0_5_PU, NULL); 603 gpio_request(GPIO_FN_MMCD0_5_PU, NULL);
605 gpio_request(GPIO_FN_MMCD0_6_PU, NULL); 604 gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
606 gpio_request(GPIO_FN_MMCD0_7_PU, NULL); 605 gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
607 gpio_request(GPIO_PORT208, NULL); /* Reset */ 606 gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
608 gpio_direction_output(GPIO_PORT208, 1);
609 607
610 /* enable SMSC911X */ 608 /* enable SMSC911X */
611 gpio_request(GPIO_PORT144, NULL); /* PINTA2 */ 609 gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */
612 gpio_direction_input(GPIO_PORT144); 610 gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
613 gpio_request(GPIO_PORT145, NULL); /* RESET */
614 gpio_direction_output(GPIO_PORT145, 1);
615 611
616 /* FSI A */ 612 /* FSI A */
617 gpio_request(GPIO_FN_FSIACK, NULL); 613 gpio_request(GPIO_FN_FSIACK, NULL);
@@ -626,15 +622,13 @@ static void __init ag5evm_init(void)
626 gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL); 622 gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL);
627 623
628 /* LCD panel */ 624 /* LCD panel */
629 gpio_request(GPIO_PORT217, NULL); /* RESET */ 625 gpio_request_one(GPIO_PORT217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
630 gpio_direction_output(GPIO_PORT217, 0);
631 mdelay(1); 626 mdelay(1);
632 gpio_set_value(GPIO_PORT217, 1); 627 gpio_set_value(GPIO_PORT217, 1);
633 mdelay(100); 628 mdelay(100);
634 629
635 /* LCD backlight controller */ 630 /* LCD backlight controller */
636 gpio_request(GPIO_PORT235, NULL); /* RESET */ 631 gpio_request_one(GPIO_PORT235, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
637 gpio_direction_output(GPIO_PORT235, 0);
638 lcd_backlight_set_brightness(0); 632 lcd_backlight_set_brightness(0);
639 633
640 /* enable SDHI0 on CN15 [SD I/F] */ 634 /* enable SDHI0 on CN15 [SD I/F] */
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 70d287c28a62..0c59464230fb 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -1046,9 +1046,7 @@ static int ts_get_pendown_state(void)
1046 1046
1047 gpio_free(GPIO_TSC_IRQ); 1047 gpio_free(GPIO_TSC_IRQ);
1048 1048
1049 gpio_request(GPIO_TSC_PORT, NULL); 1049 gpio_request_one(GPIO_TSC_PORT, GPIOF_IN, NULL);
1050
1051 gpio_direction_input(GPIO_TSC_PORT);
1052 1050
1053 val = gpio_get_value(GPIO_TSC_PORT); 1051 val = gpio_get_value(GPIO_TSC_PORT);
1054 1052
@@ -1129,18 +1127,10 @@ static void __init ap4evb_init(void)
1129 gpio_request(GPIO_FN_IRQ6_39, NULL); 1127 gpio_request(GPIO_FN_IRQ6_39, NULL);
1130 1128
1131 /* enable Debug switch (S6) */ 1129 /* enable Debug switch (S6) */
1132 gpio_request(GPIO_PORT32, NULL); 1130 gpio_request_one(GPIO_PORT32, GPIOF_IN | GPIOF_EXPORT, NULL);
1133 gpio_request(GPIO_PORT33, NULL); 1131 gpio_request_one(GPIO_PORT33, GPIOF_IN | GPIOF_EXPORT, NULL);
1134 gpio_request(GPIO_PORT34, NULL); 1132 gpio_request_one(GPIO_PORT34, GPIOF_IN | GPIOF_EXPORT, NULL);
1135 gpio_request(GPIO_PORT35, NULL); 1133 gpio_request_one(GPIO_PORT35, GPIOF_IN | GPIOF_EXPORT, NULL);
1136 gpio_direction_input(GPIO_PORT32);
1137 gpio_direction_input(GPIO_PORT33);
1138 gpio_direction_input(GPIO_PORT34);
1139 gpio_direction_input(GPIO_PORT35);
1140 gpio_export(GPIO_PORT32, 0);
1141 gpio_export(GPIO_PORT33, 0);
1142 gpio_export(GPIO_PORT34, 0);
1143 gpio_export(GPIO_PORT35, 0);
1144 1134
1145 /* SDHI0 */ 1135 /* SDHI0 */
1146 gpio_request(GPIO_FN_SDHICD0, NULL); 1136 gpio_request(GPIO_FN_SDHICD0, NULL);
@@ -1188,8 +1178,7 @@ static void __init ap4evb_init(void)
1188 gpio_request(GPIO_FN_FSIAILR, NULL); 1178 gpio_request(GPIO_FN_FSIAILR, NULL);
1189 gpio_request(GPIO_FN_FSIAISLD, NULL); 1179 gpio_request(GPIO_FN_FSIAISLD, NULL);
1190 gpio_request(GPIO_FN_FSIAOSLD, NULL); 1180 gpio_request(GPIO_FN_FSIAOSLD, NULL);
1191 gpio_request(GPIO_PORT161, NULL); 1181 gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL); /* slave */
1192 gpio_direction_output(GPIO_PORT161, 0); /* slave */
1193 1182
1194 gpio_request(GPIO_PORT9, NULL); 1183 gpio_request(GPIO_PORT9, NULL);
1195 gpio_request(GPIO_PORT10, NULL); 1184 gpio_request(GPIO_PORT10, NULL);
@@ -1197,8 +1186,7 @@ static void __init ap4evb_init(void)
1197 gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */ 1186 gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */
1198 1187
1199 /* card detect pin for MMC slot (CN7) */ 1188 /* card detect pin for MMC slot (CN7) */
1200 gpio_request(GPIO_PORT41, NULL); 1189 gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL);
1201 gpio_direction_input(GPIO_PORT41);
1202 1190
1203 /* setup FSI2 port B (HDMI) */ 1191 /* setup FSI2 port B (HDMI) */
1204 gpio_request(GPIO_FN_FSIBCK, NULL); 1192 gpio_request(GPIO_FN_FSIBCK, NULL);
@@ -1286,11 +1274,8 @@ static void __init ap4evb_init(void)
1286 gpio_request(GPIO_FN_LCDDISP, NULL); 1274 gpio_request(GPIO_FN_LCDDISP, NULL);
1287 gpio_request(GPIO_FN_LCDDCK, NULL); 1275 gpio_request(GPIO_FN_LCDDCK, NULL);
1288 1276
1289 gpio_request(GPIO_PORT189, NULL); /* backlight */ 1277 gpio_request_one(GPIO_PORT189, GPIOF_OUT_INIT_HIGH, NULL); /* backlight */
1290 gpio_direction_output(GPIO_PORT189, 1); 1278 gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
1291
1292 gpio_request(GPIO_PORT151, NULL); /* LCDDON */
1293 gpio_direction_output(GPIO_PORT151, 1);
1294 1279
1295 lcdc_info.clock_source = LCDC_CLK_BUS; 1280 lcdc_info.clock_source = LCDC_CLK_BUS;
1296 lcdc_info.ch[0].interface_type = RGB18; 1281 lcdc_info.ch[0].interface_type = RGB18;
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 5f179e1cb157..9008ad102a88 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -708,9 +708,9 @@ static int mt9t111_power(struct device *dev, int mode)
708 /* video1 (= CON1 camera) expect 24MHz */ 708 /* video1 (= CON1 camera) expect 24MHz */
709 clk_set_rate(mclk, clk_round_rate(mclk, 24000000)); 709 clk_set_rate(mclk, clk_round_rate(mclk, 24000000));
710 clk_enable(mclk); 710 clk_enable(mclk);
711 gpio_direction_output(GPIO_PORT158, 1); 711 gpio_set_value(GPIO_PORT158, 1);
712 } else { 712 } else {
713 gpio_direction_output(GPIO_PORT158, 0); 713 gpio_set_value(GPIO_PORT158, 0);
714 clk_disable(mclk); 714 clk_disable(mclk);
715 } 715 }
716 716
@@ -1000,16 +1000,12 @@ static void __init eva_init(void)
1000 gpio_request(GPIO_FN_LCD0_DISP, NULL); 1000 gpio_request(GPIO_FN_LCD0_DISP, NULL);
1001 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL); 1001 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL);
1002 1002
1003 gpio_request(GPIO_PORT61, NULL); /* LCDDON */ 1003 gpio_request_one(GPIO_PORT61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
1004 gpio_direction_output(GPIO_PORT61, 1); 1004 gpio_request_one(GPIO_PORT202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */
1005
1006 gpio_request(GPIO_PORT202, NULL); /* LCD0_LED_CONT */
1007 gpio_direction_output(GPIO_PORT202, 0);
1008 1005
1009 /* Touchscreen */ 1006 /* Touchscreen */
1010 gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */ 1007 gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */
1011 gpio_request(GPIO_PORT166, NULL); /* TP_RST_B */ 1008 gpio_request_one(GPIO_PORT166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */
1012 gpio_direction_output(GPIO_PORT166, 1);
1013 1009
1014 /* GETHER */ 1010 /* GETHER */
1015 gpio_request(GPIO_FN_ET_CRS, NULL); 1011 gpio_request(GPIO_FN_ET_CRS, NULL);
@@ -1032,12 +1028,10 @@ static void __init eva_init(void)
1032 gpio_request(GPIO_FN_ET_RX_DV, NULL); 1028 gpio_request(GPIO_FN_ET_RX_DV, NULL);
1033 gpio_request(GPIO_FN_ET_RX_CLK, NULL); 1029 gpio_request(GPIO_FN_ET_RX_CLK, NULL);
1034 1030
1035 gpio_request(GPIO_PORT18, NULL); /* PHY_RST */ 1031 gpio_request_one(GPIO_PORT18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */
1036 gpio_direction_output(GPIO_PORT18, 1);
1037 1032
1038 /* USB */ 1033 /* USB */
1039 gpio_request(GPIO_PORT159, NULL); /* USB_DEVICE_MODE */ 1034 gpio_request_one(GPIO_PORT159, GPIOF_IN, NULL); /* USB_DEVICE_MODE */
1040 gpio_direction_input(GPIO_PORT159);
1041 1035
1042 if (gpio_get_value(GPIO_PORT159)) { 1036 if (gpio_get_value(GPIO_PORT159)) {
1043 /* USB Host */ 1037 /* USB Host */
@@ -1051,8 +1045,7 @@ static void __init eva_init(void)
1051 * and select GPIO_PORT209 here 1045 * and select GPIO_PORT209 here
1052 */ 1046 */
1053 gpio_request(GPIO_FN_IRQ7_PORT209, NULL); 1047 gpio_request(GPIO_FN_IRQ7_PORT209, NULL);
1054 gpio_request(GPIO_PORT209, NULL); 1048 gpio_request_one(GPIO_PORT209, GPIOF_IN, NULL);
1055 gpio_direction_input(GPIO_PORT209);
1056 1049
1057 platform_device_register(&usbhsf_device); 1050 platform_device_register(&usbhsf_device);
1058 usb = &usbhsf_device; 1051 usb = &usbhsf_device;
@@ -1067,12 +1060,9 @@ static void __init eva_init(void)
1067 gpio_request(GPIO_FN_SDHI0_D3, NULL); 1060 gpio_request(GPIO_FN_SDHI0_D3, NULL);
1068 gpio_request(GPIO_FN_SDHI0_WP, NULL); 1061 gpio_request(GPIO_FN_SDHI0_WP, NULL);
1069 1062
1070 gpio_request(GPIO_PORT17, NULL); /* SDHI0_18/33_B */ 1063 gpio_request_one(GPIO_PORT17, GPIOF_OUT_INIT_LOW, NULL); /* SDHI0_18/33_B */
1071 gpio_request(GPIO_PORT74, NULL); /* SDHI0_PON */ 1064 gpio_request_one(GPIO_PORT74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */
1072 gpio_request(GPIO_PORT75, NULL); /* SDSLOT1_PON */ 1065 gpio_request_one(GPIO_PORT75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */
1073 gpio_direction_output(GPIO_PORT17, 0);
1074 gpio_direction_output(GPIO_PORT74, 1);
1075 gpio_direction_output(GPIO_PORT75, 1);
1076 1066
1077 /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */ 1067 /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */
1078 1068
@@ -1109,12 +1099,10 @@ static void __init eva_init(void)
1109 gpio_request(GPIO_FN_VIO_CKO, NULL); 1099 gpio_request(GPIO_FN_VIO_CKO, NULL);
1110 1100
1111 /* CON1/CON15 Camera */ 1101 /* CON1/CON15 Camera */
1112 gpio_request(GPIO_PORT173, NULL); /* STANDBY */ 1102 gpio_request_one(GPIO_PORT173, GPIOF_OUT_INIT_LOW, NULL); /* STANDBY */
1113 gpio_request(GPIO_PORT172, NULL); /* RST */ 1103 gpio_request_one(GPIO_PORT172, GPIOF_OUT_INIT_HIGH, NULL); /* RST */
1114 gpio_request(GPIO_PORT158, NULL); /* CAM_PON */ 1104 /* see mt9t111_power() */
1115 gpio_direction_output(GPIO_PORT173, 0); 1105 gpio_request_one(GPIO_PORT158, GPIOF_OUT_INIT_LOW, NULL); /* CAM_PON */
1116 gpio_direction_output(GPIO_PORT172, 1);
1117 gpio_direction_output(GPIO_PORT158, 0); /* see mt9t111_power() */
1118 1106
1119 /* FSI-WM8978 */ 1107 /* FSI-WM8978 */
1120 gpio_request(GPIO_FN_FSIAIBT, NULL); 1108 gpio_request(GPIO_FN_FSIAIBT, NULL);
@@ -1141,15 +1129,13 @@ static void __init eva_init(void)
1141 * DBGMD/LCDC0/FSIA MUX 1129 * DBGMD/LCDC0/FSIA MUX
1142 * DBGMD_SELECT_B should be set after setting PFC Function. 1130 * DBGMD_SELECT_B should be set after setting PFC Function.
1143 */ 1131 */
1144 gpio_request(GPIO_PORT176, NULL); 1132 gpio_request_one(GPIO_PORT176, GPIOF_OUT_INIT_HIGH, NULL);
1145 gpio_direction_output(GPIO_PORT176, 1);
1146 1133
1147 /* 1134 /*
1148 * We can switch CON8/CON14 by SW1.5, 1135 * We can switch CON8/CON14 by SW1.5,
1149 * but it needs after DBGMD_SELECT_B 1136 * but it needs after DBGMD_SELECT_B
1150 */ 1137 */
1151 gpio_request(GPIO_PORT6, NULL); 1138 gpio_request_one(GPIO_PORT6, GPIOF_IN, NULL);
1152 gpio_direction_input(GPIO_PORT6);
1153 if (gpio_get_value(GPIO_PORT6)) { 1139 if (gpio_get_value(GPIO_PORT6)) {
1154 /* CON14 enable */ 1140 /* CON14 enable */
1155 } else { 1141 } else {
@@ -1163,8 +1149,8 @@ static void __init eva_init(void)
1163 gpio_request(GPIO_FN_SDHI1_CD, NULL); 1149 gpio_request(GPIO_FN_SDHI1_CD, NULL);
1164 gpio_request(GPIO_FN_SDHI1_WP, NULL); 1150 gpio_request(GPIO_FN_SDHI1_WP, NULL);
1165 1151
1166 gpio_request(GPIO_PORT16, NULL); /* SDSLOT2_PON */ 1152 /* SDSLOT2_PON */
1167 gpio_direction_output(GPIO_PORT16, 1); 1153 gpio_request_one(GPIO_PORT16, GPIOF_OUT_INIT_HIGH, NULL);
1168 1154
1169 platform_device_register(&sdhi1_device); 1155 platform_device_register(&sdhi1_device);
1170 } 1156 }
@@ -1183,8 +1169,6 @@ static void __init eva_init(void)
1183 platform_add_devices(eva_devices, 1169 platform_add_devices(eva_devices,
1184 ARRAY_SIZE(eva_devices)); 1170 ARRAY_SIZE(eva_devices));
1185 1171
1186 eva_clock_init();
1187
1188 rmobile_add_device_to_domain("A4LC", &lcdc0_device); 1172 rmobile_add_device_to_domain("A4LC", &lcdc0_device);
1189 rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device); 1173 rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device);
1190 if (usb) 1174 if (usb)
@@ -1195,6 +1179,9 @@ static void __init eva_earlytimer_init(void)
1195{ 1179{
1196 r8a7740_clock_init(MD_CK0 | MD_CK2); 1180 r8a7740_clock_init(MD_CK0 | MD_CK2);
1197 shmobile_earlytimer_init(); 1181 shmobile_earlytimer_init();
1182
1183 /* the rate of extal1 clock must be set before late_time_init */
1184 eva_clock_init();
1198} 1185}
1199 1186
1200static void __init eva_add_early_devices(void) 1187static void __init eva_add_early_devices(void)
diff --git a/arch/arm/mach-shmobile/board-bonito.c b/arch/arm/mach-shmobile/board-bonito.c
index cb8c994e1430..932a9c0926bc 100644
--- a/arch/arm/mach-shmobile/board-bonito.c
+++ b/arch/arm/mach-shmobile/board-bonito.c
@@ -392,8 +392,7 @@ static void __init bonito_init(void)
392 /* 392 /*
393 * base board settings 393 * base board settings
394 */ 394 */
395 gpio_request(GPIO_PORT176, NULL); 395 gpio_request_one(GPIO_PORT176, GPIOF_IN, NULL);
396 gpio_direction_input(GPIO_PORT176);
397 if (!gpio_get_value(GPIO_PORT176)) { 396 if (!gpio_get_value(GPIO_PORT176)) {
398 u16 bsw2; 397 u16 bsw2;
399 u16 bsw3; 398 u16 bsw3;
@@ -462,8 +461,8 @@ static void __init bonito_init(void)
462 gpio_request(GPIO_FN_LCD0_DISP, NULL); 461 gpio_request(GPIO_FN_LCD0_DISP, NULL);
463 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL); 462 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL);
464 463
465 gpio_request(GPIO_PORT61, NULL); /* LCDDON */ 464 gpio_request_one(GPIO_PORT61, GPIOF_OUT_INIT_HIGH,
466 gpio_direction_output(GPIO_PORT61, 1); 465 NULL); /* LCDDON */
467 466
468 /* backlight on */ 467 /* backlight on */
469 bonito_fpga_write(LCDCR, 1); 468 bonito_fpga_write(LCDCR, 1);
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c
index bf88f9a8b7ac..7ec3112e971f 100644
--- a/arch/arm/mach-shmobile/board-kota2.c
+++ b/arch/arm/mach-shmobile/board-kota2.c
@@ -474,10 +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(GPIO_PORT144, NULL); /* PINTA2 */ 477 gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */
478 gpio_direction_input(GPIO_PORT144); 478 gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
479 gpio_request(GPIO_PORT145, NULL); /* RESET */
480 gpio_direction_output(GPIO_PORT145, 1);
481 479
482 /* KEYSC */ 480 /* KEYSC */
483 gpio_request(GPIO_FN_KEYIN0_PU, NULL); 481 gpio_request(GPIO_FN_KEYIN0_PU, NULL);
@@ -509,8 +507,7 @@ static void __init kota2_init(void)
509 gpio_request(GPIO_FN_MMCD0_6, NULL); 507 gpio_request(GPIO_FN_MMCD0_6, NULL);
510 gpio_request(GPIO_FN_MMCD0_7, NULL); 508 gpio_request(GPIO_FN_MMCD0_7, NULL);
511 gpio_request(GPIO_FN_MMCCMD0, NULL); 509 gpio_request(GPIO_FN_MMCCMD0, NULL);
512 gpio_request(GPIO_PORT208, NULL); /* Reset */ 510 gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
513 gpio_direction_output(GPIO_PORT208, 1);
514 511
515 /* SDHI0 (microSD) */ 512 /* SDHI0 (microSD) */
516 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 eadf309dd473..2d08f57631d0 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -672,8 +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(GPIO_PORT224, NULL); /* IRQ3 */ 675 gpio_request_one(GPIO_PORT224, GPIOF_IN, NULL); /* IRQ3 */
676 gpio_direction_input(GPIO_PORT224);
677 676
678 /* LCDC */ 677 /* LCDC */
679 gpio_request(GPIO_FN_LCDD23, NULL); 678 gpio_request(GPIO_FN_LCDD23, NULL);
@@ -703,14 +702,11 @@ static void __init kzm_init(void)
703 gpio_request(GPIO_FN_LCDDISP, NULL); 702 gpio_request(GPIO_FN_LCDDISP, NULL);
704 gpio_request(GPIO_FN_LCDDCK, NULL); 703 gpio_request(GPIO_FN_LCDDCK, NULL);
705 704
706 gpio_request(GPIO_PORT222, NULL); /* LCDCDON */ 705 gpio_request_one(GPIO_PORT222, GPIOF_OUT_INIT_HIGH, NULL); /* LCDCDON */
707 gpio_request(GPIO_PORT226, NULL); /* SC */ 706 gpio_request_one(GPIO_PORT226, GPIOF_OUT_INIT_HIGH, NULL); /* SC */
708 gpio_direction_output(GPIO_PORT222, 1);
709 gpio_direction_output(GPIO_PORT226, 1);
710 707
711 /* Touchscreen */ 708 /* Touchscreen */
712 gpio_request(GPIO_PORT223, NULL); /* IRQ8 */ 709 gpio_request_one(GPIO_PORT223, GPIOF_IN, NULL); /* IRQ8 */
713 gpio_direction_input(GPIO_PORT223);
714 710
715 /* enable MMCIF */ 711 /* enable MMCIF */
716 gpio_request(GPIO_FN_MMCCLK0, NULL); 712 gpio_request(GPIO_FN_MMCCLK0, NULL);
@@ -734,8 +730,7 @@ static void __init kzm_init(void)
734 gpio_request(GPIO_FN_SDHID0_1, NULL); 730 gpio_request(GPIO_FN_SDHID0_1, NULL);
735 gpio_request(GPIO_FN_SDHID0_0, NULL); 731 gpio_request(GPIO_FN_SDHID0_0, NULL);
736 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL); 732 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL);
737 gpio_request(GPIO_PORT15, NULL); 733 gpio_request_one(GPIO_PORT15, GPIOF_OUT_INIT_HIGH, NULL); /* power */
738 gpio_direction_output(GPIO_PORT15, 1); /* power */
739 734
740 /* enable Micro SD */ 735 /* enable Micro SD */
741 gpio_request(GPIO_FN_SDHID2_0, NULL); 736 gpio_request(GPIO_FN_SDHID2_0, NULL);
@@ -744,8 +739,7 @@ static void __init kzm_init(void)
744 gpio_request(GPIO_FN_SDHID2_3, NULL); 739 gpio_request(GPIO_FN_SDHID2_3, NULL);
745 gpio_request(GPIO_FN_SDHICMD2, NULL); 740 gpio_request(GPIO_FN_SDHICMD2, NULL);
746 gpio_request(GPIO_FN_SDHICLK2, NULL); 741 gpio_request(GPIO_FN_SDHICLK2, NULL);
747 gpio_request(GPIO_PORT14, NULL); 742 gpio_request_one(GPIO_PORT14, GPIOF_OUT_INIT_HIGH, NULL); /* power */
748 gpio_direction_output(GPIO_PORT14, 1); /* power */
749 743
750 /* I2C 3 */ 744 /* I2C 3 */
751 gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL); 745 gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL);
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 002eaf689f8f..8de350fe2a97 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1406,11 +1406,10 @@ static void __init mackerel_init(void)
1406 gpio_request(GPIO_FN_LCDDISP, NULL); 1406 gpio_request(GPIO_FN_LCDDISP, NULL);
1407 gpio_request(GPIO_FN_LCDDCK, NULL); 1407 gpio_request(GPIO_FN_LCDDCK, NULL);
1408 1408
1409 gpio_request(GPIO_PORT31, NULL); /* backlight */ 1409 /* backlight, off by default */
1410 gpio_direction_output(GPIO_PORT31, 0); /* off by default */ 1410 gpio_request_one(GPIO_PORT31, GPIOF_OUT_INIT_LOW, NULL);
1411 1411
1412 gpio_request(GPIO_PORT151, NULL); /* LCDDON */ 1412 gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
1413 gpio_direction_output(GPIO_PORT151, 1);
1414 1413
1415 /* USBHS0 */ 1414 /* USBHS0 */
1416 gpio_request(GPIO_FN_VBUS0_0, NULL); 1415 gpio_request(GPIO_FN_VBUS0_0, NULL);
@@ -1426,8 +1425,7 @@ static void __init mackerel_init(void)
1426 gpio_request(GPIO_FN_FSIAILR, NULL); 1425 gpio_request(GPIO_FN_FSIAILR, NULL);
1427 gpio_request(GPIO_FN_FSIAISLD, NULL); 1426 gpio_request(GPIO_FN_FSIAISLD, NULL);
1428 gpio_request(GPIO_FN_FSIAOSLD, NULL); 1427 gpio_request(GPIO_FN_FSIAOSLD, NULL);
1429 gpio_request(GPIO_PORT161, NULL); 1428 gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL); /* slave */
1430 gpio_direction_output(GPIO_PORT161, 0); /* slave */
1431 1429
1432 gpio_request(GPIO_PORT9, NULL); 1430 gpio_request(GPIO_PORT9, NULL);
1433 gpio_request(GPIO_PORT10, NULL); 1431 gpio_request(GPIO_PORT10, NULL);
@@ -1481,8 +1479,7 @@ static void __init mackerel_init(void)
1481 gpio_request(GPIO_FN_SDHID1_0, NULL); 1479 gpio_request(GPIO_FN_SDHID1_0, NULL);
1482#endif 1480#endif
1483 /* card detect pin for MMC slot (CN7) */ 1481 /* card detect pin for MMC slot (CN7) */
1484 gpio_request(GPIO_PORT41, NULL); 1482 gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL);
1485 gpio_direction_input(GPIO_PORT41);
1486 1483
1487 /* enable SDHI2 */ 1484 /* enable SDHI2 */
1488 gpio_request(GPIO_FN_SDHICMD2, NULL); 1485 gpio_request(GPIO_FN_SDHICMD2, NULL);
@@ -1493,8 +1490,7 @@ static void __init mackerel_init(void)
1493 gpio_request(GPIO_FN_SDHID2_0, NULL); 1490 gpio_request(GPIO_FN_SDHID2_0, NULL);
1494 1491
1495 /* card detect pin for microSD slot (CN23) */ 1492 /* card detect pin for microSD slot (CN23) */
1496 gpio_request(GPIO_PORT162, NULL); 1493 gpio_request_one(GPIO_PORT162, GPIOF_IN, NULL);
1497 gpio_direction_input(GPIO_PORT162);
1498 1494
1499 /* MMCIF */ 1495 /* MMCIF */
1500 gpio_request(GPIO_FN_MMCD0_0, NULL); 1496 gpio_request(GPIO_FN_MMCD0_0, NULL);