diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2012-05-10 00:08:03 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2012-05-10 00:13:11 +0200 |
commit | 645680d62b82455d24fcb178f1cc5208f9942e38 (patch) | |
tree | 1a9f928afc34260059bf986fc2caa7fc5b2a2028 /firmware/target/arm/imx233/pinctrl-imx233.h | |
parent | d29a11b7a8f4ce230e9385a44f352a559bde753f (diff) | |
download | rockbox-645680d62b82455d24fcb178f1cc5208f9942e38.tar.gz rockbox-645680d62b82455d24fcb178f1cc5208f9942e38.zip |
imx233: add pinctrl debug code to track pin uses
Past development has proved that one can mistakely use
the same pin for two uses without noticing. Since this
causes extremely hard to find bugs, the infrastructure
will allow to register pin uses and panic when a conflict
is detected. The pinctrl debug now shows the pin uses
when its support is compiled in.
Change-Id: Idb2d5235ce09207d77aa474d6f158e72b933761a
Diffstat (limited to 'firmware/target/arm/imx233/pinctrl-imx233.h')
-rw-r--r-- | firmware/target/arm/imx233/pinctrl-imx233.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/pinctrl-imx233.h b/firmware/target/arm/imx233/pinctrl-imx233.h index ec23410442..5b4b9c4cd5 100644 --- a/firmware/target/arm/imx233/pinctrl-imx233.h +++ b/firmware/target/arm/imx233/pinctrl-imx233.h | |||
@@ -23,7 +23,10 @@ | |||
23 | #ifndef __PINCTRL_IMX233_H__ | 23 | #ifndef __PINCTRL_IMX233_H__ |
24 | #define __PINCTRL_IMX233_H__ | 24 | #define __PINCTRL_IMX233_H__ |
25 | 25 | ||
26 | #include "cpu.h" | 26 | #include "config.h" |
27 | |||
28 | // set to debug pinctrl use | ||
29 | #define IMX233_PINCTRL_DEBUG | ||
27 | 30 | ||
28 | #define HW_PINCTRL_BASE 0x80018000 | 31 | #define HW_PINCTRL_BASE 0x80018000 |
29 | 32 | ||
@@ -51,6 +54,20 @@ | |||
51 | #define PINCTRL_DRIVE_12mA 2 | 54 | #define PINCTRL_DRIVE_12mA 2 |
52 | #define PINCTRL_DRIVE_16mA 3 /* not available on all pins */ | 55 | #define PINCTRL_DRIVE_16mA 3 /* not available on all pins */ |
53 | 56 | ||
57 | #ifdef IMX233_PINCTRL_DEBUG | ||
58 | void imx233_pinctrl_acquire_pin(unsigned bank, unsigned pin, const char *name); | ||
59 | void imx233_pinctrl_acquire_pin_mask(unsigned bank, uint32_t mask, const char *name); | ||
60 | void imx233_pinctrl_release_pin(unsigned bank, unsigned pin, const char *name); | ||
61 | void imx233_pinctrl_release_pin_mask(unsigned bank, uint32_t mask, const char *name); | ||
62 | const char *imx233_pinctrl_get_pin_use(unsigned bank, unsigned pin); | ||
63 | #else | ||
64 | #define imx233_pinctrl_acquire_pin(...) | ||
65 | #define imx233_pinctrl_acquire_pin_mask(...) | ||
66 | #define imx233_pinctrl_release_pin(...) | ||
67 | #define imx233_pinctrl_release_pin_mask(...) | ||
68 | #define imx233_pinctrl_get_pin_use(...) NULL | ||
69 | #endif | ||
70 | |||
54 | typedef void (*pin_irq_cb_t)(int bank, int pin); | 71 | typedef void (*pin_irq_cb_t)(int bank, int pin); |
55 | 72 | ||
56 | static inline void imx233_pinctrl_init(void) | 73 | static inline void imx233_pinctrl_init(void) |