[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <59b1b17b-64f8-1f60-7206-4d0a03e4eecb@collabora.com>
Date: Tue, 4 Jul 2023 12:25:36 +0200
From: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
To: Markus Schneider-Pargmann <msp@...libre.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>
Cc: Chun-Jie Chen <chun-jie.chen@...iatek.com>,
Tinghan Shen <tinghan.shen@...iatek.com>,
Fabien Parent <parent.f@...il.com>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH v6 3/8] soc: mediatek: pm-domains: Split bus_prot_mask
Il 27/06/23 15:10, Markus Schneider-Pargmann ha scritto:
> bus_prot_mask is used for all operations, set clear and acknowledge. In
> preparation of m8365 power domain support split this one mask into two,
> one mask for set and clear, another one for acknowledge.
>
> Signed-off-by: Markus Schneider-Pargmann <msp@...libre.com>
> ---
> drivers/soc/mediatek/mtk-pm-domains.c | 24 ++++++++++++++----------
> drivers/soc/mediatek/mtk-pm-domains.h | 14 ++++++++------
> 2 files changed, 22 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/soc/mediatek/mtk-pm-domains.c b/drivers/soc/mediatek/mtk-pm-domains.c
> index aa9ab413479e..c801fa763e89 100644
> --- a/drivers/soc/mediatek/mtk-pm-domains.c
> +++ b/drivers/soc/mediatek/mtk-pm-domains.c
> @@ -123,18 +123,20 @@ static int _scpsys_bus_protect_enable(const struct scpsys_bus_prot_data *bpd, st
> int i, ret;
>
> for (i = 0; i < SPM_MAX_BUS_PROT_DATA; i++) {
> - u32 val, mask = bpd[i].bus_prot_mask;
> + u32 val;
> + u32 set_clr_mask = bpd[i].bus_prot_set_clr_mask;
> + u32 sta_mask = bpd[i].bus_prot_sta_mask;
>
> - if (!mask)
> + if (!set_clr_mask)
> break;
>
> if (bpd[i].flags & BUS_PROT_REG_UPDATE)
> - regmap_set_bits(regmap, bpd[i].bus_prot_set, mask);
> + regmap_set_bits(regmap, bpd[i].bus_prot_set, set_clr_mask);
> else
> - regmap_write(regmap, bpd[i].bus_prot_set, mask);
> + regmap_write(regmap, bpd[i].bus_prot_set, set_clr_mask);
>
> ret = regmap_read_poll_timeout(regmap, bpd[i].bus_prot_sta,
> - val, (val & mask) == mask,
> + val, (val & sta_mask) == sta_mask,
> MTK_POLL_DELAY_US, MTK_POLL_TIMEOUT);
> if (ret)
> return ret;
> @@ -160,21 +162,23 @@ static int _scpsys_bus_protect_disable(const struct scpsys_bus_prot_data *bpd,
> int i, ret;
>
> for (i = SPM_MAX_BUS_PROT_DATA - 1; i >= 0; i--) {
> - u32 val, mask = bpd[i].bus_prot_mask;
> + u32 val;
> + u32 set_clr_mask = bpd[i].bus_prot_set_clr_mask;
> + u32 sta_mask = bpd[i].bus_prot_sta_mask;
Only one nitpick: val should be declared after the others....
That's just for readability and nothing else, obviously.
Anyway, after that change:
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Powered by blists - more mailing lists