Skip to content
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

pinctrl: gecko: add low power support #83398

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions drivers/pinctrl/pinctrl_gecko.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintp
pin_config.pin = GECKO_GET_PIN(pins[i]);
loc = GECKO_GET_LOC(pins[i]);

/* Force input for low power mode */
if (GECKO_GET_LP(pins[i]) == GECKO_LP_ENABLE) {
pin_config.mode = gpioModeInput;
pin_config.out = 0;
GPIO_PinModeSet(pin_config.port, pin_config.pin, pin_config.mode,
pin_config.out);
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I am a bit annoyed psels is ignored if low-power-enable is set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree: if psels is not ignored, we have to define a low power pin configuration for each psels features. Maybe another way could be to call his function after psels/fun actions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could suggest to encapsulate GPIO_PinModeSet with all flags passing and low power flags will proceed his own pin control settings with a switch case to be psels aware. Do you prefer that way?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have read a bit more about GPIO_PinModeSet(). I am now a bit confused. What do you expect when low-power-enable is set?


switch (GECKO_GET_FUN(pins[i])) {
#ifdef CONFIG_UART_GECKO
case GECKO_FUN_UART_RX:
Expand Down
Loading