Commit 2695efa9 authored by Erwan Gouriou's avatar Erwan Gouriou Committed by Kumar Gala
Browse files

soc: stm32xx: add pwm pinmux support



Following pinmux update for PWM support,
update soc to support this new configuration.

Change-Id: I1126e347ab1ab6b2d830993e548de8f32fa2f8f9
Signed-off-by: default avatarErwan Gouriou <erwan.gouriou@linaro.org>
parent 971de254
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -52,12 +52,18 @@ static const stm32_pin_func_t pin_pb11_funcs[] = {
			STM32F10X_PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
};

static const stm32_pin_func_t pin_pa8_funcs[] = {
	[STM32F1_PINMUX_FUNC_PA8_PWM1_CH1 - 1] =
			STM32F10X_PIN_CONFIG_AF_PUSH_PULL,
};

/**
 * @brief pin configuration
 */
static struct stm32_pinmux_conf pins[] = {
	STM32_PIN_CONF(STM32_PIN_PA2, pin_pa2_funcs),
	STM32_PIN_CONF(STM32_PIN_PA3, pin_pa3_funcs),
	STM32_PIN_CONF(STM32_PIN_PA8, pin_pa8_funcs),
	STM32_PIN_CONF(STM32_PIN_PA9, pin_pa9_funcs),
	STM32_PIN_CONF(STM32_PIN_PA10, pin_pa10_funcs),
	STM32_PIN_CONF(STM32_PIN_PB10, pin_pb10_funcs),
+6 −0
Original line number Diff line number Diff line
@@ -52,6 +52,11 @@ static const stm32_pin_func_t pin_pa3_funcs[] = {
			STM32F4X_PIN_CONFIG_AF_PUSH_UP,
};

static const stm32_pin_func_t pin_pa0_funcs[] = {
	[STM32F4_PINMUX_FUNC_PA0_PWM2_CH1 - 1] =
			STM32F4X_PIN_CONFIG_AF_PUSH_UP,
};

/**
 * @brief pin configuration
 */
@@ -62,6 +67,7 @@ static const struct stm32_pinmux_conf pins[] = {
	STM32_PIN_CONF(STM32_PIN_PB7, pin_pb7_funcs),
	STM32_PIN_CONF(STM32_PIN_PA2, pin_pa2_funcs),
	STM32_PIN_CONF(STM32_PIN_PA3, pin_pa3_funcs),
	STM32_PIN_CONF(STM32_PIN_PA0, pin_pa0_funcs),
};

int stm32_get_pin_config(int pin, int func)
+6 −0
Original line number Diff line number Diff line
@@ -64,10 +64,16 @@ static const stm32_pin_func_t pin_pb11_funcs[] = {
		STM32L4X_PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
};

static const stm32_pin_func_t pin_pa0_funcs[] = {
	[STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1 - 1] =
		STM32L4X_PIN_CONFIG_PUSH_PULL,
};

/**
 * @brief pin configuration
 */
static const struct stm32_pinmux_conf pins[] = {
	STM32_PIN_CONF(STM32_PIN_PA0, pin_pa0_funcs),
	STM32_PIN_CONF(STM32_PIN_PA2, pin_pa2_funcs),
	STM32_PIN_CONF(STM32_PIN_PA3, pin_pa3_funcs),
	STM32_PIN_CONF(STM32_PIN_PA9, pin_pa9_funcs),