]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: sdhci-of-aspeed: Handle optional controller reset
authorRyan Chen <ryan_chen@aspeedtech.com>
Tue, 24 Mar 2026 01:58:50 +0000 (09:58 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 25 Mar 2026 08:55:36 +0000 (09:55 +0100)
Get the optional reset line for the ASPEED SD controller during probe by
using devm_reset_control_get_optional_exclusive_deasserted().

This allows platforms such as AST2700, which require the SD controller
to be taken out of reset before use, to work with the existing driver.

Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-of-aspeed.c

index 4296def6943693c6af355c96e4693eb89263712b..f5d973783cbe1a837007031e33128a8a582d0a5b 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
+#include <linux/reset.h>
 #include <linux/spinlock.h>
 
 #include "sdhci-pltfm.h"
@@ -519,6 +520,7 @@ static struct platform_driver aspeed_sdhci_driver = {
 static int aspeed_sdc_probe(struct platform_device *pdev)
 
 {
+       struct reset_control *reset;
        struct device_node *parent;
        struct aspeed_sdc *sdc;
        int ret;
@@ -529,6 +531,10 @@ static int aspeed_sdc_probe(struct platform_device *pdev)
 
        spin_lock_init(&sdc->lock);
 
+       reset = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev, NULL);
+       if (IS_ERR(reset))
+               return dev_err_probe(&pdev->dev, PTR_ERR(reset), "unable to acquire reset\n");
+
        sdc->clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(sdc->clk))
                return PTR_ERR(sdc->clk);