Skip to content
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

[TOPIC-GPIO] drivers: ssd16xx: convert to new GPIO API #21686

Merged
merged 1 commit into from
Jan 25, 2020

Conversation

jfischer-no
Copy link
Collaborator

Convert SSD16XX sensor driver to new GPIO API.

TODO: shield overlays, but first the gpio branch has to be rebased on master

@jfischer-no jfischer-no added area: Drivers area: GPIO DNM This PR should not be merged (Do Not Merge) area: Display labels Jan 3, 2020
@jfischer-no jfischer-no changed the title drivers: ssd16xx: convert to new GPIO API [TOPIC-GPIO] drivers: ssd16xx: convert to new GPIO API Jan 3, 2020
@zephyrbot
Copy link
Collaborator

zephyrbot commented Jan 3, 2020

All checks are passing now.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

boards/arm/reel_board/reel_board.dts Outdated Show resolved Hide resolved
boards/arm/reel_board/reel_board_v2.dts Outdated Show resolved Hide resolved
drivers/display/ssd16xx.c Outdated Show resolved Hide resolved
drivers/display/ssd16xx.c Outdated Show resolved Hide resolved
@jfischer-no jfischer-no requested a review from erwango as a code owner January 23, 2020 22:44
@jfischer-no jfischer-no removed the DNM This PR should not be merged (Do Not Merge) label Jan 23, 2020
@carlescufi
Copy link
Member

@mnkp please re-review

Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

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

LGTM as is.

@vanwinkeljan
Copy link
Member

@jfischer-phytec-iot Are there any updates needed to the shield overlays?

Copy link
Collaborator

@pabigot pabigot left a comment

Choose a reason for hiding this comment

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

Required change is not loop on error return from gpio_pin_get().


gpio_pin_read(driver->busy, SSD16XX_BUSY_PIN, &val);
while (val) {
while (pin) {
Copy link
Collaborator

@pabigot pabigot Jan 24, 2020

Choose a reason for hiding this comment

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

This should be pin > 0 to prevent an infinite loop if the GPIO driver can return an error on read (e.g. SX1509B with an I2C failure). (Or pin == 1 but I prefer "positive means set".)

@@ -580,7 +583,7 @@ static int ssd16xx_init(struct device *dev)
}

gpio_pin_configure(driver->dc, SSD16XX_DC_PIN,
GPIO_DIR_OUT);
GPIO_OUTPUT | SSD16XX_DC_FLAGS);
Copy link
Collaborator

Choose a reason for hiding this comment

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

GPIO_OUTPUT_INACTIVE? Just for clarity/consistency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

okay, but DC will always be set/reset in ssd16xx_write_cmd(). btw, I forgot to change few lines, fixed now.

Convert SSD16XX sensor driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
@jfischer-no
Copy link
Collaborator Author

jfischer-no commented Jan 24, 2020

@jfischer-phytec-iot Are there any updates needed to the shield overlays?

@vanwinkeljan I think not, I have updated the shields together with appropriate driver.

@MaureenHelm MaureenHelm merged this pull request into zephyrproject-rtos:topic-gpio Jan 25, 2020
@jfischer-no jfischer-no deleted the gpio-ssd16xx branch October 10, 2020 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants