ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
authorLee Jones <lee.jones@linaro.org>
Mon, 3 Sep 2012 13:33:39 +0000 (14:33 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 4 Sep 2012 08:14:31 +0000 (10:14 +0200)
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>
arch/arm/mach-ux500/Kconfig
arch/arm/mach-ux500/board-mop500-regulators.c
arch/arm/mach-ux500/board-mop500-regulators.h
arch/arm/mach-ux500/board-mop500.c

index c013bbf79cac0d0eff64edfd5221d7815bb04879..220eb8a8b5930e2f6f1d70c254ab0975fa5c07d1 100644 (file)
@@ -28,6 +28,7 @@ config MACH_MOP500
        select I2C
        select I2C_NOMADIK
        select SOC_BUS
+       select REGULATOR_FIXED_VOLTAGE
        help
          Include support for the MOP500 development platform.
 
index 52426a4257871cf62e3f2681d7d36b3ca83bea22..2a17bc506cff7cdad26d95d243d97c7e8a71295a 100644 (file)
 #include <linux/regulator/ab8500.h>
 #include "board-mop500-regulators.h"
 
+static struct regulator_consumer_supply gpio_en_3v3_consumers[] = {
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+};
+
+struct regulator_init_data gpio_en_3v3_regulator = {
+       .constraints = {
+               .name = "EN-3V3",
+               .min_uV = 3300000,
+               .max_uV = 3300000,
+               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+       },
+       .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers),
+       .consumer_supplies = gpio_en_3v3_consumers,
+};
+
 /*
  * TPS61052 regulator
  */
index 94992158d96230ad42f65aca2fdfd5e05ceeb5ae..78a0642a2206a175150ed8749f90d60068507fe2 100644 (file)
@@ -18,5 +18,6 @@ extern struct ab8500_regulator_reg_init
 ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
 extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
 extern struct regulator_init_data tps61052_regulator;
+extern struct regulator_init_data gpio_en_3v3_regulator;
 
 #endif
index 8674a890fd1c7071ae2efce55a3a7c888a97c091..34359b056e2ed525457750412ef1efffa7447beb 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/spi/spi.h>
 #include <linux/mfd/abx500/ab8500.h>
 #include <linux/regulator/ab8500.h>
+#include <linux/regulator/fixed.h>
 #include <linux/mfd/tc3589x.h>
 #include <linux/mfd/tps6105x.h>
 #include <linux/mfd/abx500/ab8500-gpio.h>
@@ -76,6 +77,23 @@ static struct platform_device snowball_led_dev = {
        },
 };
 
+static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
+       .supply_name            = "EN-3V3",
+       .gpio                   = SNOWBALL_EN_3V3_ETH_GPIO,
+       .microvolts             = 3300000,
+       .enable_high            = 1,
+       .init_data              = &gpio_en_3v3_regulator,
+       .startup_delay          = 5000, /* 1200us */
+};
+
+static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
+       .name   = "reg-fixed-voltage",
+       .id     = 1,
+       .dev    = {
+               .platform_data  = &snowball_gpio_en_3v3_data,
+       },
+};
+
 static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
        .gpio_base              = MOP500_AB8500_PIN_GPIO(1),
        .irq_base               = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
@@ -586,6 +604,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
        &snowball_led_dev,
        &snowball_key_dev,
        &snowball_sbnet_dev,
+       &snowball_gpio_en_3v3_regulator_dev,
 };
 
 static void __init mop500_init_machine(void)