diff mbox

[U-Boot,2/2] pinctrl: stm32: add set_state ops

Message ID 1497971059-19097-3-git-send-email-patrice.chotard@st.com
State Accepted
Commit bb44b96803da3d1033f97874cd2fdbe297c6bb5b
Delegated to: Tom Rini
Headers show

Commit Message

Patrice CHOTARD June 20, 2017, 3:04 p.m. UTC
From: Christophe Kerello <christophe.kerello@st.com>

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: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---
 drivers/pinctrl/pinctrl_stm32.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Tom Rini July 11, 2017, 12:40 p.m. UTC | #1
On Tue, Jun 20, 2017 at 05:04:19PM +0200, Patrice Chotard wrote:

> From: Christophe Kerello <christophe.kerello@st.com>
> 
> 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: Christophe Kerello <christophe.kerello@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl_stm32.c b/drivers/pinctrl/pinctrl_stm32.c
index 6183103..fb2593c 100644
--- a/drivers/pinctrl/pinctrl_stm32.c
+++ b/drivers/pinctrl/pinctrl_stm32.c
@@ -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[] = {