Skip to content

Conversation

@mnkp
Copy link
Member

@mnkp mnkp commented Jun 1, 2021

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_configure function takes as an argument an opaque struct which content is defined on a per SoC family basis.

mnkp added 4 commits June 1, 2021 11:56
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]>
@mnkp mnkp added the area: API Changes to public APIs label Jun 1, 2021
@mnkp mnkp self-assigned this Jun 1, 2021
@henrikbrixandersen henrikbrixandersen self-requested a review June 1, 2021 14:58
*/
static inline int pinctrl_pin_list_configure(
const pinctrl_dt_pin_spec_t pin_spec[],
unsigned int pin_spec_length)
Copy link
Member

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(
Copy link
Contributor

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.

Copy link
Member Author

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.

@galak
Copy link
Contributor

galak commented Jun 29, 2021

@mnkp what's the plan on updating this?

@mnkp
Copy link
Member Author

mnkp commented Jun 29, 2021

@mnkp what's the plan on updating this?

Sorry, I will provide an update this week.

@nandojve nandojve self-requested a review June 29, 2021 14:45
@galak
Copy link
Contributor

galak commented Jul 12, 2021

Sorry, I will provide an update this week.

ping ;)

@henrikbrixandersen
Copy link
Member

What will it take for us to move on with this implementation? What is missing before we can take it out of draft state?

@galak
Copy link
Contributor

galak commented Aug 11, 2021

Closing this PR as we've pulled this into #37621

@galak galak closed this Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ADC Analog-to-Digital Converter (ADC) area: API Changes to public APIs area: I2C area: I2S area: Networking area: SPI SPI bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants