aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/dw_mmc-exynos.c38
-rw-r--r--drivers/mmc/host/dw_mmc.c8
-rw-r--r--drivers/mmc/host/dw_mmc.h3
3 files changed, 0 insertions, 49 deletions
diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
index c7f09762e6c0..f013e7e3746b 100644
--- a/drivers/mmc/host/dw_mmc-exynos.c
+++ b/drivers/mmc/host/dw_mmc-exynos.c
@@ -152,43 +152,6 @@ static int dw_mci_exynos_parse_dt(struct dw_mci *host)
152 return 0; 152 return 0;
153} 153}
154 154
155static int dw_mci_exynos_setup_bus(struct dw_mci *host,
156 struct device_node *slot_np, u8 bus_width)
157{
158 int idx, gpio, ret;
159
160 if (!slot_np)
161 return -EINVAL;
162
163 /* cmd + clock + bus-width pins */
164 for (idx = 0; idx < NUM_PINS(bus_width); idx++) {
165 gpio = of_get_gpio(slot_np, idx);
166 if (!gpio_is_valid(gpio)) {
167 dev_err(host->dev, "invalid gpio: %d\n", gpio);
168 return -EINVAL;
169 }
170
171 ret = devm_gpio_request(host->dev, gpio, "dw-mci-bus");
172 if (ret) {
173 dev_err(host->dev, "gpio [%d] request failed\n", gpio);
174 return -EBUSY;
175 }
176 }
177
178 if (host->pdata->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
179 return 0;
180
181 gpio = of_get_named_gpio(slot_np, "samsung,cd-pinmux-gpio", 0);
182 if (gpio_is_valid(gpio)) {
183 if (devm_gpio_request(host->dev, gpio, "dw-mci-cd"))
184 dev_err(host->dev, "gpio [%d] request failed\n", gpio);
185 } else {
186 dev_info(host->dev, "cd gpio not available");
187 }
188
189 return 0;
190}
191
192/* Common capabilities of Exynos4/Exynos5 SoC */ 155/* Common capabilities of Exynos4/Exynos5 SoC */
193static unsigned long exynos_dwmmc_caps[4] = { 156static unsigned long exynos_dwmmc_caps[4] = {
194 MMC_CAP_UHS_DDR50 | MMC_CAP_1_8V_DDR | 157 MMC_CAP_UHS_DDR50 | MMC_CAP_1_8V_DDR |
@@ -205,7 +168,6 @@ static const struct dw_mci_drv_data exynos_drv_data = {
205 .prepare_command = dw_mci_exynos_prepare_command, 168 .prepare_command = dw_mci_exynos_prepare_command,
206 .set_ios = dw_mci_exynos_set_ios, 169 .set_ios = dw_mci_exynos_set_ios,
207 .parse_dt = dw_mci_exynos_parse_dt, 170 .parse_dt = dw_mci_exynos_parse_dt,
208 .setup_bus = dw_mci_exynos_setup_bus,
209}; 171};
210 172
211static const struct of_device_id dw_mci_exynos_match[] = { 173static const struct of_device_id dw_mci_exynos_match[] = {
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 45d921650d4b..bc3a1bc4940f 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1952,14 +1952,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
1952 else 1952 else
1953 bus_width = 1; 1953 bus_width = 1;
1954 1954
1955 if (drv_data && drv_data->setup_bus) {
1956 struct device_node *slot_np;
1957 slot_np = dw_mci_of_find_slot_node(host->dev, slot->id);
1958 ret = drv_data->setup_bus(host, slot_np, bus_width);
1959 if (ret)
1960 goto err_setup_bus;
1961 }
1962
1963 switch (bus_width) { 1955 switch (bus_width) {
1964 case 8: 1956 case 8:
1965 mmc->caps |= MMC_CAP_8_BIT_DATA; 1957 mmc->caps |= MMC_CAP_8_BIT_DATA;
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index 53b8fd987e47..0b74189e7ee7 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -190,7 +190,6 @@ extern int dw_mci_resume(struct dw_mci *host);
190 * @prepare_command: handle CMD register extensions. 190 * @prepare_command: handle CMD register extensions.
191 * @set_ios: handle bus specific extensions. 191 * @set_ios: handle bus specific extensions.
192 * @parse_dt: parse implementation specific device tree properties. 192 * @parse_dt: parse implementation specific device tree properties.
193 * @setup_bus: initialize io-interface
194 * 193 *
195 * Provide controller implementation specific extensions. The usage of this 194 * Provide controller implementation specific extensions. The usage of this
196 * data structure is fully optional and usage of each member in this structure 195 * data structure is fully optional and usage of each member in this structure
@@ -203,7 +202,5 @@ struct dw_mci_drv_data {
203 void (*prepare_command)(struct dw_mci *host, u32 *cmdr); 202 void (*prepare_command)(struct dw_mci *host, u32 *cmdr);
204 void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios); 203 void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios);
205 int (*parse_dt)(struct dw_mci *host); 204 int (*parse_dt)(struct dw_mci *host);
206 int (*setup_bus)(struct dw_mci *host,
207 struct device_node *slot_np, u8 bus_width);
208}; 205};
209#endif /* _DW_MMC_H_ */ 206#endif /* _DW_MMC_H_ */