mmc: uniphier: Allow passing quirks to the probe function

Certain instances of the SD IP require more elaborate digging
in the DT to figure out which variant of the SD IP is in use.
Allow explicit passing of the quirks into the probe function.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
Marek Vasut 2018-04-08 17:45:23 +02:00
parent db1266d696
commit c769e60990
4 changed files with 16 additions and 5 deletions

View file

@ -653,12 +653,11 @@ int matsu_sd_bind(struct udevice *dev)
return mmc_bind(dev, &plat->mmc, &plat->cfg); return mmc_bind(dev, &plat->mmc, &plat->cfg);
} }
int matsu_sd_probe(struct udevice *dev) int matsu_sd_probe(struct udevice *dev, u32 quirks)
{ {
struct matsu_sd_plat *plat = dev_get_platdata(dev); struct matsu_sd_plat *plat = dev_get_platdata(dev);
struct matsu_sd_priv *priv = dev_get_priv(dev); struct matsu_sd_priv *priv = dev_get_priv(dev);
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
const u32 quirks = dev_get_driver_data(dev);
fdt_addr_t base; fdt_addr_t base;
struct clk clk; struct clk clk;
int ret; int ret;

View file

@ -132,6 +132,6 @@ int matsu_sd_set_ios(struct udevice *dev);
int matsu_sd_get_cd(struct udevice *dev); int matsu_sd_get_cd(struct udevice *dev);
int matsu_sd_bind(struct udevice *dev); int matsu_sd_bind(struct udevice *dev);
int matsu_sd_probe(struct udevice *dev); int matsu_sd_probe(struct udevice *dev, u32 quirks);
#endif /* __MATSUSHITA_COMMON_H__ */ #endif /* __MATSUSHITA_COMMON_H__ */

View file

@ -38,12 +38,19 @@ static const struct udevice_id renesas_sdhi_match[] = {
{ /* sentinel */ } { /* sentinel */ }
}; };
static int renesas_sdhi_probe(struct udevice *dev)
{
u32 quirks = dev_get_driver_data(dev);
return matsu_sd_probe(dev, quirks);
}
U_BOOT_DRIVER(renesas_sdhi) = { U_BOOT_DRIVER(renesas_sdhi) = {
.name = "renesas-sdhi", .name = "renesas-sdhi",
.id = UCLASS_MMC, .id = UCLASS_MMC,
.of_match = renesas_sdhi_match, .of_match = renesas_sdhi_match,
.bind = matsu_sd_bind, .bind = matsu_sd_bind,
.probe = matsu_sd_probe, .probe = renesas_sdhi_probe,
.priv_auto_alloc_size = sizeof(struct matsu_sd_priv), .priv_auto_alloc_size = sizeof(struct matsu_sd_priv),
.platdata_auto_alloc_size = sizeof(struct matsu_sd_plat), .platdata_auto_alloc_size = sizeof(struct matsu_sd_plat),
.ops = &renesas_sdhi_ops, .ops = &renesas_sdhi_ops,

View file

@ -30,12 +30,17 @@ static const struct udevice_id uniphier_sd_match[] = {
{ /* sentinel */ } { /* sentinel */ }
}; };
static int uniphier_sd_probe(struct udevice *dev)
{
return matsu_sd_probe(dev, 0);
}
U_BOOT_DRIVER(uniphier_mmc) = { U_BOOT_DRIVER(uniphier_mmc) = {
.name = "uniphier-mmc", .name = "uniphier-mmc",
.id = UCLASS_MMC, .id = UCLASS_MMC,
.of_match = uniphier_sd_match, .of_match = uniphier_sd_match,
.bind = matsu_sd_bind, .bind = matsu_sd_bind,
.probe = matsu_sd_probe, .probe = uniphier_sd_probe,
.priv_auto_alloc_size = sizeof(struct matsu_sd_priv), .priv_auto_alloc_size = sizeof(struct matsu_sd_priv),
.platdata_auto_alloc_size = sizeof(struct matsu_sd_plat), .platdata_auto_alloc_size = sizeof(struct matsu_sd_plat),
.ops = &uniphier_sd_ops, .ops = &uniphier_sd_ops,