Skip to content

Commit 198158a

Browse files
bijudaskrzk
authored andcommitted
memory: renesas-rpc-if: Add regmap to struct rpcif_info
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 <[email protected]> Signed-off-by: Biju Das <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent c66fce8 commit 198158a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/memory/renesas-rpc-if.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ static const struct regmap_access_table rpcif_volatile_table = {
3232
};
3333

3434
struct rpcif_info {
35+
const struct regmap_config *regmap_config;
3536
enum rpcif_type type;
3637
u8 strtim;
3738
};
@@ -588,8 +589,8 @@ static int rpcif_probe(struct platform_device *pdev)
588589
rpc->base = devm_platform_ioremap_resource_byname(pdev, "regs");
589590
if (IS_ERR(rpc->base))
590591
return PTR_ERR(rpc->base);
591-
592-
rpc->regmap = devm_regmap_init(dev, NULL, rpc, &rpcif_regmap_config);
592+
rpc->info = of_device_get_match_data(dev);
593+
rpc->regmap = devm_regmap_init(dev, NULL, rpc, rpc->info->regmap_config);
593594
if (IS_ERR(rpc->regmap)) {
594595
dev_err(dev, "failed to init regmap for rpcif, error %ld\n",
595596
PTR_ERR(rpc->regmap));
@@ -602,7 +603,6 @@ static int rpcif_probe(struct platform_device *pdev)
602603
return PTR_ERR(rpc->dirmap);
603604

604605
rpc->size = resource_size(res);
605-
rpc->info = of_device_get_match_data(dev);
606606
rpc->rstc = devm_reset_control_array_get_exclusive(dev);
607607
if (IS_ERR(rpc->rstc))
608608
return PTR_ERR(rpc->rstc);
@@ -633,21 +633,25 @@ static void rpcif_remove(struct platform_device *pdev)
633633
}
634634

635635
static const struct rpcif_info rpcif_info_r8a7796 = {
636+
.regmap_config = &rpcif_regmap_config,
636637
.type = RPCIF_RCAR_GEN3,
637638
.strtim = 6,
638639
};
639640

640641
static const struct rpcif_info rpcif_info_gen3 = {
642+
.regmap_config = &rpcif_regmap_config,
641643
.type = RPCIF_RCAR_GEN3,
642644
.strtim = 7,
643645
};
644646

645647
static const struct rpcif_info rpcif_info_rz_g2l = {
648+
.regmap_config = &rpcif_regmap_config,
646649
.type = RPCIF_RZ_G2L,
647650
.strtim = 7,
648651
};
649652

650653
static const struct rpcif_info rpcif_info_gen4 = {
654+
.regmap_config = &rpcif_regmap_config,
651655
.type = RPCIF_RCAR_GEN4,
652656
.strtim = 15,
653657
};

0 commit comments

Comments
 (0)