File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2020 Nordic Semiconductor ASA
2
+ * Copyright (c) 2020-2024 Nordic Semiconductor ASA
3
3
*
4
4
* SPDX-License-Identifier: Apache-2.0
5
5
*/
@@ -646,11 +646,21 @@ flash_at45_get_parameters(const struct device *dev)
646
646
return & flash_at45_parameters ;
647
647
}
648
648
649
+ static int spi_flash_at45_get_size (const struct device * dev , uint64_t * size )
650
+ {
651
+ const struct spi_flash_at45_config * cfg = dev -> config ;
652
+
653
+ * size = (uint64_t )cfg -> chip_size ;
654
+
655
+ return 0 ;
656
+ }
657
+
649
658
static const struct flash_driver_api spi_flash_at45_api = {
650
659
.read = spi_flash_at45_read ,
651
660
.write = spi_flash_at45_write ,
652
661
.erase = spi_flash_at45_erase ,
653
662
.get_parameters = flash_at45_get_parameters ,
663
+ .get_size = spi_flash_at45_get_size ,
654
664
#if defined(CONFIG_FLASH_PAGE_LAYOUT )
655
665
.page_layout = spi_flash_at45_pages_layout ,
656
666
#endif
You can’t perform that action at this time.
0 commit comments