drivers/eeprom: Set the bus frequency - #17344
Conversation
4f3689a to
b88c98e
Compare
linguini1
left a comment
There was a problem hiding this comment.
Please update the impact section, it isn't none if you've changed the driver.
Also, I don't think these changes should be merged until they are tested with an I2C based EEPROM (since you mentioned you only compile tested that). I have a board with one, I can try to test this patch against it in the next few days (unless someone else beats me to it).
b88c98e to
2ec5180
Compare
Updated, I meant "none" in the sense that as long as the ioctl isn't called the behaviour doesn't differ from the current one. I don't have a I2C EEPROM at hand so any help in testing this bit is definitely welcome. |
Add EEPIOC_SETSPEED ioctl acting like the MTDIOC_SETSPEED ioctl. The default frequency is settable in the Kconfig. Add xx25xx SPI delay control configurations. Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
57985c9
2ec5180 to
57985c9
Compare
linguini1
left a comment
There was a problem hiding this comment.
Had a chance to test with my I2C-based EEPROM today (24C32FP by ST). Functional to read from as a character device still.
Great, thank you very much for testing |
Summary
Add EEPIOC_SETSPEED ioctl acting like the MTDIOC_SETSPEED ioctl.
The default frequency is taken from the Kconfig and can be adjusted at runtime using this ioctl.
The SPI timing configuration parameters from mtd/at25ee have also been copied so that they can be applied to eeprom/spi_xx25xx.
Impact
If
CONFIG_SPI_DELAY_CONTROLis set, SPI timing parameters will be explicitly set when communicating with the eeprom/spi_xx25xx device.As long as the new ioctl command is not used, the EEPROM drivers behaviour is unchanged.
Testing
Tested on a custom target (STM32F7-based) with a Rhom BR25G256FVT EEPROM (equivalent to a Microchip 25xx256).
Changes to the i2c_xx24xx driver have been compiled only.