Skip to content

Commit b4a9f1d

Browse files
de-nordickartben
authored andcommitted
drivers/flash/flash_sam: Add flash_get_size API call
The commit adds implementation of flash_get_size. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 6efba38 commit b4a9f1d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/flash/flash_sam0.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,13 @@ flash_sam0_get_parameters(const struct device *dev)
454454
return &flash_sam0_parameters;
455455
}
456456

457+
static int flash_sam0_get_size(const struct device *dev, uint64_t *size)
458+
{
459+
*size = (uint64_t)CONFIG_FLASH_SIZE;
460+
461+
return 0;
462+
}
463+
457464
static int flash_sam0_init(const struct device *dev)
458465
{
459466
#if defined(CONFIG_MULTITHREADING)
@@ -485,6 +492,7 @@ static const struct flash_driver_api flash_sam0_api = {
485492
.write = flash_sam0_write,
486493
.read = flash_sam0_read,
487494
.get_parameters = flash_sam0_get_parameters,
495+
.get_size = flash_sam0_get_size,
488496
#ifdef CONFIG_FLASH_PAGE_LAYOUT
489497
.page_layout = flash_sam0_page_layout,
490498
#endif

0 commit comments

Comments
 (0)