-
Notifications
You must be signed in to change notification settings - Fork 8.2k
pinctrl: Provide an API for devices using custom reg + STM32 PWM user #40430
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
721d0a8 to
9114518
Compare
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 <gerard.marull@nordicsemi.no>
Use the new pinctrl API to configure pins. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
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 <gerard.marull@nordicsemi.no>
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 <gerard.marull@nordicsemi.no>
Use the new pinctrl API to configure pins. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Add the pinctrl state name (default) for the ADC peripherals. Changes performed based on the script proposed in "boards: arm: stm32: add pinctrl state name for UART peripheral" Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Use the new pinctrl API to configure pins. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Add the pinctrl state name (default) for the CAN peripherals. Changes performed based on the script proposed in "boards: arm: stm32: add pinctrl state name for UART peripheral" Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Use the new pinctrl API to configure pins. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Add the pinctrl state name (default) for the FDCAN peripherals. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Member
Author
|
Closing in favor of #40515 |
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: Boards
area: Build System
area: CAN
area: DAC
Digital-to-Analog Converter
area: Devicetree
area: Disk Access
area: Ethernet
area: Flash
area: I2C
area: I2S
area: PWM
Pulse Width Modulation
area: SPI
SPI bus
area: UART
Universal Asynchronous Receiver-Transmitter
area: USB
Universal Serial Bus
platform: STM32
ST Micro STM32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a pinctrl API which allows usage of custom reg in pinctrl_dev_config definition.
Additionaly, update STM32 PWM driver to use pinctrl API in general and this new API in particular.
Based on #40194, only consider the 4 last commits