nvmem: core: Add support for keepout regions
authorEvan Green <evgreen@chromium.org>
Fri, 27 Nov 2020 10:28:34 +0000 (10:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Nov 2020 15:10:06 +0000 (16:10 +0100)
commitfd3bb8f54a88107570334c156efb0c724a261003
treeb6b3997e7140f62334df9a1cbd22abad4e9d40f9
parent8f3991f0669ef271615e25c3390c20b8fb00d674
nvmem: core: Add support for keepout regions

Introduce support into the nvmem core for arrays of register ranges
that should not result in actual device access. For these regions a
constant byte (repeated) is returned instead on read, and writes are
quietly ignored and returned as successful.

This is useful for instance if certain efuse regions are protected
from access by Linux because they contain secret info to another part
of the system (like an integrated modem).

Signed-off-by: Evan Green <evgreen@chromium.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102837.19366-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/core.c
include/linux/nvmem-provider.h