diff options
| -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 */ |
