mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 09:12:08 +02:00
mmc: fsl_esdhc_imx: add CD support when OF_PLATDATA is enabled
After enabling OF_PLATDATA support to both MMC and GPIO drivers add the support for card detection. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Stefano Babic
parent
a2845c9eeb
commit
7142ff9ec2
@@ -1498,7 +1498,30 @@ static int fsl_esdhc_probe(struct udevice *dev)
|
|||||||
priv->bus_width = 4;
|
priv->bus_width = 4;
|
||||||
else
|
else
|
||||||
priv->bus_width = 1;
|
priv->bus_width = 1;
|
||||||
|
|
||||||
|
if (dtplat->non_removable)
|
||||||
priv->non_removable = 1;
|
priv->non_removable = 1;
|
||||||
|
else
|
||||||
|
priv->non_removable = 0;
|
||||||
|
|
||||||
|
if (CONFIG_IS_ENABLED(DM_GPIO) && !priv->non_removable) {
|
||||||
|
struct udevice *gpiodev;
|
||||||
|
struct driver_info *info;
|
||||||
|
|
||||||
|
info = (struct driver_info *)dtplat->cd_gpios->node;
|
||||||
|
|
||||||
|
ret = device_get_by_driver_info(info, &gpiodev);
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = gpio_dev_request_index(gpiodev, gpiodev->name, "cd-gpios",
|
||||||
|
dtplat->cd_gpios->arg[0], GPIOD_IS_IN,
|
||||||
|
dtplat->cd_gpios->arg[1], &priv->cd_gpio);
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
|
Reference in New Issue
Block a user