mirror of
https://github.com/ukui/kernel.git
synced 2026-03-09 10:07:04 -07:00
pinctrl: Add STM32 MCUs support
This patch adds pinctrl and GPIO support to STMicroelectronic's STM32 family of MCUs. While it only supports STM32F429 for now, it has been designed to enable support of other MCUs of the family (e.g. STM32F746). Acked-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
936516bfb3
commit
aceb16dc2d
@@ -257,6 +257,7 @@ source "drivers/pinctrl/qcom/Kconfig"
|
||||
source "drivers/pinctrl/samsung/Kconfig"
|
||||
source "drivers/pinctrl/sh-pfc/Kconfig"
|
||||
source "drivers/pinctrl/spear/Kconfig"
|
||||
source "drivers/pinctrl/stm32/Kconfig"
|
||||
source "drivers/pinctrl/sunxi/Kconfig"
|
||||
source "drivers/pinctrl/uniphier/Kconfig"
|
||||
source "drivers/pinctrl/vt8500/Kconfig"
|
||||
|
||||
@@ -51,6 +51,7 @@ obj-$(CONFIG_ARCH_QCOM) += qcom/
|
||||
obj-$(CONFIG_PINCTRL_SAMSUNG) += samsung/
|
||||
obj-$(CONFIG_PINCTRL_SH_PFC) += sh-pfc/
|
||||
obj-$(CONFIG_PINCTRL_SPEAR) += spear/
|
||||
obj-$(CONFIG_ARCH_STM32) += stm32/
|
||||
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
|
||||
obj-$(CONFIG_PINCTRL_UNIPHIER) += uniphier/
|
||||
obj-$(CONFIG_ARCH_VT8500) += vt8500/
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
if ARCH_STM32 || COMPILE_TEST
|
||||
|
||||
config PINCTRL_STM32
|
||||
bool
|
||||
depends on OF
|
||||
select PINMUX
|
||||
select GENERIC_PINCONF
|
||||
select GPIOLIB
|
||||
|
||||
config PINCTRL_STM32F429
|
||||
bool "STMicroelectronics STM32F429 pin control" if COMPILE_TEST && !MACH_STM32F429
|
||||
depends on OF
|
||||
default MACH_STM32F429
|
||||
select PINCTRL_STM32
|
||||
|
||||
endif
|
||||
@@ -0,0 +1,5 @@
|
||||
# Core
|
||||
obj-$(CONFIG_PINCTRL_STM32) += pinctrl-stm32.o
|
||||
|
||||
# SoC Drivers
|
||||
obj-$(CONFIG_PINCTRL_STM32F429) += pinctrl-stm32f429.o
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (C) Maxime Coquelin 2015
|
||||
* Author: Maxime Coquelin <mcoquelin.stm32@gmail.com>
|
||||
* License terms: GNU General Public License (GPL), version 2
|
||||
*/
|
||||
#ifndef __PINCTRL_STM32_H
|
||||
#define __PINCTRL_STM32_H
|
||||
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
#include <linux/pinctrl/pinconf-generic.h>
|
||||
|
||||
struct stm32_desc_function {
|
||||
const char *name;
|
||||
const unsigned char num;
|
||||
};
|
||||
|
||||
struct stm32_desc_pin {
|
||||
struct pinctrl_pin_desc pin;
|
||||
const struct stm32_desc_function *functions;
|
||||
};
|
||||
|
||||
#define STM32_PIN(_pin, ...) \
|
||||
{ \
|
||||
.pin = _pin, \
|
||||
.functions = (struct stm32_desc_function[]){ \
|
||||
__VA_ARGS__, { } }, \
|
||||
}
|
||||
|
||||
#define STM32_FUNCTION(_num, _name) \
|
||||
{ \
|
||||
.num = _num, \
|
||||
.name = _name, \
|
||||
}
|
||||
|
||||
struct stm32_pinctrl_match_data {
|
||||
const struct stm32_desc_pin *pins;
|
||||
const unsigned int npins;
|
||||
};
|
||||
|
||||
int stm32_pctl_probe(struct platform_device *pdev);
|
||||
|
||||
#endif /* __PINCTRL_STM32_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user