drivers: flash: Read/write arbitary commands via ex_op API #98619
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Some of the drivers in Zephyr are bus-HAL-specific drivers. Example: Zephyr SPI, Zephyr MSPI, NRFX QSPI, STM QSPI. When users want to write flash-part specific driver with the command set of their particular flash part, they should not need to reimplment or copy everything the bus-specific driver is doing. It would be easier for users to compose their flash-vendor specific driver using the bus-specific driver already in tree.
This PR introduces the
flash_ex_opAPI for the above goal. npcx_flash already implements similar function in their vendor extended operations:zephyr/include/zephyr/drivers/flash/npcx_flash_api_ex.h
Line 57 in 0f5e03f
zephyr/include/zephyr/drivers/flash/npcx_flash_api_ex.h
Line 66 in 0f5e03f
I want this for Flash MSPI driver at least because setting up the MSPI transaction is not trivial, but I believe this extended operation will be relevant for more drivers too. Implementation for Flash MSPI driver to follow after a RFC on this: #98621