Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32d781a3 authored by Thomas Abraham's avatar Thomas Abraham Committed by Chris Ball
Browse files

mmc: dw_mmc: let device core setup the default pin configuration



With device core now able to setup the default pin configuration,
the pin configuration code based on the deprecated Samsung specific
gpio bindings is removed.

Signed-off-by: default avatarThomas Abraham <thomas.abraham@linaro.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarDoug Anderson <dianders@chromium.org>
Tested-by: default avatarDoug Anderson <dianders@chromium.org>
Acked-by: default avatarSeungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 1d53196a
Loading
Loading
Loading
Loading
+0 −38
Original line number Diff line number Diff line
@@ -152,43 +152,6 @@ static int dw_mci_exynos_parse_dt(struct dw_mci *host)
	return 0;
}

static int dw_mci_exynos_setup_bus(struct dw_mci *host,
				struct device_node *slot_np, u8 bus_width)
{
	int idx, gpio, ret;

	if (!slot_np)
		return -EINVAL;

	/* cmd + clock + bus-width pins */
	for (idx = 0; idx < NUM_PINS(bus_width); idx++) {
		gpio = of_get_gpio(slot_np, idx);
		if (!gpio_is_valid(gpio)) {
			dev_err(host->dev, "invalid gpio: %d\n", gpio);
			return -EINVAL;
		}

		ret = devm_gpio_request(host->dev, gpio, "dw-mci-bus");
		if (ret) {
			dev_err(host->dev, "gpio [%d] request failed\n", gpio);
			return -EBUSY;
		}
	}

	if (host->pdata->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
		return 0;

	gpio = of_get_named_gpio(slot_np, "samsung,cd-pinmux-gpio", 0);
	if (gpio_is_valid(gpio)) {
		if (devm_gpio_request(host->dev, gpio, "dw-mci-cd"))
			dev_err(host->dev, "gpio [%d] request failed\n", gpio);
	} else {
		dev_info(host->dev, "cd gpio not available");
	}

	return 0;
}

/* Common capabilities of Exynos4/Exynos5 SoC */
static unsigned long exynos_dwmmc_caps[4] = {
	MMC_CAP_UHS_DDR50 | MMC_CAP_1_8V_DDR |
@@ -205,7 +168,6 @@ static const struct dw_mci_drv_data exynos_drv_data = {
	.prepare_command	= dw_mci_exynos_prepare_command,
	.set_ios		= dw_mci_exynos_set_ios,
	.parse_dt		= dw_mci_exynos_parse_dt,
	.setup_bus		= dw_mci_exynos_setup_bus,
};

static const struct of_device_id dw_mci_exynos_match[] = {
+0 −8
Original line number Diff line number Diff line
@@ -1952,14 +1952,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
	else
		bus_width = 1;

	if (drv_data && drv_data->setup_bus) {
		struct device_node *slot_np;
		slot_np = dw_mci_of_find_slot_node(host->dev, slot->id);
		ret = drv_data->setup_bus(host, slot_np, bus_width);
		if (ret)
			goto err_setup_bus;
	}

	switch (bus_width) {
	case 8:
		mmc->caps |= MMC_CAP_8_BIT_DATA;
+0 −3
Original line number Diff line number Diff line
@@ -190,7 +190,6 @@ extern int dw_mci_resume(struct dw_mci *host);
 * @prepare_command: handle CMD register extensions.
 * @set_ios: handle bus specific extensions.
 * @parse_dt: parse implementation specific device tree properties.
 * @setup_bus: initialize io-interface
 *
 * Provide controller implementation specific extensions. The usage of this
 * data structure is fully optional and usage of each member in this structure
@@ -203,7 +202,5 @@ struct dw_mci_drv_data {
	void		(*prepare_command)(struct dw_mci *host, u32 *cmdr);
	void		(*set_ios)(struct dw_mci *host, struct mmc_ios *ios);
	int		(*parse_dt)(struct dw_mci *host);
	int		(*setup_bus)(struct dw_mci *host,
				struct device_node *slot_np, u8 bus_width);
};
#endif /* _DW_MMC_H_ */