diff options
author | Lee Jones <lee.jones@linaro.org> | 2012-09-03 09:33:39 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-09-04 04:14:31 -0400 |
commit | 0b5ea1e230432d79ce985338bbcbab1f82ae26a0 (patch) | |
tree | 30185a115d5e4638bfb31ac7ab6084b2f0bfc1ef | |
parent | 5caecb44704657b9587977eb87a397f9b25cabbc (diff) |
ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
The SMSC911x Ethernet chip requires a fixed-regulator in order to
function correctly. We have previously provided a means to obtain
this during a Device Tree boot, however nothing has been put into
place when booting with a non-DT kernel. This patch aims to change
that.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
[Added a Kconfig select so the build does not break]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | arch/arm/mach-ux500/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-regulators.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-regulators.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 19 |
4 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index c013bbf79cac..220eb8a8b593 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig | |||
@@ -28,6 +28,7 @@ config MACH_MOP500 | |||
28 | select I2C | 28 | select I2C |
29 | select I2C_NOMADIK | 29 | select I2C_NOMADIK |
30 | select SOC_BUS | 30 | select SOC_BUS |
31 | select REGULATOR_FIXED_VOLTAGE | ||
31 | help | 32 | help |
32 | Include support for the MOP500 development platform. | 33 | Include support for the MOP500 development platform. |
33 | 34 | ||
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c index 52426a425787..2a17bc506cff 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.c +++ b/arch/arm/mach-ux500/board-mop500-regulators.c | |||
@@ -13,6 +13,21 @@ | |||
13 | #include <linux/regulator/ab8500.h> | 13 | #include <linux/regulator/ab8500.h> |
14 | #include "board-mop500-regulators.h" | 14 | #include "board-mop500-regulators.h" |
15 | 15 | ||
16 | static struct regulator_consumer_supply gpio_en_3v3_consumers[] = { | ||
17 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
18 | }; | ||
19 | |||
20 | struct regulator_init_data gpio_en_3v3_regulator = { | ||
21 | .constraints = { | ||
22 | .name = "EN-3V3", | ||
23 | .min_uV = 3300000, | ||
24 | .max_uV = 3300000, | ||
25 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
26 | }, | ||
27 | .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers), | ||
28 | .consumer_supplies = gpio_en_3v3_consumers, | ||
29 | }; | ||
30 | |||
16 | /* | 31 | /* |
17 | * TPS61052 regulator | 32 | * TPS61052 regulator |
18 | */ | 33 | */ |
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h index 94992158d962..78a0642a2206 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.h +++ b/arch/arm/mach-ux500/board-mop500-regulators.h | |||
@@ -18,5 +18,6 @@ extern struct ab8500_regulator_reg_init | |||
18 | ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS]; | 18 | ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS]; |
19 | extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS]; | 19 | extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS]; |
20 | extern struct regulator_init_data tps61052_regulator; | 20 | extern struct regulator_init_data tps61052_regulator; |
21 | extern struct regulator_init_data gpio_en_3v3_regulator; | ||
21 | 22 | ||
22 | #endif | 23 | #endif |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 8674a890fd1c..34359b056e2e 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
24 | #include <linux/mfd/abx500/ab8500.h> | 24 | #include <linux/mfd/abx500/ab8500.h> |
25 | #include <linux/regulator/ab8500.h> | 25 | #include <linux/regulator/ab8500.h> |
26 | #include <linux/regulator/fixed.h> | ||
26 | #include <linux/mfd/tc3589x.h> | 27 | #include <linux/mfd/tc3589x.h> |
27 | #include <linux/mfd/tps6105x.h> | 28 | #include <linux/mfd/tps6105x.h> |
28 | #include <linux/mfd/abx500/ab8500-gpio.h> | 29 | #include <linux/mfd/abx500/ab8500-gpio.h> |
@@ -76,6 +77,23 @@ static struct platform_device snowball_led_dev = { | |||
76 | }, | 77 | }, |
77 | }; | 78 | }; |
78 | 79 | ||
80 | static struct fixed_voltage_config snowball_gpio_en_3v3_data = { | ||
81 | .supply_name = "EN-3V3", | ||
82 | .gpio = SNOWBALL_EN_3V3_ETH_GPIO, | ||
83 | .microvolts = 3300000, | ||
84 | .enable_high = 1, | ||
85 | .init_data = &gpio_en_3v3_regulator, | ||
86 | .startup_delay = 5000, /* 1200us */ | ||
87 | }; | ||
88 | |||
89 | static struct platform_device snowball_gpio_en_3v3_regulator_dev = { | ||
90 | .name = "reg-fixed-voltage", | ||
91 | .id = 1, | ||
92 | .dev = { | ||
93 | .platform_data = &snowball_gpio_en_3v3_data, | ||
94 | }, | ||
95 | }; | ||
96 | |||
79 | static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { | 97 | static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { |
80 | .gpio_base = MOP500_AB8500_PIN_GPIO(1), | 98 | .gpio_base = MOP500_AB8500_PIN_GPIO(1), |
81 | .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, | 99 | .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, |
@@ -586,6 +604,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = { | |||
586 | &snowball_led_dev, | 604 | &snowball_led_dev, |
587 | &snowball_key_dev, | 605 | &snowball_key_dev, |
588 | &snowball_sbnet_dev, | 606 | &snowball_sbnet_dev, |
607 | &snowball_gpio_en_3v3_regulator_dev, | ||
589 | }; | 608 | }; |
590 | 609 | ||
591 | static void __init mop500_init_machine(void) | 610 | static void __init mop500_init_machine(void) |