diff mbox series

[02/10] soc: qcom: icc-bwmon: re-use IRQ enable/clear define

Message ID 20220720192807.130098-3-krzysztof.kozlowski@linaro.org (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series soc/arm64: qcom: Add LLCC BWMON on SDM845 | expand

Commit Message

Krzysztof Kozlowski July 20, 2022, 7:27 p.m. UTC
The interrupt enable, status and clear registers have the same layout,
so BWMON_GLOBAL_IRQ_ENABLE_ENABLE define can be used also for clearing
IRQ, instead of hard-coded value.

Cc: Rajendra Nayak <quic_rjendra@quicinc.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/soc/qcom/icc-bwmon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Sibi Sankar July 26, 2022, 11:20 a.m. UTC | #1
On 7/21/22 12:57 AM, Krzysztof Kozlowski wrote:
> The interrupt enable, status and clear registers have the same layout,
> so BWMON_GLOBAL_IRQ_ENABLE_ENABLE define can be used also for clearing
> IRQ, instead of hard-coded value.
> 
> Cc: Rajendra Nayak <quic_rjendra@quicinc.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com>

> ---
>   drivers/soc/qcom/icc-bwmon.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
> index bea3ea1de7a4..3415f42523cd 100644
> --- a/drivers/soc/qcom/icc-bwmon.c
> +++ b/drivers/soc/qcom/icc-bwmon.c
> @@ -162,7 +162,8 @@ static void bwmon_clear_irq(struct icc_bwmon *bwmon)
>   	 * interrupt is cleared.
>   	 */
>   	writel(BWMON_IRQ_ENABLE_MASK, bwmon->base + BWMON_IRQ_CLEAR);
> -	writel(BIT(0), bwmon->base + BWMON_GLOBAL_IRQ_CLEAR);
> +	writel(BWMON_GLOBAL_IRQ_ENABLE_ENABLE,
> +	       bwmon->base + BWMON_GLOBAL_IRQ_CLEAR);
>   }
>   
>   static void bwmon_disable(struct icc_bwmon *bwmon)
>
diff mbox series

Patch

diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
index bea3ea1de7a4..3415f42523cd 100644
--- a/drivers/soc/qcom/icc-bwmon.c
+++ b/drivers/soc/qcom/icc-bwmon.c
@@ -162,7 +162,8 @@  static void bwmon_clear_irq(struct icc_bwmon *bwmon)
 	 * interrupt is cleared.
 	 */
 	writel(BWMON_IRQ_ENABLE_MASK, bwmon->base + BWMON_IRQ_CLEAR);
-	writel(BIT(0), bwmon->base + BWMON_GLOBAL_IRQ_CLEAR);
+	writel(BWMON_GLOBAL_IRQ_ENABLE_ENABLE,
+	       bwmon->base + BWMON_GLOBAL_IRQ_CLEAR);
 }
 
 static void bwmon_disable(struct icc_bwmon *bwmon)