#include <mach/dma.h>
#include <mach/gpmc.h>
-#define SMC91X_CS 1
+#include "mmc-twl4030.h"
+
+#define SYSTEM_REV_B_USES_VAUX3 0x1699
+#define SYSTEM_REV_S_USES_VAUX3 0x8
+
+#define SMC91X_CS 1
#define SMC91X_GPIO_IRQ 54
#define SMC91X_GPIO_RESET 164
#define SMC91X_GPIO_PWRDWN 86
KEY(0, 7, KEY_I),
KEY(1, 0, KEY_O),
KEY(1, 1, KEY_D),
- KEY(1, 2, KEY_DOT ),
+ KEY(1, 2, KEY_DOT),
KEY(1, 3, KEY_V),
- KEY(1, 4, KEY_DOWN ),
+ KEY(1, 4, KEY_DOWN),
KEY(2, 0, KEY_P),
KEY(2, 1, KEY_F),
- KEY(2, 2, KEY_UP ),
+ KEY(2, 2, KEY_UP),
KEY(2, 3, KEY_B),
- KEY(2, 4, KEY_RIGHT ),
- KEY(3, 0, KEY_COMMA ),
+ KEY(2, 4, KEY_RIGHT),
+ KEY(3, 0, KEY_COMMA),
KEY(3, 1, KEY_G),
- KEY(3, 2, KEY_ENTER ),
+ KEY(3, 2, KEY_ENTER),
KEY(3, 3, KEY_N),
- KEY(4, 0, KEY_BACKSPACE ),
+ KEY(4, 0, KEY_BACKSPACE),
KEY(4, 1, KEY_H),
KEY(4, 3, KEY_M),
KEY(4, 4, KEY_LEFTCTRL),
KEY(6, 1, KEY_K),
KEY(6, 2, KEY_X),
KEY(6, 3, KEY_SPACE),
- KEY(6, 4, KEY_FN ),
+ KEY(6, 4, KEY_FN),
KEY(7, 0, KEY_S),
KEY(7, 1, KEY_L),
KEY(7, 2, KEY_C),
.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 = {
.constraints = {
.name = "V28",
};
/* VAUX3 - adds more power to VIO_18 rail */
-static struct regulator_init_data rx51_vaux3 = {
+static struct regulator_init_data rx51_vaux3_cam = {
.constraints = {
.name = "VCAM_DIG_18",
.min_uV = 1800000,
},
};
+static struct regulator_init_data rx51_vaux3_mmc = {
+ .constraints = {
+ .name = "VMMC2_30",
+ .min_uV = 2800000,
+ .max_uV = 3000000,
+ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &rx51_vmmc2_supply,
+};
+
static struct regulator_init_data rx51_vaux4 = {
.constraints = {
.name = "VCAM_ANA_28",
| REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &rx51_vmmc1_supply,
};
static struct regulator_init_data rx51_vmmc2 = {
| REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &rx51_vmmc2_supply,
};
static struct regulator_init_data rx51_vsim = {
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &rx51_vsim_supply,
};
static struct regulator_init_data rx51_vdac = {
gpio_request(gpio + 7, "speaker_en");
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;
}
.vaux1 = &rx51_vaux1,
.vaux2 = &rx51_vaux2,
- .vaux3 = &rx51_vaux3,
.vaux4 = &rx51_vaux4,
.vmmc1 = &rx51_vmmc1,
- .vmmc2 = &rx51_vmmc2,
.vsim = &rx51_vsim,
.vdac = &rx51_vdac,
};
static int __init rx51_i2c_init(void)
{
+ if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) ||
+ system_rev >= SYSTEM_REV_B_USES_VAUX3)
+ rx51_twldata.vaux3 = &rx51_vaux3_mmc;
+ else {
+ rx51_twldata.vaux3 = &rx51_vaux3_cam;
+ rx51_twldata.vmmc2 = &rx51_vmmc2;
+ }
omap_register_i2c_bus(1, 2600, rx51_peripherals_i2c_board_info_1,
ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
omap_register_i2c_bus(2, 100, NULL, 0);