Skip to content

Fix SPI CS handling in LoRa radios #26653

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

Merged
merged 2 commits into from
Jul 6, 2020

Conversation

andysan
Copy link
Collaborator

@andysan andysan commented Jul 5, 2020

Use CS flags from the device tree. Fixes a bug introduced by #26269.

andysan added 2 commits July 5, 2020 21:46
Add chip select flags from the device tree to the spi_cs_control
instance.

Signed-off-by: Andreas Sandberg <[email protected]>
Add chip select flags from the device tree to the spi_cs_control
instance.

Signed-off-by: Andreas Sandberg <[email protected]>
@andysan andysan requested a review from Mani-Sadhasivam as a code owner July 5, 2020 20:52
@andysan andysan requested review from mniestroj and nandojve July 5, 2020 20:53
@@ -550,6 +550,10 @@ static int sx1276_lora_init(struct device *dev)
return -EIO;
}

spi_cs.gpio_pin = GPIO_CS_PIN;
spi_cs.gpio_dt_flags = GPIO_CS_FLAGS;
spi_cs.delay = 0U;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delay is initialized to 0 anyway, because variable is declared as static. Is there a reason to specify that explicitly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I realised that as well. Most other drivers that I looked at seem to do it explicitly though. Happy to drop it if you think it is a problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just a preference, not a blocker :)

@mniestroj mniestroj added area: LoRa area: SPI SPI bus bug The issue is a bug, or the PR is fixing a bug labels Jul 6, 2020
@nashif nashif merged commit 8e8f14e into zephyrproject-rtos:master Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: LoRa area: SPI SPI bus bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants