ARM: OMAP2+: smsc911x: Add fixed board regulators
authorRuss Dill <Russ.Dill@ti.com>
Fri, 23 Mar 2012 09:21:37 +0000 (02:21 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 3 Apr 2012 17:33:19 +0000 (10:33 -0700)
Initialize fixed regulators in the board files. Trying to
do this in a generic way in gpmc-smsc911x.c gets messy as
the regulator may be provided by drivers, such as twl4030,
for some boards.

Signed-off-by: Russ Dill <russ.dill@ti.com>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
[tony@atomide.com: combined into one patch, updated comments]
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3logic.c
arch/arm/mach-omap2/board-omap3stalker.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-zoom-debugboard.c

index 41b0a2fe0b04b2de9d2953e3d938426068bbb0c5..909a8b91b564278d5d481845d8ad5ba249f69d0e 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <linux/i2c/at24.h>
 #include <linux/i2c/twl.h>
+#include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 #include <linux/mmc/host.h>
 
@@ -81,8 +82,23 @@ static struct omap_smsc911x_platform_data sb_t35_smsc911x_cfg = {
        .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
 };
 
+static struct regulator_consumer_supply cm_t35_smsc911x_supplies[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+};
+
+static struct regulator_consumer_supply sb_t35_smsc911x_supplies[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
+};
+
 static void __init cm_t35_init_ethernet(void)
 {
+       regulator_register_fixed(0, cm_t35_smsc911x_supplies,
+                                ARRAY_SIZE(cm_t35_smsc911x_supplies));
+       regulator_register_fixed(1, sb_t35_smsc911x_supplies,
+                                ARRAY_SIZE(sb_t35_smsc911x_supplies));
+
        gpmc_smsc911x_init(&cm_t35_smsc911x_cfg);
        gpmc_smsc911x_init(&sb_t35_smsc911x_cfg);
 }
index e558800adfdf58bdd69b55398ed8a7f3c4b332b0..930c0d3804359ee6543a0b0c59323432af6e7847 100644 (file)
@@ -634,8 +634,14 @@ static void __init igep_wlan_bt_init(void)
 static inline void __init igep_wlan_bt_init(void) { }
 #endif
 
+static struct regulator_consumer_supply dummy_supplies[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+};
+
 static void __init igep_init(void)
 {
+       regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 
        /* Get IGEP2 hardware revision */
index d50a562adfa0b08c4eed8318711384833385571f..1b6049567ab49621d59061d80b34d6cb84a94cf0 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/spi/spi.h>
+#include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 #include <linux/i2c/twl.h>
 #include <linux/io.h>
@@ -410,8 +411,14 @@ static struct mtd_partition ldp_nand_partitions[] = {
 
 };
 
+static struct regulator_consumer_supply dummy_supplies[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+};
+
 static void __init omap_ldp_init(void)
 {
+       regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        ldp_init_smsc911x();
        omap_i2c_init();
index b90b319eb793c567c1aebb83b98c79400b10e2b4..49df12735b41916db3a9d222880ddb4dcd89015d 100644 (file)
@@ -623,9 +623,15 @@ static void __init omap3_evm_wl12xx_init(void)
 #endif
 }
 
+static struct regulator_consumer_supply dummy_supplies[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+};
+
 static void __init omap3_evm_init(void)
 {
        omap3_evm_get_revision();
+       regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
 
        if (cpu_is_omap3630())
                omap3_mux_init(omap36x_board_mux, OMAP_PACKAGE_CBB);
index 4a7d8c8a75da5298e2647e30aed3c4b87d8c5fef..9b3c141ff51bc575d65f157daf702df4ba6eab89 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/io.h>
 #include <linux/gpio.h>
 
+#include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 
 #include <linux/i2c/twl.h>
@@ -188,8 +189,14 @@ static struct omap_board_mux board_mux[] __initdata = {
 };
 #endif
 
+static struct regulator_consumer_supply dummy_supplies[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+};
+
 static void __init omap3logic_init(void)
 {
+       regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap3torpedo_fix_pbias_voltage();
        omap3logic_i2c_init();
index de953521cce2aeef1d035ede024b285df5e4682c..4dffc95bddd25836f85f06cc50dc3909fbc83abb 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
 
+#include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 #include <linux/i2c/twl.h>
 #include <linux/mmc/host.h>
@@ -410,8 +411,14 @@ static struct omap_board_mux board_mux[] __initdata = {
 };
 #endif
 
+static struct regulator_consumer_supply dummy_supplies[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+};
+
 static void __init omap3_stalker_init(void)
 {
+       regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
        omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
        omap_board_config = omap3_stalker_config;
        omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
index 668533e2a3791442e3582696d365e964179124e8..33aa3910b09e0deb1d209e35c2aefdfd9ca4fc71 100644 (file)
@@ -498,10 +498,18 @@ static struct gpio overo_bt_gpios[] __initdata = {
        { OVERO_GPIO_BT_NRESET, GPIOF_OUT_INIT_HIGH,    "lcd bl enable" },
 };
 
+static struct regulator_consumer_supply dummy_supplies[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+       REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
+};
+
 static void __init overo_init(void)
 {
        int ret;
 
+       regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap_hsmmc_init(mmc);
        overo_i2c_init();
index 1e8540eabde98188ced71d321d7b531a685b463a..f64f441730612adc5c095cfab972bbc8064837da 100644 (file)
@@ -14,6 +14,9 @@
 #include <linux/smsc911x.h>
 #include <linux/interrupt.h>
 
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
+
 #include <plat/gpmc.h>
 #include <plat/gpmc-smsc911x.h>
 
@@ -117,11 +120,17 @@ static struct platform_device *zoom_devices[] __initdata = {
        &zoom_debugboard_serial_device,
 };
 
+static struct regulator_consumer_supply dummy_supplies[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+};
+
 int __init zoom_debugboard_init(void)
 {
        if (!omap_zoom_debugboard_detect())
                return 0;
 
+       regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
        zoom_init_smsc911x();
        zoom_init_quaduart();
        return platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices));