Commit 3b4cf2f1 authored by Tony Lindgren's avatar Tony Lindgren

HSMMC: Rename some hsmmc init functions to twl_mmc

Rename some hsmmc init functions to twl_mmc
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 71461ca5
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
static u16 control_pbias_offset; static u16 control_pbias_offset;
static struct hsmmc_controller { static struct twl_mmc_controller {
u16 control_devconf_offset; u16 control_devconf_offset;
u32 devconf_loopback_clock; u32 devconf_loopback_clock;
int card_detect_gpio; int card_detect_gpio;
...@@ -76,7 +76,7 @@ static struct hsmmc_controller { ...@@ -76,7 +76,7 @@ static struct hsmmc_controller {
}, },
}; };
static int hsmmc1_card_detect(int irq) static int twl_mmc1_card_detect(int irq)
{ {
return gpio_get_value_cansleep(hsmmc[0].card_detect_gpio); return gpio_get_value_cansleep(hsmmc[0].card_detect_gpio);
} }
...@@ -84,7 +84,7 @@ static int hsmmc1_card_detect(int irq) ...@@ -84,7 +84,7 @@ static int hsmmc1_card_detect(int irq)
/* /*
* MMC Slot Initialization. * MMC Slot Initialization.
*/ */
static int hsmmc1_late_init(struct device *dev) static int twl_mmc1_late_init(struct device *dev)
{ {
int ret = 0; int ret = 0;
...@@ -107,7 +107,7 @@ err: ...@@ -107,7 +107,7 @@ err:
return ret; return ret;
} }
static void hsmmc1_cleanup(struct device *dev) static void twl_mmc1_cleanup(struct device *dev)
{ {
gpio_free(hsmmc[0].card_detect_gpio); gpio_free(hsmmc[0].card_detect_gpio);
} }
...@@ -119,7 +119,7 @@ static void hsmmc1_cleanup(struct device *dev) ...@@ -119,7 +119,7 @@ static void hsmmc1_cleanup(struct device *dev)
* mask : 1 * mask : 1
* unmask : 0 * unmask : 0
*/ */
static int mask_cd_interrupt(int mask) static int twl_mmc_mask_cd_interrupt(int mask)
{ {
u8 reg = 0, ret = 0; u8 reg = 0, ret = 0;
...@@ -147,35 +147,35 @@ err: ...@@ -147,35 +147,35 @@ err:
return ret; return ret;
} }
static int hsmmc1_suspend(struct device *dev, int slot) static int twl_mmc1_suspend(struct device *dev, int slot)
{ {
int ret = 0; int ret = 0;
disable_irq(hsmmc[0].card_detect_gpio); disable_irq(hsmmc[0].card_detect_gpio);
ret = mask_cd_interrupt(1); ret = twl_mmc_mask_cd_interrupt(1);
return ret; return ret;
} }
static int hsmmc1_resume(struct device *dev, int slot) static int twl_mmc1_resume(struct device *dev, int slot)
{ {
int ret = 0; int ret = 0;
enable_irq(hsmmc[0].card_detect_gpio); enable_irq(hsmmc[0].card_detect_gpio);
ret = mask_cd_interrupt(0); ret = twl_mmc_mask_cd_interrupt(0);
return ret; return ret;
} }
#else #else
#define hsmmc1_suspend NULL #define twl_mmc1_suspend NULL
#define hsmmc1_resume NULL #define twl_mmc1_resume NULL
#endif #endif
/* /*
* Sets the MMC voltage in twl4030 * Sets the MMC voltage in twl4030
*/ */
static int hsmmc_twl_set_voltage(struct hsmmc_controller *c, int vdd) static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd)
{ {
int ret; int ret;
u8 vmmc, dev_grp_val; u8 vmmc, dev_grp_val;
...@@ -243,12 +243,12 @@ static int hsmmc_twl_set_voltage(struct hsmmc_controller *c, int vdd) ...@@ -243,12 +243,12 @@ static int hsmmc_twl_set_voltage(struct hsmmc_controller *c, int vdd)
return ret; return ret;
} }
static int hsmmc1_set_power(struct device *dev, int slot, int power_on, static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
int vdd) int vdd)
{ {
u32 reg; u32 reg;
int ret = 0; int ret = 0;
struct hsmmc_controller *c = &hsmmc[0]; struct twl_mmc_controller *c = &hsmmc[0];
if (power_on) { if (power_on) {
if (cpu_is_omap2430()) { if (cpu_is_omap2430()) {
...@@ -272,7 +272,7 @@ static int hsmmc1_set_power(struct device *dev, int slot, int power_on, ...@@ -272,7 +272,7 @@ static int hsmmc1_set_power(struct device *dev, int slot, int power_on,
reg &= ~OMAP2_PBIASLITEPWRDNZ0; reg &= ~OMAP2_PBIASLITEPWRDNZ0;
omap_ctrl_writel(reg, control_pbias_offset); omap_ctrl_writel(reg, control_pbias_offset);
ret = hsmmc_twl_set_voltage(c, vdd); ret = twl_mmc_set_voltage(c, vdd);
/* 100ms delay required for PBIAS configuration */ /* 100ms delay required for PBIAS configuration */
msleep(100); msleep(100);
...@@ -288,7 +288,7 @@ static int hsmmc1_set_power(struct device *dev, int slot, int power_on, ...@@ -288,7 +288,7 @@ static int hsmmc1_set_power(struct device *dev, int slot, int power_on,
reg &= ~OMAP2_PBIASLITEPWRDNZ0; reg &= ~OMAP2_PBIASLITEPWRDNZ0;
omap_ctrl_writel(reg, control_pbias_offset); omap_ctrl_writel(reg, control_pbias_offset);
ret = hsmmc_twl_set_voltage(c, 0); ret = twl_mmc_set_voltage(c, 0);
/* 100ms delay required for PBIAS configuration */ /* 100ms delay required for PBIAS configuration */
msleep(100); msleep(100);
...@@ -301,11 +301,11 @@ static int hsmmc1_set_power(struct device *dev, int slot, int power_on, ...@@ -301,11 +301,11 @@ static int hsmmc1_set_power(struct device *dev, int slot, int power_on,
return ret; return ret;
} }
static int hsmmc2_set_power(struct device *dev, int slot, int power_on, int vdd) static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vdd)
{ {
int ret; int ret;
struct hsmmc_controller *c = &hsmmc[1]; struct twl_mmc_controller *c = &hsmmc[1];
if (power_on) { if (power_on) {
u32 reg; u32 reg;
...@@ -313,9 +313,9 @@ static int hsmmc2_set_power(struct device *dev, int slot, int power_on, int vdd) ...@@ -313,9 +313,9 @@ static int hsmmc2_set_power(struct device *dev, int slot, int power_on, int vdd)
reg = omap_ctrl_readl(c->control_devconf_offset); reg = omap_ctrl_readl(c->control_devconf_offset);
reg |= OMAP2_MMCSDIO2ADPCLKISEL; reg |= OMAP2_MMCSDIO2ADPCLKISEL;
omap_ctrl_writel(reg, c->control_devconf_offset); omap_ctrl_writel(reg, c->control_devconf_offset);
ret = hsmmc_twl_set_voltage(c, vdd); ret = twl_mmc_set_voltage(c, vdd);
} else { } else {
ret = hsmmc_twl_set_voltage(c, 0); ret = twl_mmc_set_voltage(c, 0);
} }
return ret; return ret;
...@@ -368,16 +368,16 @@ void __init hsmmc_init(struct twl4030_hsmmc_info *controllers) ...@@ -368,16 +368,16 @@ void __init hsmmc_init(struct twl4030_hsmmc_info *controllers)
switch (c->mmc) { switch (c->mmc) {
case 1: case 1:
mmc->init = hsmmc1_late_init; mmc->init = twl_mmc1_late_init;
mmc->cleanup = hsmmc1_cleanup; mmc->cleanup = twl_mmc1_cleanup;
mmc->suspend = hsmmc1_suspend; mmc->suspend = twl_mmc1_suspend;
mmc->resume = hsmmc1_resume; mmc->resume = twl_mmc1_resume;
mmc->slots[0].set_power = hsmmc1_set_power; mmc->slots[0].set_power = twl_mmc1_set_power;
mmc->slots[0].card_detect = hsmmc1_card_detect; mmc->slots[0].card_detect = twl_mmc1_card_detect;
hsmmc_data[0] = mmc; hsmmc_data[0] = mmc;
break; break;
case 2: case 2:
mmc->slots[0].set_power = hsmmc2_set_power; mmc->slots[0].set_power = twl_mmc2_set_power;
hsmmc_data[1] = mmc; hsmmc_data[1] = mmc;
break; break;
default: default:
......
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