diff options
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/board-mackerel.c | 59 |
1 files changed, 34 insertions, 25 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 9640f34122bd..7ea2b31e3199 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 !! | 209 | static 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 | */ | ||
217 | static 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 | ||
222 | static void __init gpio_pull_down(u32 addr) | 221 | static 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 | } | 230 | static struct regulator_consumer_supply dummy_supplies[] = { |
231 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
232 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
233 | }; | ||
231 | 234 | ||
232 | /* MTD */ | 235 | /* MTD */ |
233 | static struct mtd_partition nor_flash_partitions[] = { | 236 | static struct mtd_partition nor_flash_partitions[] = { |
@@ -1409,6 +1412,12 @@ static void __init mackerel_init(void) | |||
1409 | u32 srcr4; | 1412 | u32 srcr4; |
1410 | struct clk *clk; | 1413 | struct clk *clk; |
1411 | 1414 | ||
1415 | regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers, | ||
1416 | ARRAY_SIZE(fixed1v8_power_consumers), 1800000); | ||
1417 | regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers, | ||
1418 | ARRAY_SIZE(fixed3v3_power_consumers), 3300000); | ||
1419 | regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
1420 | |||
1412 | /* External clock source */ | 1421 | /* External clock source */ |
1413 | clk_set_rate(&sh7372_dv_clki_clk, 27000000); | 1422 | clk_set_rate(&sh7372_dv_clki_clk, 27000000); |
1414 | 1423 | ||
@@ -1458,11 +1467,11 @@ static void __init mackerel_init(void) | |||
1458 | 1467 | ||
1459 | /* USBHS0 */ | 1468 | /* USBHS0 */ |
1460 | gpio_request(GPIO_FN_VBUS0_0, NULL); | 1469 | gpio_request(GPIO_FN_VBUS0_0, NULL); |
1461 | gpio_pull_down(GPIO_PORT168CR); /* VBUS0_0 pull down */ | 1470 | gpio_request_pulldown(GPIO_PORT168CR); /* VBUS0_0 pull down */ |
1462 | 1471 | ||
1463 | /* USBHS1 */ | 1472 | /* USBHS1 */ |
1464 | gpio_request(GPIO_FN_VBUS0_1, NULL); | 1473 | gpio_request(GPIO_FN_VBUS0_1, NULL); |
1465 | gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */ | 1474 | gpio_request_pulldown(GPIO_PORT167CR); /* VBUS0_1 pull down */ |
1466 | gpio_request(GPIO_FN_IDIN_1_113, NULL); | 1475 | gpio_request(GPIO_FN_IDIN_1_113, NULL); |
1467 | 1476 | ||
1468 | /* enable FSI2 port A (ak4643) */ | 1477 | /* enable FSI2 port A (ak4643) */ |
@@ -1475,8 +1484,8 @@ static void __init mackerel_init(void) | |||
1475 | 1484 | ||
1476 | gpio_request(GPIO_PORT9, NULL); | 1485 | gpio_request(GPIO_PORT9, NULL); |
1477 | gpio_request(GPIO_PORT10, NULL); | 1486 | gpio_request(GPIO_PORT10, NULL); |
1478 | gpio_no_direction(GPIO_PORT9CR); /* FSIAOBT needs no direction */ | 1487 | gpio_direction_none(GPIO_PORT9CR); /* FSIAOBT needs no direction */ |
1479 | gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */ | 1488 | gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */ |
1480 | 1489 | ||
1481 | intc_set_priority(IRQ_FSI, 3); /* irq priority FSI(3) > SMSC911X(2) */ | 1490 | intc_set_priority(IRQ_FSI, 3); /* irq priority FSI(3) > SMSC911X(2) */ |
1482 | 1491 | ||