[Gta04-owner] Virtual regulator for VSIM (GPS)

Christoph Mair christoph.mair at gmail.com
Sun Nov 27 17:07:03 CET 2011


Hi Neil,

Today I tried to enable the power supply for the GPS antenna but could
not find a way to do so.

Below is a patch which adds a virtual consumer to the vsim regulator
(and renames vmmc_aux to vsim). In general it may be better to link
the regulator to the serial device so that power is switched on as
soon as the device is opened. But I don't have a clue if its even
possible.

diff --git a/arch/arm/mach-omap2/board-omap3gta04.c
b/arch/arm/mach-omap2/board-omap3gta04.c
index d9f79da..8ab83b84 100644
--- a/arch/arm/mach-omap2/board-omap3gta04.c
+++ b/arch/arm/mach-omap2/board-omap3gta04.c
@@ -396,7 +396,7 @@ static struct regulator_consumer_supply
gta04_vmmc2_supply[] = {
 };

 static struct regulator_consumer_supply gta04_vsim_supply = {
-       .supply                 = "vmmc_aux",
+       .supply                 = "vsim",
 };

 static int gta04_twl_gpio_setup(struct device *dev,
@@ -581,7 +581,7 @@ static struct regulator_init_data gta04_vsim = {
                                        | REGULATOR_CHANGE_STATUS,
        },
        .num_consumer_supplies  = 1,
-       .consumer_supplies      = &gta04_vsim_supply,   // vmmc_aux
+       .consumer_supplies      = &gta04_vsim_supply,   // vsim
 };

 /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
@@ -950,6 +950,14 @@ static struct platform_device
gta04_vaux4_virtual_regulator_device = {
        },
 };

+static struct platform_device gta04_vsim_virtual_regulator_device = {
+       .name           = "reg-virt-consumer",
+       .id                     = 5,
+       .dev            = {
+               .platform_data  = "vsim",
+       },
+};
+
 #endif

 static struct platform_device *gta04_devices[] __initdata = {
@@ -962,6 +970,7 @@ static struct platform_device *gta04_devices[]
__initdata = {
        &gta04_vaux2_virtual_regulator_device,
        &gta04_vaux3_virtual_regulator_device,
        &gta04_vaux4_virtual_regulator_device,
+       &gta04_vsim_virtual_regulator_device,
 #endif
 };


Best regards,
  Christoph


More information about the Gta04-owner mailing list