Skip to content

Conversation

@fabiobaltieri
Copy link
Member

Use GPIO_OUTPUT_INACTIVE to initialize the pin so that the ACTIVE_LOW DT flag is honored and use the gpio_pin_set_dt functions to set the (logical) value of the pin instead of gpio_pin_configure_dt, that tries to reconfigure the pin each time.

Use GPIO_OUTPUT_INACTIVE to initialize the pin so that the ACTIVE_LOW DT
flag is honored and use the gpio_pin_set_dt functions to set the
(logical) value of the pin instead of gpio_pin_configure_dt, that
tries to reconfigure the pin each time.

Signed-off-by: Fabio Baltieri <[email protected]>
@fabiobaltieri
Copy link
Member Author

fabiobaltieri commented Nov 9, 2023

@Ayush1325 @jadonk sorry missed this out from #64693, the behavior in the current use case should be the same since the pin is setup as ACTIVE_HIGH, but this allows using the driver with an active low switch by just using the correct flag in the devicetree.

@fabiobaltieri fabiobaltieri requested a review from gmarull November 9, 2023 19:07
@fabiobaltieri fabiobaltieri added the Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. label Nov 10, 2023
Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

Thanks. I only just saw this driver addition now.

The naming of the binding (and as a consequence, the driver implementation) should have been i2c-switch-gpio to follow the Zephyr naming scheme.

@fabiobaltieri fabiobaltieri merged commit ac450be into zephyrproject-rtos:main Nov 10, 2023
@fabiobaltieri fabiobaltieri deleted the i2c-switch-followup branch November 10, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: I2C Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants