lede/target/linux/ipq807x/patches-5.10/124-clk-ipq-support-for-resetting-multiple-bits.patch
2021-06-24 12:16:06 +08:00

57 lines
1.8 KiB
Diff

From 027818c51e6732f8a2f7986515264cebaf9a1704 Mon Sep 17 00:00:00 2001
From: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
Date: Wed, 18 Mar 2020 17:08:11 +0530
Subject: [PATCH 1/8] clk: ipq: support for resetting multiple bits
Current reset structure takes only one reset bit and
calculates the bitmask in its reset operation. Some of the
reset registers contains multiple bits in which each bit
will be associated with subsystem reset inside the block. To
reset properly the complete block, all the subsystem reset
should be triggered at same time i.e the register write
should go in one AHB write.
This patch adds the support for giving the complete bitmask
in reset structure and reset operation will use this bitmask
for all reset operations.
Change-Id: Ief49f8746624a0fc1e067d815725ae7c254c2c6f
Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
(cherry picked from commit ef555fc1cffa6e823a9d929711cacae0821b35ec)
Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
---
drivers/clk/qcom/reset.c | 4 ++--
drivers/clk/qcom/reset.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/clk/qcom/reset.c
+++ b/drivers/clk/qcom/reset.c
@@ -28,7 +28,7 @@ qcom_reset_assert(struct reset_controlle
rst = to_qcom_reset_controller(rcdev);
map = &rst->reset_map[id];
- mask = BIT(map->bit);
+ mask = map->bitmask ? map->bitmask : BIT(map->bit);
return regmap_update_bits(rst->regmap, map->reg, mask, mask);
}
@@ -42,7 +42,7 @@ qcom_reset_deassert(struct reset_control
rst = to_qcom_reset_controller(rcdev);
map = &rst->reset_map[id];
- mask = BIT(map->bit);
+ mask = map->bitmask ? map->bitmask : BIT(map->bit);
return regmap_update_bits(rst->regmap, map->reg, mask, 0);
}
--- a/drivers/clk/qcom/reset.h
+++ b/drivers/clk/qcom/reset.h
@@ -11,6 +11,7 @@
struct qcom_reset_map {
unsigned int reg;
u8 bit;
+ u32 bitmask;
};
struct regmap;