Commit 1ef48138 authored by Ralph Siemsen's avatar Ralph Siemsen Committed by Geert Uytterhoeven

clk: renesas: r9a06g032: Improve clock tables

Each entry in the clock table specifies a number of individual bits in
registers, for contolling clock reset, gaiting, etc. These reg/bit were
packed into a u16 to save space. The combined value is difficult to
understand when reviewing the clock table entries.

Introduce a "struct regbit" which still occupies only 16 bits, but
allows the register and bit values to be specified explicitly. Convert
all previous uses of u16 for reg/bit into "struct regbit".

The bulk of this patch converts the clock table to use struct regbit,
making use of the RB() helper macro. The conversion was automated by
script, and as a further verification, the compiled binary of the table
was compared before/after the change (with objdump -D).

The clk_rdesc_set() function now checks for zero reg/bit internally.
This allows callers of that function to remove those checks.
Signed-off-by: default avatarRalph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230301215520.828455-5-ralph.siemsen@linaro.orgSigned-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
parent 5a5ca2c7
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment