Commit a748b9a2 authored by David Brownell's avatar David Brownell Committed by Tony Lindgren

Hook up twl4030 regulators to the relevant RX51 MMC slots.

Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Acked-by: default avatarLauri Leukkunen <lauri.leukkunen@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent ca046755
...@@ -10,34 +10,11 @@ ...@@ -10,34 +10,11 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/errno.h>
#include "mmc-twl4030.h"
extern void __init n800_flash_init(void); extern void __init n800_flash_init(void);
static struct twl4030_hsmmc_info mmc[] __initdata = {
{
.name = "external",
.mmc = 1,
.wires = 4,
.cover_only = true,
.gpio_cd = 160,
.gpio_wp = -EINVAL,
},
{
.name = "internal",
.mmc = 2,
.wires = 8,
.gpio_cd = -EINVAL,
.gpio_wp = -EINVAL,
},
{} /* Terminator */
};
void __init rx51_flash_init(void) void __init rx51_flash_init(void)
{ {
n800_flash_init(); n800_flash_init();
twl4030_mmc_init(mmc);
} }
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
#include <mach/dma.h> #include <mach/dma.h>
#include <mach/gpmc.h> #include <mach/gpmc.h>
#include "mmc-twl4030.h"
#define SMC91X_CS 1 #define SMC91X_CS 1
#define SMC91X_GPIO_IRQ 54 #define SMC91X_GPIO_IRQ 54
#define SMC91X_GPIO_RESET 164 #define SMC91X_GPIO_RESET 164
...@@ -247,6 +250,37 @@ static struct twl4030_madc_platform_data rx51_madc_data = { ...@@ -247,6 +250,37 @@ static struct twl4030_madc_platform_data rx51_madc_data = {
.irq_line = 1, .irq_line = 1,
}; };
static struct twl4030_hsmmc_info mmc[] = {
{
.name = "external",
.mmc = 1,
.wires = 4,
.cover_only = true,
.gpio_cd = 160,
.gpio_wp = -EINVAL,
},
{
.name = "internal",
.mmc = 2,
.wires = 8,
.gpio_cd = -EINVAL,
.gpio_wp = -EINVAL,
},
{} /* Terminator */
};
static struct regulator_consumer_supply rx51_vmmc1_supply = {
.supply = "vmmc",
};
static struct regulator_consumer_supply rx51_vmmc2_supply = {
.supply = "vmmc",
};
static struct regulator_consumer_supply rx51_vsim_supply = {
.supply = "vmmc_aux",
};
static struct regulator_init_data rx51_vaux1 = { static struct regulator_init_data rx51_vaux1 = {
.constraints = { .constraints = {
.name = "V28", .name = "V28",
...@@ -308,6 +342,8 @@ static struct regulator_init_data rx51_vmmc1 = { ...@@ -308,6 +342,8 @@ static struct regulator_init_data rx51_vmmc1 = {
| REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS, | REGULATOR_CHANGE_STATUS,
}, },
.num_consumer_supplies = 1,
.consumer_supplies = &rx51_vmmc1_supply,
}; };
static struct regulator_init_data rx51_vmmc2 = { static struct regulator_init_data rx51_vmmc2 = {
...@@ -322,6 +358,8 @@ static struct regulator_init_data rx51_vmmc2 = { ...@@ -322,6 +358,8 @@ static struct regulator_init_data rx51_vmmc2 = {
| REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS, | REGULATOR_CHANGE_STATUS,
}, },
.num_consumer_supplies = 1,
.consumer_supplies = &rx51_vmmc2_supply,
}; };
static struct regulator_init_data rx51_vsim = { static struct regulator_init_data rx51_vsim = {
...@@ -335,6 +373,8 @@ static struct regulator_init_data rx51_vsim = { ...@@ -335,6 +373,8 @@ static struct regulator_init_data rx51_vsim = {
.valid_ops_mask = REGULATOR_CHANGE_MODE .valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS, | REGULATOR_CHANGE_STATUS,
}, },
.num_consumer_supplies = 1,
.consumer_supplies = &rx51_vsim_supply,
}; };
static struct regulator_init_data rx51_vdac = { static struct regulator_init_data rx51_vdac = {
...@@ -357,7 +397,11 @@ static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) ...@@ -357,7 +397,11 @@ static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
gpio_request(gpio + 7, "speaker_en"); gpio_request(gpio + 7, "speaker_en");
gpio_direction_output(gpio + 7, 1); gpio_direction_output(gpio + 7, 1);
/* FIXME connect power supplies to devices; register MMC */ /* set up MMC adapters, linking their regulators to them */
twl4030_mmc_init(mmc);
rx51_vmmc1_supply.dev = mmc[0].dev;
rx51_vmmc2_supply.dev = mmc[1].dev;
rx51_vsim_supply.dev = mmc[1].dev;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment