aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-mackerel.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/board-mackerel.c')
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c86
1 files changed, 48 insertions, 38 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 150122a44630..c129542f6aed 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -41,6 +41,8 @@
41#include <linux/mtd/physmap.h> 41#include <linux/mtd/physmap.h>
42#include <linux/mtd/sh_flctl.h> 42#include <linux/mtd/sh_flctl.h>
43#include <linux/pm_clock.h> 43#include <linux/pm_clock.h>
44#include <linux/regulator/fixed.h>
45#include <linux/regulator/machine.h>
44#include <linux/smsc911x.h> 46#include <linux/smsc911x.h>
45#include <linux/sh_intc.h> 47#include <linux/sh_intc.h>
46#include <linux/tca6416_keypad.h> 48#include <linux/tca6416_keypad.h>
@@ -203,31 +205,32 @@
203 * amixer set "HPOUTR Mixer DACH" on 205 * amixer set "HPOUTR Mixer DACH" on
204 */ 206 */
205 207
206/* 208/* Fixed 3.3V and 1.8V regulators to be used by multiple devices */
207 * FIXME !! 209static struct regulator_consumer_supply fixed1v8_power_consumers[] =
208 *
209 * gpio_no_direction
210 * gpio_pull_down
211 * are quick_hack.
212 *
213 * current gpio frame work doesn't have
214 * the method to control only pull up/down/free.
215 * this function should be replaced by correct gpio function
216 */
217static void __init gpio_no_direction(u32 addr)
218{ 210{
219 __raw_writeb(0x00, addr); 211 /*
220} 212 * J22 on mackerel switches mmcif.0 and sdhi.1 between 1.8V and 3.3V
213 * Since we cannot support both voltages, we support the default 1.8V
214 */
215 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
216 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
217 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
218 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
219};
221 220
222static void __init gpio_pull_down(u32 addr) 221static struct regulator_consumer_supply fixed3v3_power_consumers[] =
223{ 222{
224 u8 data = __raw_readb(addr); 223 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
225 224 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
226 data &= 0x0F; 225 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.2"),
227 data |= 0xA0; 226 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.2"),
227};
228 228
229 __raw_writeb(data, addr); 229/* Dummy supplies, where voltage doesn't matter */
230} 230static struct regulator_consumer_supply dummy_supplies[] = {
231 REGULATOR_SUPPLY("vddvario", "smsc911x"),
232 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
233};
231 234
232/* MTD */ 235/* MTD */
233static struct mtd_partition nor_flash_partitions[] = { 236static struct mtd_partition nor_flash_partitions[] = {
@@ -692,6 +695,7 @@ static struct platform_device usbhs0_device = {
692 * - J30 "open" 695 * - J30 "open"
693 * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET 696 * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET
694 * - add .get_vbus = usbhs_get_vbus in usbhs1_private 697 * - add .get_vbus = usbhs_get_vbus in usbhs1_private
698 * - check usbhs0_device(pio)/usbhs1_device(irq) order in mackerel_devices.
695 */ 699 */
696#define IRQ8 evt2irq(0x0300) 700#define IRQ8 evt2irq(0x0300)
697#define USB_PHY_MODE (1 << 4) 701#define USB_PHY_MODE (1 << 4)
@@ -1322,8 +1326,8 @@ static struct platform_device *mackerel_devices[] __initdata = {
1322 &nor_flash_device, 1326 &nor_flash_device,
1323 &smc911x_device, 1327 &smc911x_device,
1324 &lcdc_device, 1328 &lcdc_device,
1325 &usbhs1_device,
1326 &usbhs0_device, 1329 &usbhs0_device,
1330 &usbhs1_device,
1327 &leds_device, 1331 &leds_device,
1328 &fsi_device, 1332 &fsi_device,
1329 &fsi_ak4643_device, 1333 &fsi_ak4643_device,
@@ -1409,6 +1413,12 @@ static void __init mackerel_init(void)
1409 u32 srcr4; 1413 u32 srcr4;
1410 struct clk *clk; 1414 struct clk *clk;
1411 1415
1416 regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
1417 ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
1418 regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
1419 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
1420 regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies));
1421
1412 /* External clock source */ 1422 /* External clock source */
1413 clk_set_rate(&sh7372_dv_clki_clk, 27000000); 1423 clk_set_rate(&sh7372_dv_clki_clk, 27000000);
1414 1424
@@ -1458,11 +1468,11 @@ static void __init mackerel_init(void)
1458 1468
1459 /* USBHS0 */ 1469 /* USBHS0 */
1460 gpio_request(GPIO_FN_VBUS0_0, NULL); 1470 gpio_request(GPIO_FN_VBUS0_0, NULL);
1461 gpio_pull_down(GPIO_PORT168CR); /* VBUS0_0 pull down */ 1471 gpio_request_pulldown(GPIO_PORT168CR); /* VBUS0_0 pull down */
1462 1472
1463 /* USBHS1 */ 1473 /* USBHS1 */
1464 gpio_request(GPIO_FN_VBUS0_1, NULL); 1474 gpio_request(GPIO_FN_VBUS0_1, NULL);
1465 gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */ 1475 gpio_request_pulldown(GPIO_PORT167CR); /* VBUS0_1 pull down */
1466 gpio_request(GPIO_FN_IDIN_1_113, NULL); 1476 gpio_request(GPIO_FN_IDIN_1_113, NULL);
1467 1477
1468 /* enable FSI2 port A (ak4643) */ 1478 /* enable FSI2 port A (ak4643) */
@@ -1475,8 +1485,8 @@ static void __init mackerel_init(void)
1475 1485
1476 gpio_request(GPIO_PORT9, NULL); 1486 gpio_request(GPIO_PORT9, NULL);
1477 gpio_request(GPIO_PORT10, NULL); 1487 gpio_request(GPIO_PORT10, NULL);
1478 gpio_no_direction(GPIO_PORT9CR); /* FSIAOBT needs no direction */ 1488 gpio_direction_none(GPIO_PORT9CR); /* FSIAOBT needs no direction */
1479 gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */ 1489 gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */
1480 1490
1481 intc_set_priority(IRQ_FSI, 3); /* irq priority FSI(3) > SMSC911X(2) */ 1491 intc_set_priority(IRQ_FSI, 3); /* irq priority FSI(3) > SMSC911X(2) */
1482 1492
@@ -1614,20 +1624,20 @@ static void __init mackerel_init(void)
1614 1624
1615 platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices)); 1625 platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));
1616 1626
1617 sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device); 1627 rmobile_add_device_to_domain(&sh7372_pd_a4lc, &lcdc_device);
1618 sh7372_add_device_to_domain(&sh7372_a4lc, &hdmi_lcdc_device); 1628 rmobile_add_device_to_domain(&sh7372_pd_a4lc, &hdmi_lcdc_device);
1619 sh7372_add_device_to_domain(&sh7372_a4lc, &meram_device); 1629 rmobile_add_device_to_domain(&sh7372_pd_a4lc, &meram_device);
1620 sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device); 1630 rmobile_add_device_to_domain(&sh7372_pd_a4mp, &fsi_device);
1621 sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs0_device); 1631 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &usbhs0_device);
1622 sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs1_device); 1632 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &usbhs1_device);
1623 sh7372_add_device_to_domain(&sh7372_a3sp, &nand_flash_device); 1633 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &nand_flash_device);
1624 sh7372_add_device_to_domain(&sh7372_a3sp, &sh_mmcif_device); 1634 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sh_mmcif_device);
1625 sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi0_device); 1635 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi0_device);
1626#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1636#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1627 sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi1_device); 1637 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi1_device);
1628#endif 1638#endif
1629 sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi2_device); 1639 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi2_device);
1630 sh7372_add_device_to_domain(&sh7372_a4r, &ceu_device); 1640 rmobile_add_device_to_domain(&sh7372_pd_a4r, &ceu_device);
1631 1641
1632 hdmi_init_pm_clock(); 1642 hdmi_init_pm_clock();
1633 sh7372_pm_init(); 1643 sh7372_pm_init();