]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pmdomain: thead: create auxiliary device for rebooting
authorIcenowy Zheng <uwu@icenowy.me>
Thu, 18 Sep 2025 17:33:23 +0000 (01:33 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 19 Sep 2025 10:55:20 +0000 (12:55 +0200)
The reboot / power off operations require communication with the AON
firmware too.

As the driver is already present, create an auxiliary device with name
"reboot" to match that driver, and pass the AON channel by using
platform_data.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/pmdomain/thead/th1520-pm-domains.c

index 9040b698e7f7f2400163841530fecacfb0f917bc..5213994101a59134a3c927fd4ee7f9733c574469 100644 (file)
@@ -173,6 +173,16 @@ static int th1520_pd_pwrseq_gpu_init(struct device *dev)
                                        adev);
 }
 
+static int th1520_pd_reboot_init(struct device *dev,
+                                struct th1520_aon_chan *aon_chan)
+{
+       struct auxiliary_device *adev;
+
+       adev = devm_auxiliary_device_create(dev, "reboot", aon_chan);
+
+       return PTR_ERR_OR_ZERO(adev);
+}
+
 static int th1520_pd_probe(struct platform_device *pdev)
 {
        struct generic_pm_domain **domains;
@@ -235,6 +245,10 @@ static int th1520_pd_probe(struct platform_device *pdev)
        if (ret)
                goto err_clean_provider;
 
+       ret = th1520_pd_reboot_init(dev, aon_chan);
+       if (ret)
+               goto err_clean_provider;
+
        return 0;
 
 err_clean_provider: