Bl808/i2c proposed fixes#1
Merged
Hunter1753 merged 4 commits intoHunter1753:bl808/i2cfrom Mar 29, 2023
Merged
Conversation
Owner
|
hey, i pulled your branch and ran the build and i got some errors: |
Both if statement branches are basically the same and the code can be deduplicated using the min_t() macro.
The write to BL808_I2C_FIFO_WDATA would happen even if msg_buf_remaining was 0 and the value to be written was not set, which doesn't make much sense. This patch fixes that.
Maximal transfer len should be specified using quirks as this is the standard method. The i2c-core will make sure our master_xfer callback is not called with messages that are too long. It is important as some of the i2c clinet code (and regmap code) checks this field to understand the adapter capabilities.
The TX_FIFO_CLR and RX_FIFO_CLR fileds of the FIFO_CONFIG_0 register as well as END_CLR, NAK_CLR and ARB_CLR of the STS register are marked as w1c in the reference manual so there should be no need for read-modify-write cycle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Just a few of the proposed changed that I noticed while reviewing this code. Please keep in mind that I do not have the hardware to test those changes yet but I still wanted to communicate those ideas to you.