summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/pinctrl-imx233.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-16 19:18:56 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-17 00:29:24 +0200
commit918a06a12ad633a29634f3249990ba04ce9fb00b (patch)
treeecaa391890d391626a5cf849d08001391926b772 /firmware/target/arm/imx233/pinctrl-imx233.h
parentabb7d1dcfe204da217a67235811ebb278dc8fbe1 (diff)
downloadrockbox-918a06a12ad633a29634f3249990ba04ce9fb00b.tar.gz
rockbox-918a06a12ad633a29634f3249990ba04ce9fb00b.zip
imx233: normalise pinctrl names
The current pinctrl functions were a mess. Normalise the functions names to make them shorter and clearer. Change-Id: Iac6ff84625ef2b7610268e3a5802dc0088de3167
Diffstat (limited to 'firmware/target/arm/imx233/pinctrl-imx233.h')
-rw-r--r--firmware/target/arm/imx233/pinctrl-imx233.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/firmware/target/arm/imx233/pinctrl-imx233.h b/firmware/target/arm/imx233/pinctrl-imx233.h
index 82ed47d57e..c731490e38 100644
--- a/firmware/target/arm/imx233/pinctrl-imx233.h
+++ b/firmware/target/arm/imx233/pinctrl-imx233.h
@@ -41,17 +41,17 @@
41#define PINCTRL_DRIVE_16mA 3 /* not available on all pins */ 41#define PINCTRL_DRIVE_16mA 3 /* not available on all pins */
42 42
43#ifdef IMX233_PINCTRL_DEBUG 43#ifdef IMX233_PINCTRL_DEBUG
44void imx233_pinctrl_acquire_pin(unsigned bank, unsigned pin, const char *name); 44void imx233_pinctrl_acquire(unsigned bank, unsigned pin, const char *name);
45void imx233_pinctrl_acquire_pin_mask(unsigned bank, uint32_t mask, const char *name); 45void imx233_pinctrl_acquire_mask(unsigned bank, uint32_t mask, const char *name);
46void imx233_pinctrl_release_pin(unsigned bank, unsigned pin, const char *name); 46void imx233_pinctrl_release(unsigned bank, unsigned pin, const char *name);
47void imx233_pinctrl_release_pin_mask(unsigned bank, uint32_t mask, const char *name); 47void imx233_pinctrl_release_mask(unsigned bank, uint32_t mask, const char *name);
48const char *imx233_pinctrl_get_pin_use(unsigned bank, unsigned pin); 48const char *imx233_pinctrl_blame(unsigned bank, unsigned pin);
49#else 49#else
50#define imx233_pinctrl_acquire_pin(...) 50#define imx233_pinctrl_acquire(...)
51#define imx233_pinctrl_acquire_pin_mask(...) 51#define imx233_pinctrl_acquire_mask(...)
52#define imx233_pinctrl_release_pin(...) 52#define imx233_pinctrl_release(...)
53#define imx233_pinctrl_release_pin_mask(...) 53#define imx233_pinctrl_release_mask(...)
54#define imx233_pinctrl_get_pin_use(...) NULL 54#define imx233_pinctrl_blame(...) NULL
55#endif 55#endif
56 56
57typedef void (*pin_irq_cb_t)(int bank, int pin); 57typedef void (*pin_irq_cb_t)(int bank, int pin);
@@ -61,13 +61,13 @@ static inline void imx233_pinctrl_init(void)
61 HW_PINCTRL_CTRL_CLR = BM_OR2(PINCTRL_CTRL, CLKGATE, SFTRST); 61 HW_PINCTRL_CTRL_CLR = BM_OR2(PINCTRL_CTRL, CLKGATE, SFTRST);
62} 62}
63 63
64static inline void imx233_set_pin_drive_strength(unsigned bank, unsigned pin, unsigned strength) 64static inline void imx233_pinctrl_set_drive(unsigned bank, unsigned pin, unsigned strength)
65{ 65{
66 HW_PINCTRL_DRIVEn_CLR(4 * bank + pin / 8) = 3 << (4 * (pin % 8)); 66 HW_PINCTRL_DRIVEn_CLR(4 * bank + pin / 8) = 3 << (4 * (pin % 8));
67 HW_PINCTRL_DRIVEn_SET(4 * bank + pin / 8) = strength << (4 * (pin % 8)); 67 HW_PINCTRL_DRIVEn_SET(4 * bank + pin / 8) = strength << (4 * (pin % 8));
68} 68}
69 69
70static inline void imx233_enable_gpio_output(unsigned bank, unsigned pin, bool enable) 70static inline void imx233_pinctrl_enable_gpio(unsigned bank, unsigned pin, bool enable)
71{ 71{
72 if(enable) 72 if(enable)
73 HW_PINCTRL_DOEn_SET(bank) = 1 << pin; 73 HW_PINCTRL_DOEn_SET(bank) = 1 << pin;
@@ -75,7 +75,7 @@ static inline void imx233_enable_gpio_output(unsigned bank, unsigned pin, bool e
75 HW_PINCTRL_DOEn_CLR(bank) = 1 << pin; 75 HW_PINCTRL_DOEn_CLR(bank) = 1 << pin;
76} 76}
77 77
78static inline void imx233_enable_gpio_output_mask(unsigned bank, uint32_t pin_mask, bool enable) 78static inline void imx233_pinctrl_enable_gpio_mask(unsigned bank, uint32_t pin_mask, bool enable)
79{ 79{
80 if(enable) 80 if(enable)
81 HW_PINCTRL_DOEn_SET(bank) = pin_mask; 81 HW_PINCTRL_DOEn_SET(bank) = pin_mask;
@@ -83,7 +83,7 @@ static inline void imx233_enable_gpio_output_mask(unsigned bank, uint32_t pin_ma
83 HW_PINCTRL_DOEn_CLR(bank) = pin_mask; 83 HW_PINCTRL_DOEn_CLR(bank) = pin_mask;
84} 84}
85 85
86static inline void imx233_set_gpio_output(unsigned bank, unsigned pin, bool value) 86static inline void imx233_pinctrl_set_gpio(unsigned bank, unsigned pin, bool value)
87{ 87{
88 if(value) 88 if(value)
89 HW_PINCTRL_DOUTn_SET(bank) = 1 << pin; 89 HW_PINCTRL_DOUTn_SET(bank) = 1 << pin;
@@ -91,7 +91,7 @@ static inline void imx233_set_gpio_output(unsigned bank, unsigned pin, bool valu
91 HW_PINCTRL_DOUTn_CLR(bank) = 1 << pin; 91 HW_PINCTRL_DOUTn_CLR(bank) = 1 << pin;
92} 92}
93 93
94static inline void imx233_set_gpio_output_mask(unsigned bank, uint32_t pin_mask, bool value) 94static inline void imx233_pinctrl_set_gpio_mask(unsigned bank, uint32_t pin_mask, bool value)
95{ 95{
96 if(value) 96 if(value)
97 HW_PINCTRL_DOUTn_SET(bank) = pin_mask; 97 HW_PINCTRL_DOUTn_SET(bank) = pin_mask;
@@ -99,18 +99,18 @@ static inline void imx233_set_gpio_output_mask(unsigned bank, uint32_t pin_mask,
99 HW_PINCTRL_DOUTn_CLR(bank) = pin_mask; 99 HW_PINCTRL_DOUTn_CLR(bank) = pin_mask;
100} 100}
101 101
102static inline uint32_t imx233_get_gpio_input_mask(unsigned bank, uint32_t pin_mask) 102static inline uint32_t imx233_pinctrl_get_gpio_mask(unsigned bank, uint32_t pin_mask)
103{ 103{
104 return HW_PINCTRL_DINn(bank) & pin_mask; 104 return HW_PINCTRL_DINn(bank) & pin_mask;
105} 105}
106 106
107static inline void imx233_set_pin_function(unsigned bank, unsigned pin, unsigned function) 107static inline void imx233_pinctrl_set_function(unsigned bank, unsigned pin, unsigned function)
108{ 108{
109 HW_PINCTRL_MUXSELn_CLR(2 * bank + pin / 16) = 3 << (2 * (pin % 16)); 109 HW_PINCTRL_MUXSELn_CLR(2 * bank + pin / 16) = 3 << (2 * (pin % 16));
110 HW_PINCTRL_MUXSELn_SET(2 * bank + pin / 16) = function << (2 * (pin % 16)); 110 HW_PINCTRL_MUXSELn_SET(2 * bank + pin / 16) = function << (2 * (pin % 16));
111} 111}
112 112
113static inline void imx233_enable_pin_pullup(unsigned bank, unsigned pin, bool enable) 113static inline void imx233_pinctrl_enable_pullup(unsigned bank, unsigned pin, bool enable)
114{ 114{
115 if(enable) 115 if(enable)
116 HW_PINCTRL_PULLn_SET(bank) = 1 << pin; 116 HW_PINCTRL_PULLn_SET(bank) = 1 << pin;
@@ -118,7 +118,7 @@ static inline void imx233_enable_pin_pullup(unsigned bank, unsigned pin, bool en
118 HW_PINCTRL_PULLn_CLR(bank) = 1 << pin; 118 HW_PINCTRL_PULLn_CLR(bank) = 1 << pin;
119} 119}
120 120
121static inline void imx233_enable_pin_pullup_mask(unsigned bank, uint32_t pin_msk, bool enable) 121static inline void imx233_pinctrl_enable_pullup_mask(unsigned bank, uint32_t pin_msk, bool enable)
122{ 122{
123 if(enable) 123 if(enable)
124 HW_PINCTRL_PULLn_SET(bank) = pin_msk; 124 HW_PINCTRL_PULLn_SET(bank) = pin_msk;
@@ -128,7 +128,7 @@ static inline void imx233_enable_pin_pullup_mask(unsigned bank, uint32_t pin_msk
128 128
129/** On irq, the pin irq interrupt is disable and then cb is called; 129/** On irq, the pin irq interrupt is disable and then cb is called;
130 * the setup_pin_irq function needs to be called again to enable it again */ 130 * the setup_pin_irq function needs to be called again to enable it again */
131void imx233_setup_pin_irq(int bank, int pin, bool enable_int, 131void imx233_pinctrl_setup_irq(int bank, int pin, bool enable_int,
132 bool level, bool polarity, pin_irq_cb_t cb); 132 bool level, bool polarity, pin_irq_cb_t cb);
133 133
134#endif /* __PINCTRL_IMX233_H__ */ 134#endif /* __PINCTRL_IMX233_H__ */