On 08/28/2012 02:10 PM, Thomas Abraham wrote: > On 28 August 2012 10:40, Thomas Abraham <thomas.abraham@xxxxxxxxxx> wrote: >> On 28 August 2012 10:25, Jaehoon Chung <jh80.chung@xxxxxxxxxxx> wrote: >>> Hi Thomas, >>> >>> On 08/28/2012 01:48 PM, Thomas Abraham wrote: >>>> On 27 August 2012 14:28, Jaehoon Chung <jh80.chung@xxxxxxxxxxx> wrote: >>>>> Hi Thomas, >>>>> >>>>>> + gpio = of_get_named_gpio(slot_np, "wp-gpios", 0); >>>>>> + if (gpio_is_valid(gpio)) { >>>>>> + if (devm_gpio_request(host->dev, gpio, "dw-mci-wp")) >>>>>> + dev_info(host->dev, "gpio [%d] request failed\n", >>>>>> + gpio); >>>>>> + } else { >>>>>> + dev_info(host->dev, "wp gpio not available"); >>>>>> + host->pdata->quirks |= DW_MCI_QUIRK_NO_WRITE_PROTECT; >>>>>> + } >>>>>> + >>>>>> + 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")) >>>>> I'm not sure, but i saw mmc_gpio_request_cd() into drivers/mmc/core/slot-gpio.c. >>>>> Can we use this? i think we can use them. >>>>> Just my opinion. >>>> >>>> Thanks for letting me know about this, I was not aware of this. >>>> Looking into this code, it is usable for controllers that use a gpio >>>> (specified using cd-gpios property) as card-detect line. As you know, >>>> the dw-mmc driver does not support this feature yet. In case of >>>> exynos, the card-detect pin of the mmc slot is connected to the >>>> card-detect pad of the dw-mmc controller using pinmux, which is not >>>> considered as a gpio. Hence, mmc_gpio_request_cd() is not applicable >>>> in this case. >>> But In case of external card-detect-pin, we can use the mmc_gpio_request_cd(). >> >> Yes, we can use. But the current dw-mmc controller driver does not >> support this feature yet. The existing driver considers that (a) >> card-detect line is connected to the card-detect pad of the controller >> or (b) it is broken. For Exynos5250, it is case (a). There is no > > Sorry, I meant smdk5250, not Exynos5250. Already i tested with my exynos5 board. If you want, i will share the patch. Best Regards, Jaehoon Chung > >> support for using a gpio as an card-detect line. >> >> Thanks, >> Thomas. > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html