mmc/aspeed: Probe from controller
authorJoel Stanley <joel@jms.id.au>
Thu, 23 Jun 2022 09:05:34 +0000 (18:35 +0930)
committerTom Rini <trini@konsulko.com>
Wed, 6 Jul 2022 18:31:29 +0000 (14:31 -0400)
commit66900bc25432ed0f99d6decbf7b383536b3456aa
tree81f72a52a6458727ebf1d6192c42c04ef2f162b4
parentf49a7a160d8851d1a22928125d317f8ddfb3157b
mmc/aspeed: Probe from controller

The Aspeed SDHCI controller is arranged with some shared control
registers, followed by one or two sets of actual SDHCI registers.

Adjust the driver to probe this controller device first. The driver then
wants to iterate over the child nodes to probe the SDHCI proper:

    ofnode node;

    dev_for_each_subnode(node, parent) {
     struct udevice *dev;
     int ret;

     ret = device_bind_driver_to_node(parent, "aspeed_sdhci",
      ofnode_get_name(node),
      node, &dev);
     if (ret)
     return ret;
    }

However if we did this the sdhci driver would probe twice; once
"naturally" from the device tree and a second time due to this code.

Instead of doing this we can rely on the probe order, where the
controller will be set up before the sdhci devices. A better solution is
preferred.

Select MISC as the controller driver is implemented as a misc device.

Signed-off-by: Joel Stanley <joel@jms.id.au>
drivers/mmc/Kconfig
drivers/mmc/aspeed_sdhci.c