summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-11-27 10:31:27 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-11-27 10:42:53 +0100
commit6d2f0d57beeda5f380a20f5b31b6f0cd431fe377 (patch)
tree38c0ab44950eabe0ee8bf3beab58dabb915c8aa4 /include
parente586a64d3e3c2e5fb6363271fb079126b7e9fa0f (diff)
downloadbarebox-6d2f0d57beeda5f380a20f5b31b6f0cd431fe377.tar.gz
barebox-6d2f0d57beeda5f380a20f5b31b6f0cd431fe377.tar.xz
pinctrl: Add functions to select pinctrl from device_node
Instead of requiring a device pointer, add a functions to select the pinctrl state based on a device node. The AM33xx cpsw devicetree description has several subdevices with pinctrl information attached to them. In barebox we do not handle the subdevices as distinct devices, so the pinctrl is never configured correctly and the mdio bus subdevice stops working. This patch makes it possible to configure the pinctrl without having a device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/pinctrl.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/pinctrl.h b/include/pinctrl.h
index 7323f8b2f2..0f03b10bec 100644
--- a/include/pinctrl.h
+++ b/include/pinctrl.h
@@ -20,6 +20,8 @@ void pinctrl_unregister(struct pinctrl_device *pdev);
#ifdef CONFIG_PINCTRL
int pinctrl_select_state(struct device_d *dev, const char *state);
int pinctrl_select_state_default(struct device_d *dev);
+int of_pinctrl_select_state(struct device_node *np, const char *state);
+int of_pinctrl_select_state_default(struct device_node *np);
#else
static inline int pinctrl_select_state(struct device_d *dev, const char *state)
{
@@ -30,6 +32,16 @@ static inline int pinctrl_select_state_default(struct device_d *dev)
{
return -ENODEV;
}
+
+static inline int of_pinctrl_select_state(struct device_node *np, const char *state)
+{
+ return -ENODEV;
+}
+
+static inline int of_pinctrl_select_state_default(struct device_node *np)
+{
+ return -ENODEV;
+}
#endif
#endif /* PINCTRL_H */