Skip to content

Commit

Permalink
drivers/flash/soc_flash_nrf_mram: Add get_size implementation
Browse files Browse the repository at this point in the history
Commit adds flash_get_size callback to the driver.

Signed-off-by: Dominik Ermel <[email protected]>
  • Loading branch information
de-nordic authored and kartben committed Nov 23, 2024
1 parent 021ef9e commit 383bcc7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/flash/soc_flash_nrf_mram.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ static int nrf_mram_erase(const struct device *dev, off_t offset, size_t size)
return 0;
}

static int nrf_mram_get_size(const struct device *dev, uint64_t *size)
{
ARG_UNUSED(dev);

*size = MRAM_SIZE;

return 0;
}

static const struct flash_parameters *nrf_mram_get_parameters(const struct device *dev)
{
ARG_UNUSED(dev);
Expand Down Expand Up @@ -170,6 +179,7 @@ static const struct flash_driver_api nrf_mram_api = {
.read = nrf_mram_read,
.write = nrf_mram_write,
.erase = nrf_mram_erase,
.get_size = nrf_mram_get_size,
.get_parameters = nrf_mram_get_parameters,
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
.page_layout = nrf_mram_page_layout,
Expand Down

0 comments on commit 383bcc7

Please sign in to comment.