diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2012-06-26 18:32:23 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-06-30 16:36:59 -0400 |
commit | 70ccb28deaacc4a0b15ade4baf18170f3082301c (patch) | |
tree | 748cc5d852732cdd1c5164cd178667af4b99589e /arch/arm/mach-shmobile/board-mackerel.c | |
parent | 7acc1e8775b506656bfd3e74fb4815de28f84857 (diff) |
ARM: mach-shmobile: add 3.3V and 1.8V fixed regulators to mackerel
Drivers for several devices on mackerel, including all SDHI instances, the
MMCIF controller and the SMSC9220 ethernet chip use regulators to control
power supply to their devices. MMC drivers need to be able to at least
retrieve voltage values from supplying regulators, whereas the smsc911x
driver only enables and disables chip power supplies without further looking
at them. This patch adds two fixed voltage regulators to describe 1.8V and
3.3V supplies on the board and a dummy regulator for SMSC9220.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch/arm/mach-shmobile/board-mackerel.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-mackerel.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 30d06b5b25d4..b3af57a026fe 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,6 +205,33 @@ | |||
203 | * amixer set "HPOUTR Mixer DACH" on | 205 | * amixer set "HPOUTR Mixer DACH" on |
204 | */ | 206 | */ |
205 | 207 | ||
208 | /* Fixed 3.3V and 1.8V regulators to be used by multiple devices */ | ||
209 | static struct regulator_consumer_supply fixed1v8_power_consumers[] = | ||
210 | { | ||
211 | /* | ||
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 | }; | ||
220 | |||
221 | static struct regulator_consumer_supply fixed3v3_power_consumers[] = | ||
222 | { | ||
223 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), | ||
224 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), | ||
225 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.2"), | ||
226 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.2"), | ||
227 | }; | ||
228 | |||
229 | /* Dummy supplies, where voltage doesn't matter */ | ||
230 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
231 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
232 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
233 | }; | ||
234 | |||
206 | /* MTD */ | 235 | /* MTD */ |
207 | static struct mtd_partition nor_flash_partitions[] = { | 236 | static struct mtd_partition nor_flash_partitions[] = { |
208 | { | 237 | { |
@@ -1383,6 +1412,12 @@ static void __init mackerel_init(void) | |||
1383 | u32 srcr4; | 1412 | u32 srcr4; |
1384 | struct clk *clk; | 1413 | struct clk *clk; |
1385 | 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 | |||
1386 | /* External clock source */ | 1421 | /* External clock source */ |
1387 | clk_set_rate(&sh7372_dv_clki_clk, 27000000); | 1422 | clk_set_rate(&sh7372_dv_clki_clk, 27000000); |
1388 | 1423 | ||