]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nvmem: rockchip-otp: Handle internal word_size in main reg_read op
authorJonas Karlman <jonas@kwiboo.se>
Fri, 27 Mar 2026 13:17:48 +0000 (13:17 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2026 14:15:56 +0000 (16:15 +0200)
commit6c403594354d59fb288978c5a23008da89ba2741
tree0b80b53ca8dcd74a59161c22827bf723a3c2c87e
parentc5bc6d815c8d733bc8d915ffaf6fc9c248865216
nvmem: rockchip-otp: Handle internal word_size in main reg_read op

Rockchip SoCs RK3576 and RK3588 read data from the OTP using 32-bit
words instead of normal 8-bit bytes. Similar RK3506, RK3528, RK3562 and
RK3568 will read data from OTP using 16-bit words.

The nvmem core stride and word_size cannot fully be used as cells is not
always aligned. Continue to report a stride=1 and word_size=1 in
nvmem_config and instead handle use of SoC specific word_size internally
in the driver.

Move current SoC specific word_size handling from the RK3588 read_reg
operation to the main read_reg operation to help simplify the SoC
specific read_reg operation and allow code reuse in a future RK3568
reg_read operation.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20260327131751.3026030-7-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/rockchip-otp.c