summaryrefslogtreecommitdiffstats
path: root/drivers/clk/sprd/div.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 17:35:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 17:39:31 +0000
commit85c675d0d09a45a135bddd15d7b385f8758c32fb (patch)
tree76267dbc9b9a130337be3640948fe397b04ac629 /drivers/clk/sprd/div.c
parentAdding upstream version 6.6.15. (diff)
downloadlinux-85c675d0d09a45a135bddd15d7b385f8758c32fb.tar.xz
linux-85c675d0d09a45a135bddd15d7b385f8758c32fb.zip
Adding upstream version 6.7.7.upstream/6.7.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/clk/sprd/div.c')
-rw-r--r--drivers/clk/sprd/div.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clk/sprd/div.c b/drivers/clk/sprd/div.c
index c7261630ca..936782c241 100644
--- a/drivers/clk/sprd/div.c
+++ b/drivers/clk/sprd/div.c
@@ -25,7 +25,7 @@ unsigned long sprd_div_helper_recalc_rate(struct sprd_clk_common *common,
unsigned long val;
unsigned int reg;
- regmap_read(common->regmap, common->reg, &reg);
+ regmap_read(common->regmap, common->reg + div->offset, &reg);
val = reg >> div->shift;
val &= (1 << div->width) - 1;
@@ -53,10 +53,10 @@ int sprd_div_helper_set_rate(const struct sprd_clk_common *common,
val = divider_get_val(rate, parent_rate, NULL,
div->width, 0);
- regmap_read(common->regmap, common->reg, &reg);
+ regmap_read(common->regmap, common->reg + div->offset, &reg);
reg &= ~GENMASK(div->width + div->shift - 1, div->shift);
- regmap_write(common->regmap, common->reg,
+ regmap_write(common->regmap, common->reg + div->offset,
reg | (val << div->shift));
return 0;