* [PATCH RFT] memory: renesas-rpc-if: simplify register update
@ 2021-11-17 10:29 Wolfram Sang
2021-11-18 2:42 ` Prabhakar Mahadev Lad
2021-11-22 9:54 ` Krzysztof Kozlowski
0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2021-11-17 10:29 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Lad Prabhakar, Wolfram Sang, Krzysztof Kozlowski, linux-kernel
No need to open code regmap_update_bits().
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Only build tested as I don't have the G2L hardware.
@Prabhakar: would you also kindly test this patch?
drivers/memory/renesas-rpc-if.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index a9f3e7bdddf8..0c8f00323a91 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -258,17 +258,14 @@ EXPORT_SYMBOL(rpcif_sw_init);
static void rpcif_rzg2l_timing_adjust_sdr(struct rpcif *rpc)
{
- u32 data;
-
regmap_write(rpc->regmap, RPCIF_PHYWR, 0xa5390000);
regmap_write(rpc->regmap, RPCIF_PHYADD, 0x80000000);
regmap_write(rpc->regmap, RPCIF_PHYWR, 0x00008080);
regmap_write(rpc->regmap, RPCIF_PHYADD, 0x80000022);
regmap_write(rpc->regmap, RPCIF_PHYWR, 0x00008080);
regmap_write(rpc->regmap, RPCIF_PHYADD, 0x80000024);
-
- regmap_read(rpc->regmap, RPCIF_PHYCNT, &data);
- regmap_write(rpc->regmap, RPCIF_PHYCNT, data | RPCIF_PHYCNT_CKSEL(3));
+ regmap_update_bits(rpc->regmap, RPCIF_PHYCNT, RPCIF_PHYCNT_CKSEL(3),
+ RPCIF_PHYCNT_CKSEL(3));
regmap_write(rpc->regmap, RPCIF_PHYWR, 0x00000030);
regmap_write(rpc->regmap, RPCIF_PHYADD, 0x80000032);
}
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH RFT] memory: renesas-rpc-if: simplify register update
2021-11-17 10:29 [PATCH RFT] memory: renesas-rpc-if: simplify register update Wolfram Sang
@ 2021-11-18 2:42 ` Prabhakar Mahadev Lad
2021-11-22 9:54 ` Krzysztof Kozlowski
1 sibling, 0 replies; 3+ messages in thread
From: Prabhakar Mahadev Lad @ 2021-11-18 2:42 UTC (permalink / raw)
To: Wolfram Sang, linux-renesas-soc; +Cc: Krzysztof Kozlowski, linux-kernel
Hi Wolfram,
Thank you for the patch.
> -----Original Message-----
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Sent: 17 November 2021 10:29
> To: linux-renesas-soc@vger.kernel.org
> Cc: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>; Wolfram Sang <wsa+renesas@sang-
> engineering.com>; Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>; linux-
> kernel@vger.kernel.org
> Subject: [PATCH RFT] memory: renesas-rpc-if: simplify register update
>
> No need to open code regmap_update_bits().
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Only build tested as I don't have the G2L hardware.
> @Prabhakar: would you also kindly test this patch?
>
Dumped the register setting with and without this patch. And also tested it on RZ/G2L.
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cheers,
Prabhakar
> drivers/memory/renesas-rpc-if.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index
> a9f3e7bdddf8..0c8f00323a91 100644
> --- a/drivers/memory/renesas-rpc-if.c
> +++ b/drivers/memory/renesas-rpc-if.c
> @@ -258,17 +258,14 @@ EXPORT_SYMBOL(rpcif_sw_init);
>
> static void rpcif_rzg2l_timing_adjust_sdr(struct rpcif *rpc) {
> - u32 data;
> -
> regmap_write(rpc->regmap, RPCIF_PHYWR, 0xa5390000);
> regmap_write(rpc->regmap, RPCIF_PHYADD, 0x80000000);
> regmap_write(rpc->regmap, RPCIF_PHYWR, 0x00008080);
> regmap_write(rpc->regmap, RPCIF_PHYADD, 0x80000022);
> regmap_write(rpc->regmap, RPCIF_PHYWR, 0x00008080);
> regmap_write(rpc->regmap, RPCIF_PHYADD, 0x80000024);
> -
> - regmap_read(rpc->regmap, RPCIF_PHYCNT, &data);
> - regmap_write(rpc->regmap, RPCIF_PHYCNT, data | RPCIF_PHYCNT_CKSEL(3));
> + regmap_update_bits(rpc->regmap, RPCIF_PHYCNT, RPCIF_PHYCNT_CKSEL(3),
> + RPCIF_PHYCNT_CKSEL(3));
> regmap_write(rpc->regmap, RPCIF_PHYWR, 0x00000030);
> regmap_write(rpc->regmap, RPCIF_PHYADD, 0x80000032); }
> --
> 2.30.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RFT] memory: renesas-rpc-if: simplify register update
2021-11-17 10:29 [PATCH RFT] memory: renesas-rpc-if: simplify register update Wolfram Sang
2021-11-18 2:42 ` Prabhakar Mahadev Lad
@ 2021-11-22 9:54 ` Krzysztof Kozlowski
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2021-11-22 9:54 UTC (permalink / raw)
To: linux-renesas-soc, Wolfram Sang
Cc: Krzysztof Kozlowski, Lad Prabhakar, linux-kernel
On Wed, 17 Nov 2021 11:29:02 +0100, Wolfram Sang wrote:
> No need to open code regmap_update_bits().
>
>
Applied, thanks!
[1/1] memory: renesas-rpc-if: simplify register update
commit: 2db468d6fda4c33d26ba9dde7c72e081b2b86ad1
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-22 9:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 10:29 [PATCH RFT] memory: renesas-rpc-if: simplify register update Wolfram Sang
2021-11-18 2:42 ` Prabhakar Mahadev Lad
2021-11-22 9:54 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).