From eb4f2fb44a0ec5ce3b6577565952e4d50030d380 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Wed, 23 Oct 2024 21:19:23 +0200 Subject: [PATCH] drivers/flash/nrf_rram: Add get_size implementation. Commit adds flash_get_size callback to the driver. Signed-off-by: Dominik Ermel --- drivers/flash/soc_flash_nrf_rram.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index 35a6c98862c699..9bc32255a481de 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -302,6 +302,15 @@ static int nrf_rram_erase(const struct device *dev, off_t addr, size_t len) return nrf_write(addr, NULL, len); } +int nrf_rram_get_size(const struct device *dev, uint64_t *size) +{ + ARG_UNUSED(dev); + + *size = RRAM_SIZE; + + return 0; +} + static const struct flash_parameters *nrf_rram_get_parameters(const struct device *dev) { ARG_UNUSED(dev); @@ -337,6 +346,7 @@ static const struct flash_driver_api nrf_rram_api = { .read = nrf_rram_read, .write = nrf_rram_write, .erase = nrf_rram_erase, + .get_size = nrf_rram_get_size, .get_parameters = nrf_rram_get_parameters, #if defined(CONFIG_FLASH_PAGE_LAYOUT) .page_layout = nrf_rram_page_layout,