soc: imx: imx8mp-blk-ctrl: add instance specific probe function
authorLucas Stach <l.stach@pengutronix.de>
Fri, 16 Dec 2022 20:08:19 +0000 (21:08 +0100)
committerShawn Guo <shawnguo@kernel.org>
Sun, 1 Jan 2023 03:11:54 +0000 (11:11 +0800)
Allow the specific blk-ctrl instance to define a function, which will
be called during probe to provide device specific extensions.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-by: Lukas F. Hartmann <lukas@mntre.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/soc/imx/imx8mp-blk-ctrl.c

index 0e3b6ba22f943e0b3bd2a1c64189e3a1e964d137..b3d9f6e083bacf9ff25b5a8a643c16e3fc39af94 100644 (file)
@@ -60,6 +60,7 @@ struct imx8mp_blk_ctrl_domain {
 
 struct imx8mp_blk_ctrl_data {
        int max_reg;
+       int (*probe) (struct imx8mp_blk_ctrl *bc);
        notifier_fn_t power_notifier_fn;
        void (*power_off) (struct imx8mp_blk_ctrl *bc, struct imx8mp_blk_ctrl_domain *domain);
        void (*power_on) (struct imx8mp_blk_ctrl *bc, struct imx8mp_blk_ctrl_domain *domain);
@@ -634,6 +635,12 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
                goto cleanup_provider;
        }
 
+       if (bc_data->probe) {
+               ret = bc_data->probe(bc);
+               if (ret)
+                       goto cleanup_provider;
+       }
+
        dev_set_drvdata(dev, bc);
 
        return 0;