]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
memory: renesas-rpc-if: Add regmap to struct rpcif_info
authorBiju Das <biju.das.jz@bp.renesas.com>
Thu, 24 Apr 2025 08:59:52 +0000 (09:59 +0100)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 1 May 2025 10:22:09 +0000 (12:22 +0200)
The RZ/G3E XSPI has different regmap compared to RPC-IF. Add regmap to
struct rpcif_info in order to support RZ/G3E XSPI.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20250424090000.136804-5-biju.das.jz@bp.renesas.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/memory/renesas-rpc-if.c

index 9f3ac5cb9ff47ef37247d681b338049c5aaf040a..56b2e944becaead80458c455af995bd717a3715b 100644 (file)
@@ -32,6 +32,7 @@ static const struct regmap_access_table rpcif_volatile_table = {
 };
 
 struct rpcif_info {
+       const struct regmap_config *regmap_config;
        enum rpcif_type type;
        u8 strtim;
 };
@@ -588,8 +589,8 @@ static int rpcif_probe(struct platform_device *pdev)
        rpc->base = devm_platform_ioremap_resource_byname(pdev, "regs");
        if (IS_ERR(rpc->base))
                return PTR_ERR(rpc->base);
-
-       rpc->regmap = devm_regmap_init(dev, NULL, rpc, &rpcif_regmap_config);
+       rpc->info = of_device_get_match_data(dev);
+       rpc->regmap = devm_regmap_init(dev, NULL, rpc, rpc->info->regmap_config);
        if (IS_ERR(rpc->regmap)) {
                dev_err(dev, "failed to init regmap for rpcif, error %ld\n",
                        PTR_ERR(rpc->regmap));
@@ -602,7 +603,6 @@ static int rpcif_probe(struct platform_device *pdev)
                return PTR_ERR(rpc->dirmap);
 
        rpc->size = resource_size(res);
-       rpc->info = of_device_get_match_data(dev);
        rpc->rstc = devm_reset_control_array_get_exclusive(dev);
        if (IS_ERR(rpc->rstc))
                return PTR_ERR(rpc->rstc);
@@ -633,21 +633,25 @@ static void rpcif_remove(struct platform_device *pdev)
 }
 
 static const struct rpcif_info rpcif_info_r8a7796 = {
+       .regmap_config = &rpcif_regmap_config,
        .type = RPCIF_RCAR_GEN3,
        .strtim = 6,
 };
 
 static const struct rpcif_info rpcif_info_gen3 = {
+       .regmap_config = &rpcif_regmap_config,
        .type = RPCIF_RCAR_GEN3,
        .strtim = 7,
 };
 
 static const struct rpcif_info rpcif_info_rz_g2l = {
+       .regmap_config = &rpcif_regmap_config,
        .type = RPCIF_RZ_G2L,
        .strtim = 7,
 };
 
 static const struct rpcif_info rpcif_info_gen4 = {
+       .regmap_config = &rpcif_regmap_config,
        .type = RPCIF_RCAR_GEN4,
        .strtim = 15,
 };