diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2010-06-03 08:56:32 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-06-16 18:00:01 -0400 |
commit | 5e886f68e5b1c0a62c64cbc3707304259ba46183 (patch) | |
tree | b1e38019d3a29e6e2d80a0a6aca59c7d74926ed5 /arch/arm/mach-at91/board-sam9g20ek.c | |
parent | 4f4c5e36e7cd26c9b5bf89d66caeee5fc3d75362 (diff) |
ARM: 6162/1: at91sam9g20ek: add fixed-value regulator for wm8731
If CONFIG_REGULATOR is enabled, wm8731 fails on AT91SAM9G20EK board,
since codec driver requires several voltage supplies and none are
provided currently. As requires voltages are hardwired to 3V3, use fixed
voltage regulator for this chip.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91/board-sam9g20ek.c')
-rw-r--r-- | arch/arm/mach-at91/board-sam9g20ek.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c index c11fd47aec5d..6ea9808b8868 100644 --- a/arch/arm/mach-at91/board-sam9g20ek.c +++ b/arch/arm/mach-at91/board-sam9g20ek.c | |||
@@ -27,6 +27,9 @@ | |||
27 | #include <linux/gpio_keys.h> | 27 | #include <linux/gpio_keys.h> |
28 | #include <linux/input.h> | 28 | #include <linux/input.h> |
29 | #include <linux/clk.h> | 29 | #include <linux/clk.h> |
30 | #include <linux/regulator/machine.h> | ||
31 | #include <linux/regulator/fixed.h> | ||
32 | #include <linux/regulator/consumer.h> | ||
30 | 33 | ||
31 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
32 | #include <asm/setup.h> | 35 | #include <asm/setup.h> |
@@ -269,6 +272,46 @@ static void __init ek_add_device_buttons(void) | |||
269 | static void __init ek_add_device_buttons(void) {} | 272 | static void __init ek_add_device_buttons(void) {} |
270 | #endif | 273 | #endif |
271 | 274 | ||
275 | #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) | ||
276 | static struct regulator_consumer_supply ek_audio_consumer_supplies[] = { | ||
277 | REGULATOR_SUPPLY("AVDD", "0-001b"), | ||
278 | REGULATOR_SUPPLY("HPVDD", "0-001b"), | ||
279 | REGULATOR_SUPPLY("DBVDD", "0-001b"), | ||
280 | REGULATOR_SUPPLY("DCVDD", "0-001b"), | ||
281 | }; | ||
282 | |||
283 | static struct regulator_init_data ek_avdd_reg_init_data = { | ||
284 | .constraints = { | ||
285 | .name = "3V3", | ||
286 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
287 | }, | ||
288 | .consumer_supplies = ek_audio_consumer_supplies, | ||
289 | .num_consumer_supplies = ARRAY_SIZE(ek_audio_consumer_supplies), | ||
290 | }; | ||
291 | |||
292 | static struct fixed_voltage_config ek_vdd_pdata = { | ||
293 | .supply_name = "board-3V3", | ||
294 | .microvolts = 3300000, | ||
295 | .gpio = -EINVAL, | ||
296 | .enabled_at_boot = 0, | ||
297 | .init_data = &ek_avdd_reg_init_data, | ||
298 | }; | ||
299 | static struct platform_device ek_voltage_regulator = { | ||
300 | .name = "reg-fixed-voltage", | ||
301 | .id = -1, | ||
302 | .num_resources = 0, | ||
303 | .dev = { | ||
304 | .platform_data = &ek_vdd_pdata, | ||
305 | }, | ||
306 | }; | ||
307 | static void __init ek_add_regulators(void) | ||
308 | { | ||
309 | platform_device_register(&ek_voltage_regulator); | ||
310 | } | ||
311 | #else | ||
312 | static void __init ek_add_regulators(void) {} | ||
313 | #endif | ||
314 | |||
272 | 315 | ||
273 | static struct i2c_board_info __initdata ek_i2c_devices[] = { | 316 | static struct i2c_board_info __initdata ek_i2c_devices[] = { |
274 | { | 317 | { |
@@ -294,6 +337,8 @@ static void __init ek_board_init(void) | |||
294 | ek_add_device_nand(); | 337 | ek_add_device_nand(); |
295 | /* Ethernet */ | 338 | /* Ethernet */ |
296 | at91_add_device_eth(&ek_macb_data); | 339 | at91_add_device_eth(&ek_macb_data); |
340 | /* Regulators */ | ||
341 | ek_add_regulators(); | ||
297 | /* MMC */ | 342 | /* MMC */ |
298 | at91_add_device_mmc(0, &ek_mmc_data); | 343 | at91_add_device_mmc(0, &ek_mmc_data); |
299 | /* I2C */ | 344 | /* I2C */ |