summaryrefslogtreecommitdiff
path: root/include/dm/pinctrl.h
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2018-10-24 14:10:13 +0200
committerTom Rini <trini@konsulko.com>2018-11-16 16:51:55 -0500
commitf55a0c0a20cad56440ebe9a9b2999f21ae00f61a (patch)
treee5553e7659fb952f9ffabc140b007e215b58ab8e /include/dm/pinctrl.h
parentf9c87adc47a84fbe44f580ffa5fd2540ce7793b2 (diff)
downloadu-boot-f55a0c0a20cad56440ebe9a9b2999f21ae00f61a.tar.gz
u-boot-f55a0c0a20cad56440ebe9a9b2999f21ae00f61a.tar.bz2
u-boot-f55a0c0a20cad56440ebe9a9b2999f21ae00f61a.zip
dm: pinctrl: Add get_pin_muxing() ops
Add get_pin_muxing() which allows to display the muxing of a given pin belonging to a pin-controller. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/pinctrl.h')
-rw-r--r--include/dm/pinctrl.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h
index 80de3f3fed..e88438d6a5 100644
--- a/include/dm/pinctrl.h
+++ b/include/dm/pinctrl.h
@@ -66,6 +66,7 @@ struct pinconf_param {
* pointing a config node. (necessary for pinctrl_full)
* @set_state_simple: do needed pinctrl operations for a peripherl @periph.
* (necessary for pinctrl_simple)
+ * @get_pin_muxing: display the muxing of a given pin.
*/
struct pinctrl_ops {
int (*get_pins_count)(struct udevice *dev);
@@ -129,6 +130,24 @@ struct pinctrl_ops {
* @return mux value (SoC-specific, e.g. 0 for input, 1 for output)
*/
int (*get_gpio_mux)(struct udevice *dev, int banknum, int index);
+
+ /**
+ * get_pin_muxing() - show pin muxing
+ *
+ * This allows to display the muxing of a given pin. It's useful for
+ * debug purpose to know if a pin is configured as GPIO or as an
+ * alternate function and which one.
+ * Typically it is used by a PINCTRL driver with knowledge of the SoC
+ * pinctrl setup.
+ *
+ * @dev: Pinctrl device to use
+ * @selector: Pin selector
+ * @buf Pin's muxing description
+ * @size Pin's muxing description length
+ * return 0 if OK, -ve on error
+ */
+ int (*get_pin_muxing)(struct udevice *dev, unsigned int selector,
+ char *buf, int size);
};
#define pinctrl_get_ops(dev) ((struct pinctrl_ops *)(dev)->driver->ops)
@@ -348,4 +367,19 @@ int pinctrl_decode_pin_config(const void *blob, int node);
*/
int pinctrl_get_gpio_mux(struct udevice *dev, int banknum, int index);
+/**
+ * pinctrl_get_pin_muxing() - Returns the muxing description
+ *
+ * This allows to display the muxing description of the given pin for
+ * debug purpose
+ *
+ * @dev: Pinctrl device to use
+ * @selector Pin index within pin-controller
+ * @buf Pin's muxing description
+ * @size Pin's muxing description length
+ * @return 0 if OK, -ve on error
+ */
+int pinctrl_get_pin_muxing(struct udevice *dev, int selector, char *buf,
+ int size);
+
#endif /* __PINCTRL_H */