pinmux/stm32: add common driver for STM32 pinmux
Add a common driver for pin control subsystem in STM32 MCU series. The driver allows for selection of pin's function without the ability of pin remapping. The driver implements a pinmux driver API, with custom `func` and `pin` encoding in API calls. The caller is expected to use STM32PIN() helper macro for encoding port/pin numbers or using one of the provided STM32_PIN_* defines. The common driver requires SoC specific support to be implemented. The SoC code must implement these calls: stm32_get_pin_config(), stm32_get_port_clock(), stm32_pin_configure(). Consult pinmux_stm32.h header for detailn on semantics of these calls. The driver also requires board level integration. The call stm32_board_get_pinconf() is expected to privide pin function assignments for the target board. Whenever an IO pin is being enabled, the driver will automatically enable the clock for corresponding port. The driver does not implement disabling of port's clock as this has potentially disruptive, as such such operation should be done explicitly in the code. The pin control module needs to be initialized before any other modules, but after clock_control. For this reason, the driver is initialized by default at PRIMARY level, with priority set to 2. The priority can be changed through configuration. Change-Id: I8cb746d0f3cad72cd50b3355fe6d93a9f469be25 Origin: Original Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
This commit is contained in:
parent
f3ebc5bf97
commit
e53390f02d
5 changed files with 480 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
ccflags-y +=-I$(srctree)/drivers
|
||||
|
||||
obj-$(CONFIG_PINMUX_K64) += pinmux_k64.o
|
||||
obj-$(CONFIG_PINMUX_STM32) += pinmux_stm32.o
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue