Skip to content
Snippets Groups Projects
Commit bb44b968 authored by Christophe Kerello's avatar Christophe Kerello Committed by Tom Rini
Browse files

pinctrl: stm32: add set_state ops


set_state_ops is kept under PINCTRL_FULL flag in order
to decrease memory footprint in some configuration.
PINCTRL_FULL can be enabled for debug purpose.

Signed-off-by: default avatarChristophe Kerello <christophe.kerello@st.com>
Signed-off-by: default avatarPatrice Chotard <patrice.chotard@st.com>
parent ad0376e0
No related branches found
No related tags found
No related merge requests found
......@@ -133,6 +133,12 @@ static int stm32_pinctrl_config(int offset)
return 0;
}
#if CONFIG_IS_ENABLED(PINCTRL_FULL)
static int stm32_pinctrl_set_state(struct udevice *dev, struct udevice *config)
{
return stm32_pinctrl_config(dev_of_offset(config));
}
#else /* PINCTRL_FULL */
static int stm32_pinctrl_set_state_simple(struct udevice *dev,
struct udevice *periph)
{
......@@ -165,9 +171,14 @@ static int stm32_pinctrl_set_state_simple(struct udevice *dev,
return 0;
}
#endif /* PINCTRL_FULL */
static struct pinctrl_ops stm32_pinctrl_ops = {
#if CONFIG_IS_ENABLED(PINCTRL_FULL)
.set_state = stm32_pinctrl_set_state,
#else /* PINCTRL_FULL */
.set_state_simple = stm32_pinctrl_set_state_simple,
#endif /* PINCTRL_FULL */
};
static const struct udevice_id stm32_pinctrl_ids[] = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment