Skip to content

Commit f1cbaeb

Browse files
committed
[nrf fromlist] drivers: flash: nrf: Add possibility to add custom context
This commit adds the possibility to add additional custom context for flash operations for usage by non-standard flash drivers. Upstream PR #: 87745 Signed-off-by: Artur Hadasz <[email protected]>
1 parent 999e700 commit f1cbaeb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/flash/Kconfig.nrf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ config FLASH_NRF_FORCE_ALT
77
This option can be enabled to force an alternative implementation
88
of the flash driver.
99

10+
config SOC_FLASH_NRF_CUSTOM_CONTEXT
11+
bool "Nordic nRFx flash driver operation custom context"
12+
depends on SOC_COMPATIBLE_NRF
13+
help
14+
Enable custom context for flash driver. This allows to use
15+
custom context for flash driver operations. This is useful
16+
when a non standard flash driver is used, requiring additional
17+
context.
18+
1019
menuconfig SOC_FLASH_NRF
1120
bool "Nordic Semiconductor nRF flash driver"
1221
default y

drivers/flash/soc_flash_nrf.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ struct flash_context {
2525
#if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE)
2626
uint32_t flash_addr_next;
2727
#endif /* CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE */
28+
#if defined(CONFIG_SOC_FLASH_NRF_CUSTOM_CONTEXT)
29+
void *custom_context;
30+
#endif
2831
}; /*< Context type for f. @ref write_op @ref erase_op */
2932

3033
#ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE

0 commit comments

Comments
 (0)