Skip to content

Commit a9eaf30

Browse files
LorenzoBianconibebarino
authored andcommitted
clk: en7523: map io region in a single block
Map all clock-controller memory region in a single block. This patch does not introduce any backward incompatibility since the dts for EN7581 SoC is not upstream yet. Signed-off-by: Lorenzo Bianconi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 82e6bf9 commit a9eaf30

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

drivers/clk/clk-en7523.c

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
#define REG_PCIE_XSI1_SEL_MASK GENMASK(12, 11)
4040
#define REG_CRYPTO_CLKSRC2 0x20c
4141

42-
#define REG_RST_CTRL2 0x00
43-
#define REG_RST_CTRL1 0x04
42+
#define REG_RST_CTRL2 0x830
43+
#define REG_RST_CTRL1 0x834
4444

4545
struct en_clk_desc {
4646
int id;
@@ -645,15 +645,9 @@ static const struct reset_control_ops en7581_reset_ops = {
645645
.status = en7523_reset_status,
646646
};
647647

648-
static int en7581_reset_register(struct platform_device *pdev)
648+
static int en7581_reset_register(struct device *dev, void __iomem *base)
649649
{
650-
struct device *dev = &pdev->dev;
651650
struct en_rst_data *rst_data;
652-
void __iomem *base;
653-
654-
base = devm_platform_ioremap_resource(pdev, 1);
655-
if (IS_ERR(base))
656-
return PTR_ERR(base);
657651

658652
rst_data = devm_kzalloc(dev, sizeof(*rst_data), GFP_KERNEL);
659653
if (!rst_data)
@@ -677,27 +671,27 @@ static int en7581_reset_register(struct platform_device *pdev)
677671
static int en7581_clk_hw_init(struct platform_device *pdev,
678672
struct clk_hw_onecell_data *clk_data)
679673
{
680-
void __iomem *np_base;
681674
struct regmap *map;
675+
void __iomem *base;
682676
u32 val;
683677

684678
map = syscon_regmap_lookup_by_compatible("airoha,en7581-chip-scu");
685679
if (IS_ERR(map))
686680
return PTR_ERR(map);
687681

688-
np_base = devm_platform_ioremap_resource(pdev, 0);
689-
if (IS_ERR(np_base))
690-
return PTR_ERR(np_base);
682+
base = devm_platform_ioremap_resource(pdev, 0);
683+
if (IS_ERR(base))
684+
return PTR_ERR(base);
691685

692-
en7581_register_clocks(&pdev->dev, clk_data, map, np_base);
686+
en7581_register_clocks(&pdev->dev, clk_data, map, base);
693687

694-
val = readl(np_base + REG_NP_SCU_SSTR);
688+
val = readl(base + REG_NP_SCU_SSTR);
695689
val &= ~(REG_PCIE_XSI0_SEL_MASK | REG_PCIE_XSI1_SEL_MASK);
696-
writel(val, np_base + REG_NP_SCU_SSTR);
697-
val = readl(np_base + REG_NP_SCU_PCIC);
698-
writel(val | 3, np_base + REG_NP_SCU_PCIC);
690+
writel(val, base + REG_NP_SCU_SSTR);
691+
val = readl(base + REG_NP_SCU_PCIC);
692+
writel(val | 3, base + REG_NP_SCU_PCIC);
699693

700-
return en7581_reset_register(pdev);
694+
return en7581_reset_register(&pdev->dev, base);
701695
}
702696

703697
static int en7523_clk_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)