-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver/mtd: ramtron multi-device spi bus support #15987
Conversation
[Experimental Bot, please feedback here] Yes, this PR mostly meets the requirements, but needs minor improvements. Strengths:
Areas for improvement:
By addressing these points, the PR will be even stronger and easier for reviewers to assess. |
If breaking backwards compatibility with the initialization is not acceptable, it could be broken into two functions. The backwards compatible function would just call the new one with |
Adds a device ID to ramtron_initialize, which is stored in the ramtron_dev_s structure. This ID is used when calling SPI_SELECT to board specific logic to allow chip select on the SPI bus. This change is NOT backwards compatible, as it changes the function signature of ramtron_initialize. This implementation is based on the handling of chip select in nuttx/drivers/mtd/sst26.c:sst26_initialize_spi(). Additional Changes: - Add MB85RS64V to ramtron supported parts list.
I made the requested text alignment change. |
Adds a device ID to
ramtron_initialize
, which is stored in theramtron_dev_s
structure. This ID is used when calling SPI_SELECT to board specific logic to allow chip select on the SPI bus.This change is NOT backwards compatible, as it changes the function signature of
ramtron_initialize
.This implementation is based on the handling of chip select in
nuttx/drivers/mtd/sst26.c:sst26_initialize_spi()
.Additional Changes:
Additional contributors: @ArrestedLightning
Note: Please adhere to Contributing Guidelines.
Summary
This change makes the ramtron driver compatible with boards that have more than one memory device per SPI peripheral. Its implementation is based on other mtd drivers such as
sst26.c
.Before this change the ramtron driver exclusively called
SPIDEV_FLASH(0)
. With this change, the SPI device ID is provided during initialization and used withSPIDEV_FLASH
calls in the driver. This allows control over chip select in board specific code.Impact
This change breaks backwards compatibility: it changes the function signature of
ramtron_initialize
fromramtron_initialize(FAR struct spi_dev_s *)
toramtron_initialize(FAR struct spi_dev_s *, uint16_t)
.Testing
Target used for testing is a custom board:
Build Host: