From e362372fa8d56c669516dc83abe75cd057d94171 Mon Sep 17 00:00:00 2001 From: Rajkumar Ayyasamy Date: Wed, 18 Mar 2020 17:08:11 +0530 Subject: [PATCH 133/137] 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 (cherry picked from commit ef555fc1cffa6e823a9d929711cacae0821b35ec) Signed-off-by: Rajkumar Ayyasamy --- 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;