Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pinctrl-nomadik.h
Go to the documentation of this file.
1 #ifndef PINCTRL_PINCTRL_NOMADIK_H
2 #define PINCTRL_PINCTRL_NOMADIK_H
3 
4 #include <plat/gpio-nomadik.h>
5 
6 /* Package definitions */
7 #define PINCTRL_NMK_STN8815 0
8 #define PINCTRL_NMK_DB8500 1
9 #define PINCTRL_NMK_DB8540 2
10 
11 #define PRCM_GPIOCR_ALTCX(pin_num,\
12  altc1_used, altc1_ri, altc1_cb,\
13  altc2_used, altc2_ri, altc2_cb,\
14  altc3_used, altc3_ri, altc3_cb,\
15  altc4_used, altc4_ri, altc4_cb)\
16 {\
17  .pin = pin_num,\
18  .altcx[PRCM_IDX_GPIOCR_ALTC1] = {\
19  .used = altc1_used,\
20  .reg_index = altc1_ri,\
21  .control_bit = altc1_cb\
22  },\
23  .altcx[PRCM_IDX_GPIOCR_ALTC2] = {\
24  .used = altc2_used,\
25  .reg_index = altc2_ri,\
26  .control_bit = altc2_cb\
27  },\
28  .altcx[PRCM_IDX_GPIOCR_ALTC3] = {\
29  .used = altc3_used,\
30  .reg_index = altc3_ri,\
31  .control_bit = altc3_cb\
32  },\
33  .altcx[PRCM_IDX_GPIOCR_ALTC4] = {\
34  .used = altc4_used,\
35  .reg_index = altc4_ri,\
36  .control_bit = altc4_cb\
37  },\
38 }
39 
48 };
59 };
60 
68  bool used:1;
71 } __packed;
72 
79  unsigned short pin;
81 };
82 
89 struct nmk_function {
90  const char *name;
91  const char * const *groups;
92  unsigned ngroups;
93 };
94 
105 struct nmk_pingroup {
106  const char *name;
107  const unsigned int *pins;
108  const unsigned npins;
110 };
111 
130  struct pinctrl_gpio_range *gpio_ranges;
131  unsigned gpio_num_ranges;
132  const struct pinctrl_pin_desc *pins;
133  unsigned npins;
134  const struct nmk_function *functions;
135  unsigned nfunctions;
136  const struct nmk_pingroup *groups;
137  unsigned ngroups;
139  unsigned npins_altcx;
141 };
142 
143 #ifdef CONFIG_PINCTRL_STN8815
144 
145 void nmk_pinctrl_stn8815_init(const struct nmk_pinctrl_soc_data **soc);
146 
147 #else
148 
149 static inline void
151 {
152 }
153 
154 #endif
155 
156 #ifdef CONFIG_PINCTRL_DB8500
157 
158 void nmk_pinctrl_db8500_init(const struct nmk_pinctrl_soc_data **soc);
159 
160 #else
161 
162 static inline void
164 {
165 }
166 
167 #endif
168 
169 #ifdef CONFIG_PINCTRL_DB8540
170 
171 void nmk_pinctrl_db8540_init(const struct nmk_pinctrl_soc_data **soc);
172 
173 #else
174 
175 static inline void
177 {
178 }
179 
180 #endif
181 
182 #endif /* PINCTRL_PINCTRL_NOMADIK_H */