-
Notifications
You must be signed in to change notification settings - Fork 7.3k
drivers: pinctrl: rp2040: output override config #88612
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
base: main
Are you sure you want to change the base?
drivers: pinctrl: rp2040: output override config #88612
Conversation
Hello @ebmmy, and thank you very much for your first pull request to the Zephyr project! |
fc4a066
to
4bdd8b8
Compare
4bdd8b8
to
35ff987
Compare
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.
The functional change looks good.
I would like to see the whitespace changes moved to a separate commit
/** Output override */ | ||
uint32_t out_override: 2; |
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.
Use a descriptive variable name, and then the comment becomes redundant, i.e.
/** Output override */ | |
uint32_t out_override: 2; | |
/** Output override */ | |
uint32_t output_override: 2; |
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.
Since it matches the original naming that follows the SDK's gpio_set_outover(), I think the current version is preferable.
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.
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.
This is an area of contention and a matter of style, so it's up to you to decide based on both sides' arguments.
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 would leave it as it is, so this is similar to the `oe-override config
/** Output override */ | ||
uint32_t out_override: 2; | ||
/** Input override */ | ||
uint32_t in_override: 2; |
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.
uint32_t in_override: 2; | |
uint32_t input_override: 2; |
DT_PROP(node_id, raspberrypi_out_override), \ | ||
DT_PROP(node_id, raspberrypi_in_override), \ |
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.
DT_PROP(node_id, raspberrypi_out_override), \ | |
DT_PROP(node_id, raspberrypi_in_override), \ | |
DT_PROP(node_id, raspberrypi_output_override), \ | |
DT_PROP(node_id, raspberrypi_input_override), \ |
In combination with the suggestion above.
gpio_set_outover(pin->pin_num, pin->out_override); | ||
gpio_set_inover(pin->pin_num, pin->in_override); |
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.
gpio_set_outover(pin->pin_num, pin->out_override); | |
gpio_set_inover(pin->pin_num, pin->in_override); | |
gpio_set_outover(pin->pin_num, pin->output_override); | |
gpio_set_inover(pin->pin_num, pin->input_override); |
@ThreeEights Could you take a look if you have time? |
35ff987
to
cc78880
Compare
Add a device-tree property to configure the override functionalities of RP2040 GPIO pins. Signed-off-by: Martin Meyer <[email protected]>
Apply clang-format on source files. Signed-off-by: Martin Meyer <[email protected]>
cc78880
to
4936dae
Compare
Add a device-tree property to configure the output override functionnality of RP2040 GPIO pins.