提交 9035bb74 编写于 作者: P Patrice Chotard 提交者: Tom Rini

mmc: arm_pl180_mmci: add bus_width DT property support

Allow to get "bus-width" property from device tree
Signed-off-by: NPatrice Chotard <patrice.chotard@st.com>
上级 3c0dbed2
......@@ -408,6 +408,7 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
struct mmc *mmc = &pdata->mmc;
struct pl180_mmc_host *host = mmc->priv;
u32 bus_width;
int ret;
strcpy(host->name, "MMC");
......@@ -421,6 +422,21 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
host->clock_max = dev_read_u32_default(dev, "max-frequency",
MMC_CLOCK_MAX);
host->version2 = dev_get_driver_data(dev);
bus_width = dev_read_u32_default(dev, "bus-width", 1);
switch (bus_width) {
case 8:
host->caps |= MMC_MODE_8BIT;
/* Hosts capable of 8-bit transfers can also do 4 bits */
case 4:
host->caps |= MMC_MODE_4BIT;
break;
case 1:
break;
default:
dev_err(dev, "Invalid bus-width value %u\n", bus_width);
}
ret = arm_pl180_mmci_init(host, &mmc);
if (ret) {
dev_err(dev, "arm_pl180_mmci init failed\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册