summaryrefslogtreecommitdiff
path: root/include/dm/pinctrl.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-22 02:43:26 (GMT)
committerSimon Glass <sjg@chromium.org>2016-01-22 03:42:34 (GMT)
commit52db39a22b0544446e630c853292bfa255a21e24 (patch)
treecc1360edc2d0167bd3262493f01976e7365d9850 /include/dm/pinctrl.h
parent0379597e55c17519be36fdf357d4463279da5aca (diff)
downloadu-boot-fsl-qoriq-52db39a22b0544446e630c853292bfa255a21e24.tar.xz
dm: pinctrl: Add a function to parse PIN_CONFIG flags
Add a function which produces a flags word from a few common PIN_CONFIG settings. This is useful for simple pinctrl drivers that don't need to worry about drive strength, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/pinctrl.h')
-rw-r--r--include/dm/pinctrl.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h
index f6025f6..5cd4503 100644
--- a/include/dm/pinctrl.h
+++ b/include/dm/pinctrl.h
@@ -284,4 +284,17 @@ int pinctrl_request_noflags(struct udevice *dev, int func);
*/
int pinctrl_get_periph_id(struct udevice *dev, struct udevice *periph);
+/**
+ * pinctrl_decode_pin_config() - decode pin configuration flags
+ *
+ * This decodes some of the PIN_CONFIG values into flags, with each value
+ * being (1 << pin_cfg). This does not support things with values like the
+ * slew rate.
+ *
+ * @blob: Device tree blob
+ * @node: Node containing the PIN_CONFIG values
+ * @return decoded flag value, or -ve on error
+ */
+int pinctrl_decode_pin_config(const void *blob, int node);
+
#endif /* __PINCTRL_H */