diff options
Diffstat (limited to 'arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c')
-rw-r--r-- | arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c index a4102d72cc9..c49f5c003ee 100644 --- a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c +++ b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c | |||
@@ -26,6 +26,9 @@ | |||
26 | #include <linux/spi/spi.h> | 26 | #include <linux/spi/spi.h> |
27 | #include <linux/spi/at73c213.h> | 27 | #include <linux/spi/at73c213.h> |
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/regulator/machine.h> | ||
30 | #include <linux/regulator/fixed.h> | ||
31 | #include <linux/regulator/consumer.h> | ||
29 | 32 | ||
30 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
31 | #include <asm/setup.h> | 34 | #include <asm/setup.h> |
@@ -235,6 +238,46 @@ static struct gpio_led ek_leds[] = { | |||
235 | } | 238 | } |
236 | }; | 239 | }; |
237 | 240 | ||
241 | #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) | ||
242 | static struct regulator_consumer_supply ek_audio_consumer_supplies[] = { | ||
243 | REGULATOR_SUPPLY("AVDD", "0-001b"), | ||
244 | REGULATOR_SUPPLY("HPVDD", "0-001b"), | ||
245 | REGULATOR_SUPPLY("DBVDD", "0-001b"), | ||
246 | REGULATOR_SUPPLY("DCVDD", "0-001b"), | ||
247 | }; | ||
248 | |||
249 | static struct regulator_init_data ek_avdd_reg_init_data = { | ||
250 | .constraints = { | ||
251 | .name = "3V3", | ||
252 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
253 | }, | ||
254 | .consumer_supplies = ek_audio_consumer_supplies, | ||
255 | .num_consumer_supplies = ARRAY_SIZE(ek_audio_consumer_supplies), | ||
256 | }; | ||
257 | |||
258 | static struct fixed_voltage_config ek_vdd_pdata = { | ||
259 | .supply_name = "board-3V3", | ||
260 | .microvolts = 3300000, | ||
261 | .gpio = -EINVAL, | ||
262 | .enabled_at_boot = 0, | ||
263 | .init_data = &ek_avdd_reg_init_data, | ||
264 | }; | ||
265 | static struct platform_device ek_voltage_regulator = { | ||
266 | .name = "reg-fixed-voltage", | ||
267 | .id = -1, | ||
268 | .num_resources = 0, | ||
269 | .dev = { | ||
270 | .platform_data = &ek_vdd_pdata, | ||
271 | }, | ||
272 | }; | ||
273 | static void __init ek_add_regulators(void) | ||
274 | { | ||
275 | platform_device_register(&ek_voltage_regulator); | ||
276 | } | ||
277 | #else | ||
278 | static void __init ek_add_regulators(void) {} | ||
279 | #endif | ||
280 | |||
238 | static struct i2c_board_info __initdata ek_i2c_devices[] = { | 281 | static struct i2c_board_info __initdata ek_i2c_devices[] = { |
239 | { | 282 | { |
240 | I2C_BOARD_INFO("24c512", 0x50), | 283 | I2C_BOARD_INFO("24c512", 0x50), |
@@ -256,6 +299,8 @@ static void __init ek_board_init(void) | |||
256 | ek_add_device_nand(); | 299 | ek_add_device_nand(); |
257 | /* Ethernet */ | 300 | /* Ethernet */ |
258 | at91_add_device_eth(&ek_macb_data); | 301 | at91_add_device_eth(&ek_macb_data); |
302 | /* Regulators */ | ||
303 | ek_add_regulators(); | ||
259 | /* MMC */ | 304 | /* MMC */ |
260 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | 305 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) |
261 | at91_add_device_mci(0, &ek_mmc_data); | 306 | at91_add_device_mci(0, &ek_mmc_data); |