The Ux500 MMCI variant can control external level-shifter signal
directions through the power register. Parse the standard ST MMCI
device tree properties and set the corresponding direction and
feedback-clock bits.

This is required by the external SD card slot on Samsung Janice, where
commands cannot reach the card unless the direction controls are set.

Signed-off-by: Linus Walleij <[email protected]>
---
 drivers/mmc/arm_pl180_mmci.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index f00b0ff0dc95..af21b814641e 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -427,6 +427,19 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
                host->version2 = false; /* ARM variant */
        }
 
+       if (dev_read_bool(dev, "st,sig-dir-dat0"))
+               host->pwr_init |= SDI_PWR_DAT0DIREN;
+       if (dev_read_bool(dev, "st,sig-dir-dat2"))
+               host->pwr_init |= SDI_PWR_DAT2DIREN;
+       if (dev_read_bool(dev, "st,sig-dir-dat31"))
+               host->pwr_init |= SDI_PWR_DAT31DIREN;
+       if (dev_read_bool(dev, "st,sig-dir-dat74"))
+               host->pwr_init |= SDI_PWR_DAT74DIREN;
+       if (dev_read_bool(dev, "st,sig-dir-cmd"))
+               host->pwr_init |= SDI_PWR_CMDDIREN;
+       if (dev_read_bool(dev, "st,sig-pin-fbclk"))
+               host->pwr_init |= SDI_PWR_FBCLKEN;
+
        gpio_request_by_name(dev, "cd-gpios", 0, &host->cd_gpio, GPIOD_IS_IN);
 
        ret = mmc_of_parse(dev, cfg);

-- 
2.55.0

Reply via email to