Commit 35ed78a0 authored by Ulf Hansson's avatar Ulf Hansson

Merge branch 'omap_hsmmc' into next

parents 0b07194b ddde0e7d
* TI OMAP SDHCI Controller
Refer to mmc.txt for standard MMC bindings.
Required properties:
- compatible: Should be "ti,dra7-sdhci" for DRA7 and DRA72 controllers
- ti,hwmods: Must be "mmc<n>", <n> is controller instance starting 1
Example:
mmc1: mmc@4809c000 {
compatible = "ti,dra7-sdhci";
reg = <0x4809c000 0x400>;
ti,hwmods = "mmc1";
bus-width = <4>;
vmmc-supply = <&vmmc>; /* phandle to regulator node */
};
...@@ -12049,6 +12049,12 @@ L: linux-mmc@vger.kernel.org ...@@ -12049,6 +12049,12 @@ L: linux-mmc@vger.kernel.org
S: Maintained S: Maintained
F: drivers/mmc/host/sdhci-spear.c F: drivers/mmc/host/sdhci-spear.c
SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) TI OMAP DRIVER
M: Kishon Vijay Abraham I <kishon@ti.com>
L: linux-mmc@vger.kernel.org
S: Maintained
F: drivers/mmc/host/sdhci-omap.c
SECURE ENCRYPTING DEVICE (SED) OPAL DRIVER SECURE ENCRYPTING DEVICE (SED) OPAL DRIVER
M: Scott Bauer <scott.bauer@intel.com> M: Scott Bauer <scott.bauer@intel.com>
M: Jonathan Derrick <jonathan.derrick@intel.com> M: Jonathan Derrick <jonathan.derrick@intel.com>
......
...@@ -899,3 +899,15 @@ config MMC_SDHCI_XENON ...@@ -899,3 +899,15 @@ config MMC_SDHCI_XENON
This selects Marvell Xenon eMMC/SD/SDIO SDHCI. This selects Marvell Xenon eMMC/SD/SDIO SDHCI.
If you have a controller with this interface, say Y or M here. If you have a controller with this interface, say Y or M here.
If unsure, say N. If unsure, say N.
config MMC_SDHCI_OMAP
tristate "TI SDHCI Controller Support"
depends on MMC_SDHCI_PLTFM && OF
help
This selects the Secure Digital Host Controller Interface (SDHCI)
support present in TI's DRA7 SOCs. The controller supports
SD/MMC/SDIO devices.
If you have a controller with this interface, say Y or M here.
If unsure, say N.
...@@ -89,6 +89,7 @@ obj-$(CONFIG_MMC_SDHCI_MSM) += sdhci-msm.o ...@@ -89,6 +89,7 @@ obj-$(CONFIG_MMC_SDHCI_MSM) += sdhci-msm.o
obj-$(CONFIG_MMC_SDHCI_ST) += sdhci-st.o obj-$(CONFIG_MMC_SDHCI_ST) += sdhci-st.o
obj-$(CONFIG_MMC_SDHCI_MICROCHIP_PIC32) += sdhci-pic32.o obj-$(CONFIG_MMC_SDHCI_MICROCHIP_PIC32) += sdhci-pic32.o
obj-$(CONFIG_MMC_SDHCI_BRCMSTB) += sdhci-brcmstb.o obj-$(CONFIG_MMC_SDHCI_BRCMSTB) += sdhci-brcmstb.o
obj-$(CONFIG_MMC_SDHCI_OMAP) += sdhci-omap.o
ifeq ($(CONFIG_CB710_DEBUG),y) ifeq ($(CONFIG_CB710_DEBUG),y)
CFLAGS-cb710-mmc += -DDEBUG CFLAGS-cb710-mmc += -DDEBUG
......
...@@ -147,10 +147,6 @@ ...@@ -147,10 +147,6 @@
#define OMAP_MMC_MAX_CLOCK 52000000 #define OMAP_MMC_MAX_CLOCK 52000000
#define DRIVER_NAME "omap_hsmmc" #define DRIVER_NAME "omap_hsmmc"
#define VDD_1V8 1800000 /* 180000 uV */
#define VDD_3V0 3000000 /* 300000 uV */
#define VDD_165_195 (ffs(MMC_VDD_165_195) - 1)
/* /*
* One controller can have multiple slots, like on some omap boards using * One controller can have multiple slots, like on some omap boards using
* omap.c controller driver. Luckily this is not currently done on any known * omap.c controller driver. Luckily this is not currently done on any known
...@@ -308,8 +304,7 @@ static int omap_hsmmc_disable_supply(struct mmc_host *mmc) ...@@ -308,8 +304,7 @@ static int omap_hsmmc_disable_supply(struct mmc_host *mmc)
return ret; return ret;
} }
static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on, static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on)
int vdd)
{ {
int ret; int ret;
...@@ -317,17 +312,6 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on, ...@@ -317,17 +312,6 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on,
return 0; return 0;
if (power_on) { if (power_on) {
if (vdd <= VDD_165_195)
ret = regulator_set_voltage(host->pbias, VDD_1V8,
VDD_1V8);
else
ret = regulator_set_voltage(host->pbias, VDD_3V0,
VDD_3V0);
if (ret < 0) {
dev_err(host->dev, "pbias set voltage fail\n");
return ret;
}
if (host->pbias_enabled == 0) { if (host->pbias_enabled == 0) {
ret = regulator_enable(host->pbias); ret = regulator_enable(host->pbias);
if (ret) { if (ret) {
...@@ -350,8 +334,7 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on, ...@@ -350,8 +334,7 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on,
return 0; return 0;
} }
static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on, static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on)
int vdd)
{ {
struct mmc_host *mmc = host->mmc; struct mmc_host *mmc = host->mmc;
int ret = 0; int ret = 0;
...@@ -363,7 +346,7 @@ static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on, ...@@ -363,7 +346,7 @@ static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on,
if (IS_ERR(mmc->supply.vmmc)) if (IS_ERR(mmc->supply.vmmc))
return 0; return 0;
ret = omap_hsmmc_set_pbias(host, false, 0); ret = omap_hsmmc_set_pbias(host, false);
if (ret) if (ret)
return ret; return ret;
...@@ -385,7 +368,7 @@ static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on, ...@@ -385,7 +368,7 @@ static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on,
if (ret) if (ret)
return ret; return ret;
ret = omap_hsmmc_set_pbias(host, true, vdd); ret = omap_hsmmc_set_pbias(host, true);
if (ret) if (ret)
goto err_set_voltage; goto err_set_voltage;
} else { } else {
...@@ -1220,11 +1203,11 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd) ...@@ -1220,11 +1203,11 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
clk_disable_unprepare(host->dbclk); clk_disable_unprepare(host->dbclk);
/* Turn the power off */ /* Turn the power off */
ret = omap_hsmmc_set_power(host, 0, 0); ret = omap_hsmmc_set_power(host, 0);
/* Turn the power ON with given VDD 1.8 or 3.0v */ /* Turn the power ON with given VDD 1.8 or 3.0v */
if (!ret) if (!ret)
ret = omap_hsmmc_set_power(host, 1, vdd); ret = omap_hsmmc_set_power(host, 1);
if (host->dbclk) if (host->dbclk)
clk_prepare_enable(host->dbclk); clk_prepare_enable(host->dbclk);
...@@ -1621,10 +1604,10 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -1621,10 +1604,10 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (ios->power_mode != host->power_mode) { if (ios->power_mode != host->power_mode) {
switch (ios->power_mode) { switch (ios->power_mode) {
case MMC_POWER_OFF: case MMC_POWER_OFF:
omap_hsmmc_set_power(host, 0, 0); omap_hsmmc_set_power(host, 0);
break; break;
case MMC_POWER_UP: case MMC_POWER_UP:
omap_hsmmc_set_power(host, 1, ios->vdd); omap_hsmmc_set_power(host, 1);
break; break;
case MMC_POWER_ON: case MMC_POWER_ON:
do_send_init_stream = 1; do_send_init_stream = 1;
......
This diff is collapsed.
...@@ -34,6 +34,8 @@ struct pbias_reg_info { ...@@ -34,6 +34,8 @@ struct pbias_reg_info {
u32 vmode; u32 vmode;
unsigned int enable_time; unsigned int enable_time;
char *name; char *name;
const unsigned int *pbias_volt_table;
int n_voltages;
}; };
struct pbias_regulator_data { struct pbias_regulator_data {
...@@ -49,11 +51,16 @@ struct pbias_of_data { ...@@ -49,11 +51,16 @@ struct pbias_of_data {
unsigned int offset; unsigned int offset;
}; };
static const unsigned int pbias_volt_table[] = { static const unsigned int pbias_volt_table_3_0V[] = {
1800000, 1800000,
3000000 3000000
}; };
static const unsigned int pbias_volt_table_3_3V[] = {
1800000,
3300000
};
static const struct regulator_ops pbias_regulator_voltage_ops = { static const struct regulator_ops pbias_regulator_voltage_ops = {
.list_voltage = regulator_list_voltage_table, .list_voltage = regulator_list_voltage_table,
.get_voltage_sel = regulator_get_voltage_sel_regmap, .get_voltage_sel = regulator_get_voltage_sel_regmap,
...@@ -69,6 +76,8 @@ static const struct pbias_reg_info pbias_mmc_omap2430 = { ...@@ -69,6 +76,8 @@ static const struct pbias_reg_info pbias_mmc_omap2430 = {
.vmode = BIT(0), .vmode = BIT(0),
.disable_val = 0, .disable_val = 0,
.enable_time = 100, .enable_time = 100,
.pbias_volt_table = pbias_volt_table_3_0V,
.n_voltages = 2,
.name = "pbias_mmc_omap2430" .name = "pbias_mmc_omap2430"
}; };
...@@ -77,6 +86,8 @@ static const struct pbias_reg_info pbias_sim_omap3 = { ...@@ -77,6 +86,8 @@ static const struct pbias_reg_info pbias_sim_omap3 = {
.enable_mask = BIT(9), .enable_mask = BIT(9),
.vmode = BIT(8), .vmode = BIT(8),
.enable_time = 100, .enable_time = 100,
.pbias_volt_table = pbias_volt_table_3_0V,
.n_voltages = 2,
.name = "pbias_sim_omap3" .name = "pbias_sim_omap3"
}; };
...@@ -86,6 +97,8 @@ static const struct pbias_reg_info pbias_mmc_omap4 = { ...@@ -86,6 +97,8 @@ static const struct pbias_reg_info pbias_mmc_omap4 = {
.disable_val = BIT(25), .disable_val = BIT(25),
.vmode = BIT(21), .vmode = BIT(21),
.enable_time = 100, .enable_time = 100,
.pbias_volt_table = pbias_volt_table_3_0V,
.n_voltages = 2,
.name = "pbias_mmc_omap4" .name = "pbias_mmc_omap4"
}; };
...@@ -95,6 +108,8 @@ static const struct pbias_reg_info pbias_mmc_omap5 = { ...@@ -95,6 +108,8 @@ static const struct pbias_reg_info pbias_mmc_omap5 = {
.disable_val = BIT(25), .disable_val = BIT(25),
.vmode = BIT(21), .vmode = BIT(21),
.enable_time = 100, .enable_time = 100,
.pbias_volt_table = pbias_volt_table_3_3V,
.n_voltages = 2,
.name = "pbias_mmc_omap5" .name = "pbias_mmc_omap5"
}; };
...@@ -199,8 +214,8 @@ static int pbias_regulator_probe(struct platform_device *pdev) ...@@ -199,8 +214,8 @@ static int pbias_regulator_probe(struct platform_device *pdev)
drvdata[data_idx].desc.owner = THIS_MODULE; drvdata[data_idx].desc.owner = THIS_MODULE;
drvdata[data_idx].desc.type = REGULATOR_VOLTAGE; drvdata[data_idx].desc.type = REGULATOR_VOLTAGE;
drvdata[data_idx].desc.ops = &pbias_regulator_voltage_ops; drvdata[data_idx].desc.ops = &pbias_regulator_voltage_ops;
drvdata[data_idx].desc.volt_table = pbias_volt_table; drvdata[data_idx].desc.volt_table = info->pbias_volt_table;
drvdata[data_idx].desc.n_voltages = 2; drvdata[data_idx].desc.n_voltages = info->n_voltages;
drvdata[data_idx].desc.enable_time = info->enable_time; drvdata[data_idx].desc.enable_time = info->enable_time;
drvdata[data_idx].desc.vsel_reg = offset; drvdata[data_idx].desc.vsel_reg = offset;
drvdata[data_idx].desc.vsel_mask = info->vmode; drvdata[data_idx].desc.vsel_mask = info->vmode;
......
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