-
Notifications
You must be signed in to change notification settings - Fork 8.2k
pinctrl: add STM32 implementation #39430
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
Add initial version for STM32 pinctrl driver. Driver has been written re-using many of the already existing parts in drivers/pinmux/pinmux_stm32.c. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Use the new pinctrl API to configure pins. Signed-off-by: Gerard Marull-Paretas <[email protected]>
Enable the pin control driver on all STM32 based boards. The following
script has been used to do this task:
```
from pathlib import Path
import re
for fpath in Path(".").glob("boards/arm/**/*_defconfig"):
lines = open(fpath).readlines()
is_stm32 = False
for line in lines:
if "CONFIG_SOC_SERIES_STM32" in line:
is_stm32 = True
break
if not is_stm32:
continue
lines += ["\n", "# enable pin controller\n", "CONFIG_PINCTRL=y\n"]
with open(fpath, "w") as f:
f.writelines(lines)
```
Signed-off-by: Gerard Marull-Paretas <[email protected]>
Add the pinctrl state name (default) for the UART/USART/LPUART
peripherals. Changes performed using the following Python script run
from the repository root:
```
from pathlib import Path
import re
for fpath in Path(".").glob("boards/arm/**/*.dts"):
lines = open(fpath).readlines()
is_stm32 = False
for line in lines:
if "stm32" in line:
is_stm32 = True
break
if not is_stm32:
continue
with open(fpath, "w") as f:
for line in lines:
f.write(line)
m = re.match(r"(\s+)pinctrl-0.*us?art.*", line)
if m:
f.write(m.group(1) + "pinctrl-names = \"default\";\n")
```
Signed-off-by: Gerard Marull-Paretas <[email protected]>
95994ee to
5111257
Compare
|
@erwango should now be ready, but I haven't tested if latest additions to the pinmux driver work all as expected, feel free to take this PR if you want. I'm not sure what is the approach you want to follow. Since migration is easy in this case, all drivers could be ported to avoid coexistence of |
|
FYI, on going on my side, should be completed next week |
|
Superseded by #40194 |
This PR adds an initial implementation of a pinctrl driver for STM32 based on the pinctrl API proposal in #37572. The driver is based on the existing pinmux driver and supports both F1 and non-F1 series.