aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nvmem-consumer.h
diff options
context:
space:
mode:
authorFabrice Gasnier <fabrice.gasnier@st.com>2019-04-13 11:32:57 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-25 19:43:12 +0200
commit0a9b2d1ce42210d087d32b1979d3ada343537708 (patch)
treea30eb5aac596803d9a18e70c687c11d6071ca657 /include/linux/nvmem-consumer.h
parentnvmem: stm32: add support for STM32MP15 BSEC to control OTP data (diff)
downloadlinux-dev-0a9b2d1ce42210d087d32b1979d3ada343537708.tar.xz
linux-dev-0a9b2d1ce42210d087d32b1979d3ada343537708.zip
nvmem: core: add nvmem_cell_read_u16
Add nvmem_cell_read_u16() helper to ease read of an u16 value on consumer side. This is inspired by nvmem_cell_read_u32() function. This helper is useful on stm32 that has 16 bits data cells stored in non volatile memory. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/nvmem-consumer.h')
-rw-r--r--include/linux/nvmem-consumer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
index 312bfa5efd80..8f8be5b00060 100644
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -61,6 +61,7 @@ void nvmem_cell_put(struct nvmem_cell *cell);
void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell);
void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len);
int nvmem_cell_write(struct nvmem_cell *cell, void *buf, size_t len);
+int nvmem_cell_read_u16(struct device *dev, const char *cell_id, u16 *val);
int nvmem_cell_read_u32(struct device *dev, const char *cell_id, u32 *val);
/* direct nvmem device read/write interface */
@@ -122,6 +123,12 @@ static inline int nvmem_cell_write(struct nvmem_cell *cell,
return -EOPNOTSUPP;
}
+static inline int nvmem_cell_read_u16(struct device *dev,
+ const char *cell_id, u16 *val)
+{
+ return -EOPNOTSUPP;
+}
+
static inline int nvmem_cell_read_u32(struct device *dev,
const char *cell_id, u32 *val)
{