Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 370154
b: refs/heads/master
c: cd2fa6d
h: refs/heads/master
v: v3
  • Loading branch information
Lee Jones authored and Linus Walleij committed Mar 1, 2013
1 parent a2e23c7 commit e90d78a
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 874c920241640595da77622b6ee98c14e79296e4
refs/heads/master: cd2fa6d6035adb92b49ef04cbd1950c59f592cf6
14 changes: 14 additions & 0 deletions trunk/arch/arm/mach-ux500/board-mop500-regulators.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ struct regulator_init_data gpio_en_3v3_regulator = {
.consumer_supplies = gpio_en_3v3_consumers,
};

static struct regulator_consumer_supply sdi0_reg_consumers[] = {
REGULATOR_SUPPLY("vqmmc", "sdi0"),
};

struct regulator_init_data sdi0_reg_init_data = {
.constraints = {
.min_uV = 1800000,
.max_uV = 2900000,
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = ARRAY_SIZE(sdi0_reg_consumers),
.consumer_supplies = sdi0_reg_consumers,
};

/*
* TPS61052 regulator
*/
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-ux500/board-mop500-regulators.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ 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;
extern struct regulator_init_data sdi0_reg_init_data;

#endif
45 changes: 45 additions & 0 deletions trunk/arch/arm/mach-ux500/board-mop500.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <linux/mfd/abx500/ab8500.h>
#include <linux/regulator/ab8500.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/gpio-regulator.h>
#include <linux/mfd/tc3589x.h>
#include <linux/mfd/tps6105x.h>
#include <linux/mfd/abx500/ab8500-gpio.h>
Expand Down Expand Up @@ -89,6 +91,37 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
},
};

/* Dynamically populated. */
static struct gpio sdi0_reg_gpios[] = {
{ 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" },
};

static struct gpio_regulator_state sdi0_reg_states[] = {
{ .value = 2900000, .gpios = (0 << 0) },
{ .value = 1800000, .gpios = (1 << 0) },
};

static struct gpio_regulator_config sdi0_reg_info = {
.supply_name = "ext-mmc-level-shifter",
.gpios = sdi0_reg_gpios,
.nr_gpios = ARRAY_SIZE(sdi0_reg_gpios),
.states = sdi0_reg_states,
.nr_states = ARRAY_SIZE(sdi0_reg_states),
.type = REGULATOR_VOLTAGE,
.enable_high = 1,
.enabled_at_boot = 0,
.init_data = &sdi0_reg_init_data,
.startup_delay = 100,
};

static struct platform_device sdi0_regulator = {
.name = "gpio-regulator",
.id = -1,
.dev = {
.platform_data = &sdi0_reg_info,
},
};

static struct abx500_gpio_platform_data ab8500_gpio_pdata = {
.gpio_base = MOP500_AB8500_PIN_GPIO(1),
};
Expand Down Expand Up @@ -481,6 +514,7 @@ static struct hash_platform_data u8500_hash1_platform_data = {
/* add any platform devices here - TODO */
static struct platform_device *mop500_platform_devs[] __initdata = {
&mop500_gpio_keys_device,
&sdi0_regulator,
};

#ifdef CONFIG_STE_DMA40
Expand Down Expand Up @@ -624,6 +658,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
&snowball_gpio_en_3v3_regulator_dev,
&u8500_thsens_device,
&u8500_cpufreq_cooling_device,
&sdi0_regulator,
};

static void __init mop500_init_machine(void)
Expand All @@ -635,6 +670,9 @@ static void __init mop500_init_machine(void)
platform_device_register(&db8500_prcmu_device);
mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;

sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN;
sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL;

mop500_pinmaps_init();
parent = u8500_init_devices(&ab8500_platdata);

Expand Down Expand Up @@ -668,6 +706,10 @@ static void __init snowball_init_machine(void)
int i;

platform_device_register(&db8500_prcmu_device);

sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO;
sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO;

snowball_pinmaps_init();
parent = u8500_init_devices(&ab8500_platdata);

Expand Down Expand Up @@ -701,6 +743,9 @@ static void __init hrefv60_init_machine(void)
*/
mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;

sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO;
sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO;

hrefv60_pinmaps_init();
parent = u8500_init_devices(&ab8500_platdata);

Expand Down

0 comments on commit e90d78a

Please sign in to comment.