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
drivers: gpio: move non-standard dts flags to be soc specific #39767
drivers: gpio: move non-standard dts flags to be soc specific #39767
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the dt-bindings are going to be extended, I think all the GPIO flags should be moved into the dt-bindings instead of just the drive strength flags.
API meeting:
|
@henrikbrixandersen ping |
I'd like to see this change get approved. What's the current status of this PR? |
a6e0693
to
2756a23
Compare
@keith-zephyr Thanks for reminding me. I have updated this PR to extend the size of |
@mnkp @gmarull @mbolivar-nordic please take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. In some cases, like nRF, we can now offer more meaningful options for the users. Will look at it after this gets in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need an index of device drivers in the documentation that includes information on driver-specific features more than ever with changes like this going in...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @henrikbrixandersen, great work! I have some minor but blocking comments. Also, I think we should squash "drivers: gpio: allow specifying GPIO drive strength/debounce flags in dts" commit. I.e. implement all the changes in a single commit.
be47c29
2879637
to
be47c29
Compare
@mnkp Thank you for reviewing. I have squashed the two commits into one. Please see my question on how you'd like to handle deprecation of the old macros. |
@mnkp Ping? |
drivers/gpio/gpio_andes_atcgpio100.c
Outdated
@@ -140,7 +141,7 @@ static int gpio_atcgpio100_config(const struct device *port, | |||
key = k_spin_lock(&data->lock); | |||
|
|||
/* Set de-bounce */ | |||
if (flags & GPIO_INT_DEBOUNCE) { | |||
if (flags & ATCGPIO100_GPIO_INT_DEBOUNCE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should get rid of this misleading INT_
component from the names of debounce flags. Unlike all other GPIO_INT_*
flags, the debounce flag is supposed to be used in calls to gpio_pin_configure()
, not gpio_pin_interrupt_configure()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anangl Thank you for reviewing. I have removed the _INT
part of the name for the SoC specific debounce flags.
be47c29
to
828b677
Compare
Reserve the upper 8 bits of gpio_dt_flags_t for SoC specific flags and move the non-standard, hardware-specific GPIO devicetree flags (IO voltage level, drive strength, debounce filter) from the generic dt-bindings/gpio/gpio.h header to SoC specific dt-bindings headers. Some of the SoC specific dt-bindings flags take up more bits than necessary in order to retain backwards compatibility with the deprecated GPIO flags. The width of these fields can be reduced/optimized once the deprecated flags are removed. Remove hardcoded use of GPIO_INT_DEBOUNCE in GPIO client drivers. This flag can now be set in the devicetree for boards/SoCs with debounce filter support. The SoC specific debounce flags have had the _INT part of their name removed since these flag must be passed to gpio_pin_configure(), not gpio_pin_interrupt_configure(). Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
828b677
to
c061702
Compare
Reserve the upper 8 bits of
gpio_dt_flags_t
for SoC specific flags and move the non-standard, hardware-specific GPIO devicetree flags (IO voltage level, drive strength, debounce filter) from the genericdt-bindings/gpio/gpio.h
header to SoC specific dt-bindings headers.Some of the SoC specific dt-bindings flags take up more bits than necessary in order to retain backwards compatibility with the deprecated GPIO flags. The width of these fields can be reduced/optimized once the deprecated flags are removed.
Remove hardcoded use of
GPIO_INT_DEBOUNCE
in GPIO client drivers. This flag can now be set in the devicetree for boards/SoCs with debounce filter support. The SoC specific debounce flags have had the_INT
part of their name removed since these flag must be passed togpio_pin_configure()
, notgpio_pin_interrupt_configure()
.Signed-off-by: Henrik Brix Andersen hebad@vestas.com