Skip to content

drivers: spi: mchp_mss: Make the driver a bit more universal #93008

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

c-mauderer
Copy link

The current driver has a workarround that seem to be targeted to SPI flashes. It completely throws away the first Rx buffer without any warning or error. This patch set:

  • Removes that behavior and processes the first SPI buffer normally.
  • Makes sure that NULL-Buffers are handled correctly.
  • Avoids sending extra bytes if the transmit is already done while the receive is not yet finished.

The driver has ignored the first RX buffer. Most likely it has been
modeled for accesses to a SPI flash or similar where the first read data
is not relevant.

This commit makes sure that the driver can work as a universal SPI
master instead.

Signed-off-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
At the moment, if you would pass a NULL buffer to the driver, the rx and
tx counts of that buffer would not advance. This patch fixes that.

Signed-off-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
The driver did send some extra 0 bytes when the receive hasn't been
finished yet. This patch makes sure to avoid that.

Signed-off-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
Copy link

Hello @c-mauderer, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: SPI SPI bus platform: Microchip MEC Microchip MEC Platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants