aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 18:33:45 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 18:33:45 -0500
commit6c5096e5538b455bc3bea2b02588c380f070d8c6 (patch)
treea2d08974a0c6a6fd19dff90bd3ab1827c23a5764 /arch/arm/mach-shmobile
parentbab588fcfb6335c767d811a8955979f5440328e0 (diff)
parentf628e3d92465303792d52c98fb0c95bef558f936 (diff)
Merge tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC board specific changes from Arnd Bergmann: "These updates are all for board specific code, including - defconfig updates for shmobile, davinci, bcm2835, imx, omap and tegra - SD/MMC and I2C support on bcm2835 (Raspberry PI) - minor updates for PXA - shmobile updates to GPIO usage in board files - More things in OMAP board files are moved over to device tree probing - Better support for audio devices on some OMAP platforms" * tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (55 commits) ARM: imx_v4_v5_defconfig: Add VPU support ARM: imx: configs: enable netfilter support ARM: OMAP2+: Fix twl section warnings related to omap_twl4030_audio_init ARM: OMAP2+: omap2plus_defconfig: enable omap1 rtc RX-51: Register twl4030-madc device RX-51: Add leds lp5523 names from Maemo 5 2.6.28 kernel ARM: OMAP2+: AM33XX: omap2plus_defconfig: Add support for few drivers ARM: OMAP1: nokia770: enable CBUS/Retu ARM: OMAP2+: omap2plus_defconfig: enable CMA allocator ARM: OMAP2+: omap2plus_defconfig: enable TFP410 chip support ARM: OMAP3: igep0020: simplify GPIO LEDs dependencies ARM: OMAP2+: craneboard: support the TPS65910 PMU ARM: OMAP2+: craneboard: support NAND device ARM: OMAP3: cm-t3517: add MMC support ARM: OMAP2+: Remove apollon board support ARM: shmobile: armadillo800eva: set clock rates before timer init ARM: tegra: defconfig updates ARM: shmobile: mackerel: Use gpio_request_one() ARM: shmobile: kzm9g: Use gpio_request_one() ARM: shmobile: bonito: Use gpio_request_one() ...
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c22
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c37
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c65
-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.c20
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c20
7 files changed, 71 insertions, 109 deletions
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 705bc63c7984..8ff53a19c48c 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 2928cd686808..38f1259a0daf 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -143,6 +143,10 @@
143 * 143 *
144 * SW41 : ON : SH-Mobile AP4 Audio Mode 144 * SW41 : ON : SH-Mobile AP4 Audio Mode
145 * : OFF : Bluetooth Audio Mode 145 * : OFF : Bluetooth Audio Mode
146 *
147 * it needs amixer settings for playing
148 *
149 * amixer set "Headphone Enable" on
146 */ 150 */
147 151
148/* 152/*
@@ -1036,9 +1040,7 @@ static int ts_get_pendown_state(void)
1036 1040
1037 gpio_free(GPIO_TSC_IRQ); 1041 gpio_free(GPIO_TSC_IRQ);
1038 1042
1039 gpio_request(GPIO_TSC_PORT, NULL); 1043 gpio_request_one(GPIO_TSC_PORT, GPIOF_IN, NULL);
1040
1041 gpio_direction_input(GPIO_TSC_PORT);
1042 1044
1043 val = gpio_get_value(GPIO_TSC_PORT); 1045 val = gpio_get_value(GPIO_TSC_PORT);
1044 1046
@@ -1119,18 +1121,10 @@ static void __init ap4evb_init(void)
1119 gpio_request(GPIO_FN_IRQ6_39, NULL); 1121 gpio_request(GPIO_FN_IRQ6_39, NULL);
1120 1122
1121 /* enable Debug switch (S6) */ 1123 /* enable Debug switch (S6) */
1122 gpio_request(GPIO_PORT32, NULL); 1124 gpio_request_one(GPIO_PORT32, GPIOF_IN | GPIOF_EXPORT, NULL);
1123 gpio_request(GPIO_PORT33, NULL); 1125 gpio_request_one(GPIO_PORT33, GPIOF_IN | GPIOF_EXPORT, NULL);
1124 gpio_request(GPIO_PORT34, NULL); 1126 gpio_request_one(GPIO_PORT34, GPIOF_IN | GPIOF_EXPORT, NULL);
1125 gpio_request(GPIO_PORT35, NULL); 1127 gpio_request_one(GPIO_PORT35, GPIOF_IN | GPIOF_EXPORT, NULL);
1126 gpio_direction_input(GPIO_PORT32);
1127 gpio_direction_input(GPIO_PORT33);
1128 gpio_direction_input(GPIO_PORT34);
1129 gpio_direction_input(GPIO_PORT35);
1130 gpio_export(GPIO_PORT32, 0);
1131 gpio_export(GPIO_PORT33, 0);
1132 gpio_export(GPIO_PORT34, 0);
1133 gpio_export(GPIO_PORT35, 0);
1134 1128
1135 /* SDHI0 */ 1129 /* SDHI0 */
1136 gpio_request(GPIO_FN_SDHICD0, NULL); 1130 gpio_request(GPIO_FN_SDHICD0, NULL);
@@ -1178,8 +1172,7 @@ static void __init ap4evb_init(void)
1178 gpio_request(GPIO_FN_FSIAILR, NULL); 1172 gpio_request(GPIO_FN_FSIAILR, NULL);
1179 gpio_request(GPIO_FN_FSIAISLD, NULL); 1173 gpio_request(GPIO_FN_FSIAISLD, NULL);
1180 gpio_request(GPIO_FN_FSIAOSLD, NULL); 1174 gpio_request(GPIO_FN_FSIAOSLD, NULL);
1181 gpio_request(GPIO_PORT161, NULL); 1175 gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL); /* slave */
1182 gpio_direction_output(GPIO_PORT161, 0); /* slave */
1183 1176
1184 gpio_request(GPIO_PORT9, NULL); 1177 gpio_request(GPIO_PORT9, NULL);
1185 gpio_request(GPIO_PORT10, NULL); 1178 gpio_request(GPIO_PORT10, NULL);
@@ -1187,8 +1180,7 @@ static void __init ap4evb_init(void)
1187 gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */ 1180 gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */
1188 1181
1189 /* card detect pin for MMC slot (CN7) */ 1182 /* card detect pin for MMC slot (CN7) */
1190 gpio_request(GPIO_PORT41, NULL); 1183 gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL);
1191 gpio_direction_input(GPIO_PORT41);
1192 1184
1193 /* setup FSI2 port B (HDMI) */ 1185 /* setup FSI2 port B (HDMI) */
1194 gpio_request(GPIO_FN_FSIBCK, NULL); 1186 gpio_request(GPIO_FN_FSIBCK, NULL);
@@ -1276,11 +1268,8 @@ static void __init ap4evb_init(void)
1276 gpio_request(GPIO_FN_LCDDISP, NULL); 1268 gpio_request(GPIO_FN_LCDDISP, NULL);
1277 gpio_request(GPIO_FN_LCDDCK, NULL); 1269 gpio_request(GPIO_FN_LCDDCK, NULL);
1278 1270
1279 gpio_request(GPIO_PORT189, NULL); /* backlight */ 1271 gpio_request_one(GPIO_PORT189, GPIOF_OUT_INIT_HIGH, NULL); /* backlight */
1280 gpio_direction_output(GPIO_PORT189, 1); 1272 gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
1281
1282 gpio_request(GPIO_PORT151, NULL); /* LCDDON */
1283 gpio_direction_output(GPIO_PORT151, 1);
1284 1273
1285 lcdc_info.clock_source = LCDC_CLK_BUS; 1274 lcdc_info.clock_source = LCDC_CLK_BUS;
1286 lcdc_info.ch[0].interface_type = RGB18; 1275 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 81d91fda2d90..f2ec0777cfbe 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -124,6 +124,14 @@
124 * this command is required when playback. 124 * this command is required when playback.
125 * 125 *
126 * # amixer set "Headphone" 50 126 * # amixer set "Headphone" 50
127 *
128 * this command is required when capture.
129 *
130 * # amixer set "Input PGA" 15
131 * # amixer set "Left Input Mixer MicP" on
132 * # amixer set "Left Input Mixer MicN" on
133 * # amixer set "Right Input Mixer MicN" on
134 * # amixer set "Right Input Mixer MicP" on
127 */ 135 */
128 136
129/* 137/*
@@ -700,9 +708,9 @@ static int mt9t111_power(struct device *dev, int mode)
700 /* video1 (= CON1 camera) expect 24MHz */ 708 /* video1 (= CON1 camera) expect 24MHz */
701 clk_set_rate(mclk, clk_round_rate(mclk, 24000000)); 709 clk_set_rate(mclk, clk_round_rate(mclk, 24000000));
702 clk_enable(mclk); 710 clk_enable(mclk);
703 gpio_direction_output(GPIO_PORT158, 1); 711 gpio_set_value(GPIO_PORT158, 1);
704 } else { 712 } else {
705 gpio_direction_output(GPIO_PORT158, 0); 713 gpio_set_value(GPIO_PORT158, 0);
706 clk_disable(mclk); 714 clk_disable(mclk);
707 } 715 }
708 716
@@ -992,16 +1000,12 @@ static void __init eva_init(void)
992 gpio_request(GPIO_FN_LCD0_DISP, NULL); 1000 gpio_request(GPIO_FN_LCD0_DISP, NULL);
993 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL); 1001 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL);
994 1002
995 gpio_request(GPIO_PORT61, NULL); /* LCDDON */ 1003 gpio_request_one(GPIO_PORT61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
996 gpio_direction_output(GPIO_PORT61, 1); 1004 gpio_request_one(GPIO_PORT202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */
997
998 gpio_request(GPIO_PORT202, NULL); /* LCD0_LED_CONT */
999 gpio_direction_output(GPIO_PORT202, 0);
1000 1005
1001 /* Touchscreen */ 1006 /* Touchscreen */
1002 gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */ 1007 gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */
1003 gpio_request(GPIO_PORT166, NULL); /* TP_RST_B */ 1008 gpio_request_one(GPIO_PORT166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */
1004 gpio_direction_output(GPIO_PORT166, 1);
1005 1009
1006 /* GETHER */ 1010 /* GETHER */
1007 gpio_request(GPIO_FN_ET_CRS, NULL); 1011 gpio_request(GPIO_FN_ET_CRS, NULL);
@@ -1024,12 +1028,10 @@ static void __init eva_init(void)
1024 gpio_request(GPIO_FN_ET_RX_DV, NULL); 1028 gpio_request(GPIO_FN_ET_RX_DV, NULL);
1025 gpio_request(GPIO_FN_ET_RX_CLK, NULL); 1029 gpio_request(GPIO_FN_ET_RX_CLK, NULL);
1026 1030
1027 gpio_request(GPIO_PORT18, NULL); /* PHY_RST */ 1031 gpio_request_one(GPIO_PORT18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */
1028 gpio_direction_output(GPIO_PORT18, 1);
1029 1032
1030 /* USB */ 1033 /* USB */
1031 gpio_request(GPIO_PORT159, NULL); /* USB_DEVICE_MODE */ 1034 gpio_request_one(GPIO_PORT159, GPIOF_IN, NULL); /* USB_DEVICE_MODE */
1032 gpio_direction_input(GPIO_PORT159);
1033 1035
1034 if (gpio_get_value(GPIO_PORT159)) { 1036 if (gpio_get_value(GPIO_PORT159)) {
1035 /* USB Host */ 1037 /* USB Host */
@@ -1043,8 +1045,7 @@ static void __init eva_init(void)
1043 * and select GPIO_PORT209 here 1045 * and select GPIO_PORT209 here
1044 */ 1046 */
1045 gpio_request(GPIO_FN_IRQ7_PORT209, NULL); 1047 gpio_request(GPIO_FN_IRQ7_PORT209, NULL);
1046 gpio_request(GPIO_PORT209, NULL); 1048 gpio_request_one(GPIO_PORT209, GPIOF_IN, NULL);
1047 gpio_direction_input(GPIO_PORT209);
1048 1049
1049 platform_device_register(&usbhsf_device); 1050 platform_device_register(&usbhsf_device);
1050 usb = &usbhsf_device; 1051 usb = &usbhsf_device;
@@ -1059,12 +1060,9 @@ static void __init eva_init(void)
1059 gpio_request(GPIO_FN_SDHI0_D3, NULL); 1060 gpio_request(GPIO_FN_SDHI0_D3, NULL);
1060 gpio_request(GPIO_FN_SDHI0_WP, NULL); 1061 gpio_request(GPIO_FN_SDHI0_WP, NULL);
1061 1062
1062 gpio_request(GPIO_PORT17, NULL); /* SDHI0_18/33_B */ 1063 gpio_request_one(GPIO_PORT17, GPIOF_OUT_INIT_LOW, NULL); /* SDHI0_18/33_B */
1063 gpio_request(GPIO_PORT74, NULL); /* SDHI0_PON */ 1064 gpio_request_one(GPIO_PORT74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */
1064 gpio_request(GPIO_PORT75, NULL); /* SDSLOT1_PON */ 1065 gpio_request_one(GPIO_PORT75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */
1065 gpio_direction_output(GPIO_PORT17, 0);
1066 gpio_direction_output(GPIO_PORT74, 1);
1067 gpio_direction_output(GPIO_PORT75, 1);
1068 1066
1069 /* 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 */
1070 1068
@@ -1101,12 +1099,10 @@ static void __init eva_init(void)
1101 gpio_request(GPIO_FN_VIO_CKO, NULL); 1099 gpio_request(GPIO_FN_VIO_CKO, NULL);
1102 1100
1103 /* CON1/CON15 Camera */ 1101 /* CON1/CON15 Camera */
1104 gpio_request(GPIO_PORT173, NULL); /* STANDBY */ 1102 gpio_request_one(GPIO_PORT173, GPIOF_OUT_INIT_LOW, NULL); /* STANDBY */
1105 gpio_request(GPIO_PORT172, NULL); /* RST */ 1103 gpio_request_one(GPIO_PORT172, GPIOF_OUT_INIT_HIGH, NULL); /* RST */
1106 gpio_request(GPIO_PORT158, NULL); /* CAM_PON */ 1104 /* see mt9t111_power() */
1107 gpio_direction_output(GPIO_PORT173, 0); 1105 gpio_request_one(GPIO_PORT158, GPIOF_OUT_INIT_LOW, NULL); /* CAM_PON */
1108 gpio_direction_output(GPIO_PORT172, 1);
1109 gpio_direction_output(GPIO_PORT158, 0); /* see mt9t111_power() */
1110 1106
1111 /* FSI-WM8978 */ 1107 /* FSI-WM8978 */
1112 gpio_request(GPIO_FN_FSIAIBT, NULL); 1108 gpio_request(GPIO_FN_FSIAIBT, NULL);
@@ -1133,15 +1129,13 @@ static void __init eva_init(void)
1133 * DBGMD/LCDC0/FSIA MUX 1129 * DBGMD/LCDC0/FSIA MUX
1134 * DBGMD_SELECT_B should be set after setting PFC Function. 1130 * DBGMD_SELECT_B should be set after setting PFC Function.
1135 */ 1131 */
1136 gpio_request(GPIO_PORT176, NULL); 1132 gpio_request_one(GPIO_PORT176, GPIOF_OUT_INIT_HIGH, NULL);
1137 gpio_direction_output(GPIO_PORT176, 1);
1138 1133
1139 /* 1134 /*
1140 * We can switch CON8/CON14 by SW1.5, 1135 * We can switch CON8/CON14 by SW1.5,
1141 * but it needs after DBGMD_SELECT_B 1136 * but it needs after DBGMD_SELECT_B
1142 */ 1137 */
1143 gpio_request(GPIO_PORT6, NULL); 1138 gpio_request_one(GPIO_PORT6, GPIOF_IN, NULL);
1144 gpio_direction_input(GPIO_PORT6);
1145 if (gpio_get_value(GPIO_PORT6)) { 1139 if (gpio_get_value(GPIO_PORT6)) {
1146 /* CON14 enable */ 1140 /* CON14 enable */
1147 } else { 1141 } else {
@@ -1155,8 +1149,8 @@ static void __init eva_init(void)
1155 gpio_request(GPIO_FN_SDHI1_CD, NULL); 1149 gpio_request(GPIO_FN_SDHI1_CD, NULL);
1156 gpio_request(GPIO_FN_SDHI1_WP, NULL); 1150 gpio_request(GPIO_FN_SDHI1_WP, NULL);
1157 1151
1158 gpio_request(GPIO_PORT16, NULL); /* SDSLOT2_PON */ 1152 /* SDSLOT2_PON */
1159 gpio_direction_output(GPIO_PORT16, 1); 1153 gpio_request_one(GPIO_PORT16, GPIOF_OUT_INIT_HIGH, NULL);
1160 1154
1161 platform_device_register(&sdhi1_device); 1155 platform_device_register(&sdhi1_device);
1162 } 1156 }
@@ -1175,8 +1169,6 @@ static void __init eva_init(void)
1175 platform_add_devices(eva_devices, 1169 platform_add_devices(eva_devices,
1176 ARRAY_SIZE(eva_devices)); 1170 ARRAY_SIZE(eva_devices));
1177 1171
1178 eva_clock_init();
1179
1180 rmobile_add_device_to_domain("A4LC", &lcdc0_device); 1172 rmobile_add_device_to_domain("A4LC", &lcdc0_device);
1181 rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device); 1173 rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device);
1182 if (usb) 1174 if (usb)
@@ -1189,6 +1181,9 @@ static void __init eva_earlytimer_init(void)
1189{ 1181{
1190 r8a7740_clock_init(MD_CK0 | MD_CK2); 1182 r8a7740_clock_init(MD_CK0 | MD_CK2);
1191 shmobile_earlytimer_init(); 1183 shmobile_earlytimer_init();
1184
1185 /* the rate of extal1 clock must be set before late_time_init */
1186 eva_clock_init();
1192} 1187}
1193 1188
1194static void __init eva_add_early_devices(void) 1189static 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 331b7ce4edd8..e50f86691539 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 d759a9c2b9e8..2ccc860403ef 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 3efff2e7b1e7..7f3a6b7e7b7c 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -623,7 +623,7 @@ static int __init as3711_enable_lcdc_backlight(void)
623 0x45, 0xf0, 623 0x45, 0xf0,
624 }; 624 };
625 625
626 if (!machine_is_kzm9g()) 626 if (!of_machine_is_compatible("renesas,kzm9g"))
627 return 0; 627 return 0;
628 628
629 if (!a) 629 if (!a)
@@ -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 e2fafca9432b..db968a585ff0 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -202,9 +202,7 @@
202 * 202 *
203 * it needs amixer settings for playing 203 * it needs amixer settings for playing
204 * 204 *
205 * amixer set "Headphone" on 205 * amixer set "Headphone Enable" on
206 * amixer set "HPOUTL Mixer DACH" on
207 * amixer set "HPOUTR Mixer DACH" on
208 */ 206 */
209 207
210/* Fixed 3.3V and 1.8V regulators to be used by multiple devices */ 208/* Fixed 3.3V and 1.8V regulators to be used by multiple devices */
@@ -1404,11 +1402,10 @@ static void __init mackerel_init(void)
1404 gpio_request(GPIO_FN_LCDDISP, NULL); 1402 gpio_request(GPIO_FN_LCDDISP, NULL);
1405 gpio_request(GPIO_FN_LCDDCK, NULL); 1403 gpio_request(GPIO_FN_LCDDCK, NULL);
1406 1404
1407 gpio_request(GPIO_PORT31, NULL); /* backlight */ 1405 /* backlight, off by default */
1408 gpio_direction_output(GPIO_PORT31, 0); /* off by default */ 1406 gpio_request_one(GPIO_PORT31, GPIOF_OUT_INIT_LOW, NULL);
1409 1407
1410 gpio_request(GPIO_PORT151, NULL); /* LCDDON */ 1408 gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
1411 gpio_direction_output(GPIO_PORT151, 1);
1412 1409
1413 /* USBHS0 */ 1410 /* USBHS0 */
1414 gpio_request(GPIO_FN_VBUS0_0, NULL); 1411 gpio_request(GPIO_FN_VBUS0_0, NULL);
@@ -1424,8 +1421,7 @@ static void __init mackerel_init(void)
1424 gpio_request(GPIO_FN_FSIAILR, NULL); 1421 gpio_request(GPIO_FN_FSIAILR, NULL);
1425 gpio_request(GPIO_FN_FSIAISLD, NULL); 1422 gpio_request(GPIO_FN_FSIAISLD, NULL);
1426 gpio_request(GPIO_FN_FSIAOSLD, NULL); 1423 gpio_request(GPIO_FN_FSIAOSLD, NULL);
1427 gpio_request(GPIO_PORT161, NULL); 1424 gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL); /* slave */
1428 gpio_direction_output(GPIO_PORT161, 0); /* slave */
1429 1425
1430 gpio_request(GPIO_PORT9, NULL); 1426 gpio_request(GPIO_PORT9, NULL);
1431 gpio_request(GPIO_PORT10, NULL); 1427 gpio_request(GPIO_PORT10, NULL);
@@ -1479,8 +1475,7 @@ static void __init mackerel_init(void)
1479 gpio_request(GPIO_FN_SDHID1_0, NULL); 1475 gpio_request(GPIO_FN_SDHID1_0, NULL);
1480#endif 1476#endif
1481 /* card detect pin for MMC slot (CN7) */ 1477 /* card detect pin for MMC slot (CN7) */
1482 gpio_request(GPIO_PORT41, NULL); 1478 gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL);
1483 gpio_direction_input(GPIO_PORT41);
1484 1479
1485 /* enable SDHI2 */ 1480 /* enable SDHI2 */
1486 gpio_request(GPIO_FN_SDHICMD2, NULL); 1481 gpio_request(GPIO_FN_SDHICMD2, NULL);
@@ -1491,8 +1486,7 @@ static void __init mackerel_init(void)
1491 gpio_request(GPIO_FN_SDHID2_0, NULL); 1486 gpio_request(GPIO_FN_SDHID2_0, NULL);
1492 1487
1493 /* card detect pin for microSD slot (CN23) */ 1488 /* card detect pin for microSD slot (CN23) */
1494 gpio_request(GPIO_PORT162, NULL); 1489 gpio_request_one(GPIO_PORT162, GPIOF_IN, NULL);
1495 gpio_direction_input(GPIO_PORT162);
1496 1490
1497 /* MMCIF */ 1491 /* MMCIF */
1498 gpio_request(GPIO_FN_MMCD0_0, NULL); 1492 gpio_request(GPIO_FN_MMCD0_0, NULL);