Skip to content

Commit 383bcc7

Browse files
de-nordickartben
authored andcommitted
drivers/flash/soc_flash_nrf_mram: Add get_size implementation
Commit adds flash_get_size callback to the driver. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 021ef9e commit 383bcc7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/flash/soc_flash_nrf_mram.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ static int nrf_mram_erase(const struct device *dev, off_t offset, size_t size)
135135
return 0;
136136
}
137137

138+
static int nrf_mram_get_size(const struct device *dev, uint64_t *size)
139+
{
140+
ARG_UNUSED(dev);
141+
142+
*size = MRAM_SIZE;
143+
144+
return 0;
145+
}
146+
138147
static const struct flash_parameters *nrf_mram_get_parameters(const struct device *dev)
139148
{
140149
ARG_UNUSED(dev);
@@ -170,6 +179,7 @@ static const struct flash_driver_api nrf_mram_api = {
170179
.read = nrf_mram_read,
171180
.write = nrf_mram_write,
172181
.erase = nrf_mram_erase,
182+
.get_size = nrf_mram_get_size,
173183
.get_parameters = nrf_mram_get_parameters,
174184
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
175185
.page_layout = nrf_mram_page_layout,

0 commit comments

Comments
 (0)