]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PM / devfreq: rockchip-dfi: switch to FIELD_PREP_WM16 macro
authorNicolas Frattaroli <nicolas.frattaroli@collabora.com>
Mon, 13 Oct 2025 07:34:04 +0000 (09:34 +0200)
committerYury Norov (NVIDIA) <yury.norov@gmail.com>
Wed, 15 Oct 2025 14:39:54 +0000 (10:39 -0400)
commit7e85ac9da1acc591bd5269f2b890ed1994c42e96
treed0205d433e1d931bf14e5300203e14652f59c076
parent0f5878834d6ce97426219b64c02a2c4081419d53
PM / devfreq: rockchip-dfi: switch to FIELD_PREP_WM16 macro

The era of hand-rolled HIWORD_UPDATE macros is over, at least for those
drivers that use constant masks.

Like many other Rockchip drivers, rockchip-dfi brings with it its own
HIWORD_UPDATE macro. This variant doesn't shift the value (and like the
others, doesn't do any checking).

Remove it, and replace instances of it with hw_bitfield.h's
FIELD_PREP_WM16.  Since FIELD_PREP_WM16 requires contiguous masks and
shifts the value for us, some reshuffling of definitions needs to
happen.

This gives us better compile-time error checking, and in my opinion,
nicer code.

Tested on an RK3568 ODROID-M1 board (LPDDR4X at 1560 MHz, an RK3588
Radxa ROCK 5B board (LPDDR4X at 2112 MHz) and an RK3588 Radxa ROCK 5T
board (LPDDR5 at 2400 MHz). perf measurements were consistent with the
measurements of stress-ng --stream in all cases.

Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
drivers/devfreq/event/rockchip-dfi.c