Skip to content

Commit ba64792

Browse files
Faiz-Abbasstorulf
authored andcommitted
ARM: OMAP2+: hsmmc.c: Remove dead code
Most platforms using OMAP hsmmc driver have switched to device tree for passing platform data to omap_hsmmc.c driver. The hsmmc.c file in mach-omap2 exists only to support pandora board which uses wl1251 driver in legacy platform data mode. Hence, remove the dead code not used by the pandora board. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 26cb2be commit ba64792

File tree

2 files changed

+2
-246
lines changed

2 files changed

+2
-246
lines changed

arch/arm/mach-omap2/hsmmc.c

Lines changed: 2 additions & 237 deletions
Original file line numberDiff line numberDiff line change
@@ -32,120 +32,6 @@ static u16 control_devconf1_offset;
3232

3333
#define HSMMC_NAME_LEN 9
3434

35-
static void omap_hsmmc1_before_set_reg(struct device *dev,
36-
int power_on, int vdd)
37-
{
38-
u32 reg, prog_io;
39-
struct omap_hsmmc_platform_data *mmc = dev->platform_data;
40-
41-
if (mmc->remux)
42-
mmc->remux(dev, power_on);
43-
44-
/*
45-
* Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the
46-
* card with Vcc regulator (from twl4030 or whatever). OMAP has both
47-
* 1.8V and 3.0V modes, controlled by the PBIAS register.
48-
*
49-
* In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which
50-
* is most naturally TWL VSIM; those pins also use PBIAS.
51-
*
52-
* FIXME handle VMMC1A as needed ...
53-
*/
54-
if (power_on) {
55-
if (cpu_is_omap2430()) {
56-
reg = omap_ctrl_readl(OMAP243X_CONTROL_DEVCONF1);
57-
if ((1 << vdd) >= MMC_VDD_30_31)
58-
reg |= OMAP243X_MMC1_ACTIVE_OVERWRITE;
59-
else
60-
reg &= ~OMAP243X_MMC1_ACTIVE_OVERWRITE;
61-
omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1);
62-
}
63-
64-
if (mmc->internal_clock) {
65-
reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
66-
reg |= OMAP2_MMCSDIO1ADPCLKISEL;
67-
omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0);
68-
}
69-
70-
reg = omap_ctrl_readl(control_pbias_offset);
71-
if (cpu_is_omap3630()) {
72-
/* Set MMC I/O to 52MHz */
73-
prog_io = omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO1);
74-
prog_io |= OMAP3630_PRG_SDMMC1_SPEEDCTRL;
75-
omap_ctrl_writel(prog_io, OMAP343X_CONTROL_PROG_IO1);
76-
} else {
77-
reg |= OMAP2_PBIASSPEEDCTRL0;
78-
}
79-
reg &= ~OMAP2_PBIASLITEPWRDNZ0;
80-
omap_ctrl_writel(reg, control_pbias_offset);
81-
} else {
82-
reg = omap_ctrl_readl(control_pbias_offset);
83-
reg &= ~OMAP2_PBIASLITEPWRDNZ0;
84-
omap_ctrl_writel(reg, control_pbias_offset);
85-
}
86-
}
87-
88-
static void omap_hsmmc1_after_set_reg(struct device *dev, int power_on, int vdd)
89-
{
90-
u32 reg;
91-
92-
/* 100ms delay required for PBIAS configuration */
93-
msleep(100);
94-
95-
if (power_on) {
96-
reg = omap_ctrl_readl(control_pbias_offset);
97-
reg |= (OMAP2_PBIASLITEPWRDNZ0 | OMAP2_PBIASSPEEDCTRL0);
98-
if ((1 << vdd) <= MMC_VDD_165_195)
99-
reg &= ~OMAP2_PBIASLITEVMODE0;
100-
else
101-
reg |= OMAP2_PBIASLITEVMODE0;
102-
omap_ctrl_writel(reg, control_pbias_offset);
103-
} else {
104-
reg = omap_ctrl_readl(control_pbias_offset);
105-
reg |= (OMAP2_PBIASSPEEDCTRL0 | OMAP2_PBIASLITEPWRDNZ0 |
106-
OMAP2_PBIASLITEVMODE0);
107-
omap_ctrl_writel(reg, control_pbias_offset);
108-
}
109-
}
110-
111-
static void hsmmc2_select_input_clk_src(struct omap_hsmmc_platform_data *mmc)
112-
{
113-
u32 reg;
114-
115-
reg = omap_ctrl_readl(control_devconf1_offset);
116-
if (mmc->internal_clock)
117-
reg |= OMAP2_MMCSDIO2ADPCLKISEL;
118-
else
119-
reg &= ~OMAP2_MMCSDIO2ADPCLKISEL;
120-
omap_ctrl_writel(reg, control_devconf1_offset);
121-
}
122-
123-
static void hsmmc2_before_set_reg(struct device *dev, int power_on, int vdd)
124-
{
125-
struct omap_hsmmc_platform_data *mmc = dev->platform_data;
126-
127-
if (mmc->remux)
128-
mmc->remux(dev, power_on);
129-
130-
if (power_on)
131-
hsmmc2_select_input_clk_src(mmc);
132-
}
133-
134-
static int am35x_hsmmc2_set_power(struct device *dev, int power_on, int vdd)
135-
{
136-
struct omap_hsmmc_platform_data *mmc = dev->platform_data;
137-
138-
if (power_on)
139-
hsmmc2_select_input_clk_src(mmc);
140-
141-
return 0;
142-
}
143-
144-
static int nop_mmc_set_power(struct device *dev, int power_on, int vdd)
145-
{
146-
return 0;
147-
}
148-
14935
static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
15036
struct omap_hsmmc_platform_data *mmc)
15137
{
@@ -157,101 +43,11 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
15743
return -ENOMEM;
15844
}
15945

160-
if (c->name)
161-
strncpy(hc_name, c->name, HSMMC_NAME_LEN);
162-
else
163-
snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i",
164-
c->mmc, 1);
46+
snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i", c->mmc, 1);
16547
mmc->name = hc_name;
16648
mmc->caps = c->caps;
167-
mmc->internal_clock = !c->ext_clock;
16849
mmc->reg_offset = 0;
16950

170-
if (c->cover_only) {
171-
/* detect if mobile phone cover removed */
172-
mmc->gpio_cd = -EINVAL;
173-
mmc->gpio_cod = c->gpio_cd;
174-
} else {
175-
/* card detect pin on the mmc socket itself */
176-
mmc->gpio_cd = c->gpio_cd;
177-
mmc->gpio_cod = -EINVAL;
178-
}
179-
mmc->gpio_wp = c->gpio_wp;
180-
181-
mmc->remux = c->remux;
182-
mmc->init_card = c->init_card;
183-
184-
if (c->nonremovable)
185-
mmc->nonremovable = 1;
186-
187-
/*
188-
* NOTE: MMC slots should have a Vcc regulator set up.
189-
* This may be from a TWL4030-family chip, another
190-
* controllable regulator, or a fixed supply.
191-
*
192-
* temporary HACK: ocr_mask instead of fixed supply
193-
*/
194-
if (soc_is_am35xx())
195-
mmc->ocr_mask = MMC_VDD_165_195 |
196-
MMC_VDD_26_27 |
197-
MMC_VDD_27_28 |
198-
MMC_VDD_29_30 |
199-
MMC_VDD_30_31 |
200-
MMC_VDD_31_32;
201-
else
202-
mmc->ocr_mask = c->ocr_mask;
203-
204-
if (!soc_is_am35xx())
205-
mmc->features |= HSMMC_HAS_PBIAS;
206-
207-
switch (c->mmc) {
208-
case 1:
209-
if (mmc->features & HSMMC_HAS_PBIAS) {
210-
/* on-chip level shifting via PBIAS0/PBIAS1 */
211-
mmc->before_set_reg =
212-
omap_hsmmc1_before_set_reg;
213-
mmc->after_set_reg =
214-
omap_hsmmc1_after_set_reg;
215-
}
216-
217-
if (soc_is_am35xx())
218-
mmc->set_power = nop_mmc_set_power;
219-
220-
/* OMAP3630 HSMMC1 supports only 4-bit */
221-
if (cpu_is_omap3630() &&
222-
(c->caps & MMC_CAP_8_BIT_DATA)) {
223-
c->caps &= ~MMC_CAP_8_BIT_DATA;
224-
c->caps |= MMC_CAP_4_BIT_DATA;
225-
mmc->caps = c->caps;
226-
}
227-
break;
228-
case 2:
229-
if (soc_is_am35xx())
230-
mmc->set_power = am35x_hsmmc2_set_power;
231-
232-
if (c->ext_clock)
233-
c->transceiver = 1;
234-
if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) {
235-
c->caps &= ~MMC_CAP_8_BIT_DATA;
236-
c->caps |= MMC_CAP_4_BIT_DATA;
237-
}
238-
if (mmc->features & HSMMC_HAS_PBIAS) {
239-
/* off-chip level shifting, or none */
240-
mmc->before_set_reg = hsmmc2_before_set_reg;
241-
mmc->after_set_reg = NULL;
242-
}
243-
break;
244-
case 3:
245-
case 4:
246-
case 5:
247-
mmc->before_set_reg = NULL;
248-
mmc->after_set_reg = NULL;
249-
break;
250-
default:
251-
pr_err("MMC%d configuration not supported!\n", c->mmc);
252-
kfree(hc_name);
253-
return -ENODEV;
254-
}
25551
return 0;
25652
}
25753

@@ -260,7 +56,6 @@ static int omap_hsmmc_done;
26056
void omap_hsmmc_late_init(struct omap2_hsmmc_info *c)
26157
{
26258
struct platform_device *pdev;
263-
struct omap_hsmmc_platform_data *mmc_pdata;
26459
int res;
26560

26661
if (omap_hsmmc_done != 1)
@@ -269,32 +64,12 @@ void omap_hsmmc_late_init(struct omap2_hsmmc_info *c)
26964
omap_hsmmc_done++;
27065

27166
for (; c->mmc; c++) {
272-
if (!c->deferred)
273-
continue;
274-
27567
pdev = c->pdev;
27668
if (!pdev)
27769
continue;
278-
279-
mmc_pdata = pdev->dev.platform_data;
280-
if (!mmc_pdata)
281-
continue;
282-
283-
if (c->cover_only) {
284-
/* detect if mobile phone cover removed */
285-
mmc_pdata->gpio_cd = -EINVAL;
286-
mmc_pdata->gpio_cod = c->gpio_cd;
287-
} else {
288-
/* card detect pin on the mmc socket itself */
289-
mmc_pdata->gpio_cd = c->gpio_cd;
290-
mmc_pdata->gpio_cod = -EINVAL;
291-
}
292-
mmc_pdata->gpio_wp = c->gpio_wp;
293-
29470
res = omap_device_register(pdev);
29571
if (res)
296-
pr_err("Could not late init MMC %s\n",
297-
c->name);
72+
pr_err("Could not late init MMC\n");
29873
}
29974
}
30075

@@ -336,13 +111,6 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
336111
if (oh->dev_attr != NULL) {
337112
mmc_dev_attr = oh->dev_attr;
338113
mmc_data->controller_flags = mmc_dev_attr->flags;
339-
/*
340-
* erratum 2.1.1.128 doesn't apply if board has
341-
* a transceiver is attached
342-
*/
343-
if (hsmmcinfo->transceiver)
344-
mmc_data->controller_flags &=
345-
~OMAP_HSMMC_BROKEN_MULTIBLOCK_READ;
346114
}
347115

348116
pdev = platform_device_alloc(name, ctrl_nr - 1);
@@ -367,9 +135,6 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
367135

368136
hsmmcinfo->pdev = pdev;
369137

370-
if (hsmmcinfo->deferred)
371-
goto free_mmc;
372-
373138
res = omap_device_register(pdev);
374139
if (res) {
375140
pr_err("Could not register od for %s\n", name);

arch/arm/mach-omap2/hsmmc.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,9 @@ struct omap2_hsmmc_info {
1212
u8 mmc; /* controller 1/2/3 */
1313
u32 caps; /* 4/8 wires and any additional host
1414
* capabilities OR'd (ref. linux/mmc/host.h) */
15-
bool transceiver; /* MMC-2 option */
16-
bool ext_clock; /* use external pin for input clock */
17-
bool cover_only; /* No card detect - just cover switch */
18-
bool nonremovable; /* Nonremovable e.g. eMMC */
19-
bool deferred; /* mmc needs a deferred probe */
2015
int gpio_cd; /* or -EINVAL */
2116
int gpio_wp; /* or -EINVAL */
22-
char *name; /* or NULL for default */
2317
struct platform_device *pdev; /* mmc controller instance */
24-
int ocr_mask; /* temporary HACK */
25-
/* Remux (pad configuration) when powering on/off */
26-
void (*remux)(struct device *dev, int power_on);
2718
/* init some special card */
2819
void (*init_card)(struct mmc_card *card);
2920
};

0 commit comments

Comments
 (0)