diff options
Diffstat (limited to 'drivers/pinctrl/pinctrl-nomadik.h')
-rw-r--r-- | drivers/pinctrl/pinctrl-nomadik.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.h b/drivers/pinctrl/pinctrl-nomadik.h index 5c99f1c62dfd..eef316e979a0 100644 --- a/drivers/pinctrl/pinctrl-nomadik.h +++ b/drivers/pinctrl/pinctrl-nomadik.h | |||
@@ -8,6 +8,78 @@ | |||
8 | #define PINCTRL_NMK_DB8500 1 | 8 | #define PINCTRL_NMK_DB8500 1 |
9 | #define PINCTRL_NMK_DB8540 2 | 9 | #define PINCTRL_NMK_DB8540 2 |
10 | 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 | |||
40 | /** | ||
41 | * enum prcm_gpiocr_reg_index | ||
42 | * Used to reference an PRCM GPIOCR register address. | ||
43 | */ | ||
44 | enum prcm_gpiocr_reg_index { | ||
45 | PRCM_IDX_GPIOCR1, | ||
46 | PRCM_IDX_GPIOCR2, | ||
47 | PRCM_IDX_GPIOCR3 | ||
48 | }; | ||
49 | /** | ||
50 | * enum prcm_gpiocr_altcx_index | ||
51 | * Used to reference an Other alternate-C function. | ||
52 | */ | ||
53 | enum prcm_gpiocr_altcx_index { | ||
54 | PRCM_IDX_GPIOCR_ALTC1, | ||
55 | PRCM_IDX_GPIOCR_ALTC2, | ||
56 | PRCM_IDX_GPIOCR_ALTC3, | ||
57 | PRCM_IDX_GPIOCR_ALTC4, | ||
58 | PRCM_IDX_GPIOCR_ALTC_MAX, | ||
59 | }; | ||
60 | |||
61 | /** | ||
62 | * struct prcm_gpio_altcx - Other alternate-C function | ||
63 | * @used: other alternate-C function availability | ||
64 | * @reg_index: PRCM GPIOCR register index used to control the function | ||
65 | * @control_bit: PRCM GPIOCR bit used to control the function | ||
66 | */ | ||
67 | struct prcm_gpiocr_altcx { | ||
68 | bool used:1; | ||
69 | u8 reg_index:2; | ||
70 | u8 control_bit:5; | ||
71 | } __packed; | ||
72 | |||
73 | /** | ||
74 | * struct prcm_gpio_altcx_pin_desc - Other alternate-C pin | ||
75 | * @pin: The pin number | ||
76 | * @altcx: array of other alternate-C[1-4] functions | ||
77 | */ | ||
78 | struct prcm_gpiocr_altcx_pin_desc { | ||
79 | unsigned short pin; | ||
80 | struct prcm_gpiocr_altcx altcx[PRCM_IDX_GPIOCR_ALTC_MAX]; | ||
81 | }; | ||
82 | |||
11 | /** | 83 | /** |
12 | * struct nmk_function - Nomadik pinctrl mux function | 84 | * struct nmk_function - Nomadik pinctrl mux function |
13 | * @name: The name of the function, exported to pinctrl core. | 85 | * @name: The name of the function, exported to pinctrl core. |
@@ -50,6 +122,9 @@ struct nmk_pingroup { | |||
50 | * @nfunction: The number of entries in @functions. | 122 | * @nfunction: The number of entries in @functions. |
51 | * @groups: An array describing all pin groups the pin SoC supports. | 123 | * @groups: An array describing all pin groups the pin SoC supports. |
52 | * @ngroups: The number of entries in @groups. | 124 | * @ngroups: The number of entries in @groups. |
125 | * @altcx_pins: The pins that support Other alternate-C function on this SoC | ||
126 | * @npins_altcx: The number of Other alternate-C pins | ||
127 | * @prcm_gpiocr_registers: The array of PRCM GPIOCR registers on this SoC | ||
53 | */ | 128 | */ |
54 | struct nmk_pinctrl_soc_data { | 129 | struct nmk_pinctrl_soc_data { |
55 | struct pinctrl_gpio_range *gpio_ranges; | 130 | struct pinctrl_gpio_range *gpio_ranges; |
@@ -60,6 +135,9 @@ struct nmk_pinctrl_soc_data { | |||
60 | unsigned nfunctions; | 135 | unsigned nfunctions; |
61 | const struct nmk_pingroup *groups; | 136 | const struct nmk_pingroup *groups; |
62 | unsigned ngroups; | 137 | unsigned ngroups; |
138 | const struct prcm_gpiocr_altcx_pin_desc *altcx_pins; | ||
139 | unsigned npins_altcx; | ||
140 | const u16 *prcm_gpiocr_registers; | ||
63 | }; | 141 | }; |
64 | 142 | ||
65 | #ifdef CONFIG_PINCTRL_STN8815 | 143 | #ifdef CONFIG_PINCTRL_STN8815 |