summaryrefslogtreecommitdiff
path: root/include/linux/hw_bitfield.h
AgeCommit message (Collapse)Author
2026-08-11include: linux: Import hw_bitfield.h from Linux v6.18Jonas Karlman
Hardware of various vendors, but very notably Rockchip, often uses 32-bit registers where the upper 16-bit half of the register is a write-enable mask for the lower half. Add hw_bitfield.h with two macros: FIELD_PREP_WM16, and FIELD_PREP_WM16_CONST. The latter is a version that can be used in initializers, like FIELD_PREP_CONST. Import hw_bitfield.h from Linux commit 21368fcbb124 ("bitmap: introduce hardware-specific bitfield operations"), first introduced in v6.18-rc1. This contains two changes compared to the Linux version: - include of linux/limit.h was dropped - use of const_true() in FIELD_PREP_WM16_CONST() was dropped Signed-off-by: Jonas Karlman <[email protected]> Acked-by: Quentin Schulz <[email protected]> Reviewed-by: Tom Rini <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Quentin Schulz <[email protected]>