-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Introduce new pinctrl API (variant b) #35847
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
Conversation
The macros are used to get the pin(s) of a given driver instance. Add _INST prefix to match convention used by the devicetree.h. The original macros can now be used to obtain pin(s) of an arbitrary device instance identified by the nodelabel. Signed-off-by: Piotr Mienkowski <[email protected]>
Signed-off-by: Piotr Mienkowski <[email protected]>
Add pinctrl_sam driver and required infrastructure. Signed-off-by: Piotr Mienkowski <[email protected]>
Signed-off-by: Piotr Mienkowski <[email protected]>
| */ | ||
| static inline int pinctrl_pin_list_configure( | ||
| const pinctrl_dt_pin_spec_t pin_spec[], | ||
| unsigned int pin_spec_length) |
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.
size_t?
| * | ||
| * @retval 0 If successful. | ||
| */ | ||
| static inline int pinctrl_pin_list_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.
I wonder if there is any utility in passing a device pointer in here.
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.
Passing device pointer as the first argument of the function?
For the pinctrl_pin_list_configure function that would not be practical since every pinctrl_dt_pin_spec_t item from the list may be associated with a different device. But it probably makes sense to do it for pinctrl_pin_configure function. The function will become
int pinctrl_pin_configure(const struct device * dev, const pinctrl_pin_conf_t *pin_conf);
The current pinctrl_pin_configure, pinctrl_pin_list_configure functions will preserve their arguments but be renamed to pinctrl_pin_configure_dt, pinctrl_pin_list_configure_dt. After the change we will break one less convention and the implementation will be better aligned with the GPIO driver.
|
@mnkp what's the plan on updating this? |
Sorry, I will provide an update this week. |
ping ;) |
|
What will it take for us to move on with this implementation? What is missing before we can take it out of draft state? |
|
Closing this PR as we've pulled this into #37621 |
This is variant b) of the pinctrl API as discussed in #22748 (comment). It is relatively easy to implement and closer to the current Zephyr approach.
The
pinctrl_pin_configurefunction takes as an argument an opaque struct which content is defined on a per SoC family basis.