aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sh-pfc/sh_pfc.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-07-15 07:03:20 -0400
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-07-29 09:17:41 -0400
commit533743dccb517b0331eccc111e3c2b8f021559b5 (patch)
tree8683492a077fdc9e4629a14b3a596ecce3147112 /drivers/pinctrl/sh-pfc/sh_pfc.h
parenta1a3580cb322f71cc5aa7e9180ffb6df609b530d (diff)
sh-pfc: Replace pinmux_enum_id typedef with u16
The typedef only conceals the real variable type without bringing any additional value (see Documentation/CodingStyle, section 5.b). Moreover, it polutes the pinmux namespace. Replace it with the integer type it used to hide. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Diffstat (limited to 'drivers/pinctrl/sh-pfc/sh_pfc.h')
-rw-r--r--drivers/pinctrl/sh-pfc/sh_pfc.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index 363ea8cb3be6..7ad1b040e4d7 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -14,8 +14,6 @@
14#include <linux/bug.h> 14#include <linux/bug.h>
15#include <linux/stringify.h> 15#include <linux/stringify.h>
16 16
17typedef unsigned short pinmux_enum_t;
18
19enum { 17enum {
20 PINMUX_TYPE_NONE, 18 PINMUX_TYPE_NONE,
21 PINMUX_TYPE_FUNCTION, 19 PINMUX_TYPE_FUNCTION,
@@ -30,7 +28,7 @@ enum {
30#define SH_PFC_PIN_CFG_PULL_DOWN (1 << 3) 28#define SH_PFC_PIN_CFG_PULL_DOWN (1 << 3)
31 29
32struct sh_pfc_pin { 30struct sh_pfc_pin {
33 pinmux_enum_t enum_id; 31 u16 enum_id;
34 const char *name; 32 const char *name;
35 unsigned int configs; 33 unsigned int configs;
36}; 34};
@@ -64,7 +62,7 @@ struct sh_pfc_function {
64}; 62};
65 63
66struct pinmux_func { 64struct pinmux_func {
67 pinmux_enum_t enum_id; 65 u16 enum_id;
68 const char *name; 66 const char *name;
69}; 67};
70 68
@@ -83,27 +81,27 @@ struct pinmux_func {
83 81
84struct pinmux_cfg_reg { 82struct pinmux_cfg_reg {
85 unsigned long reg, reg_width, field_width; 83 unsigned long reg, reg_width, field_width;
86 const pinmux_enum_t *enum_ids; 84 const u16 *enum_ids;
87 const unsigned long *var_field_width; 85 const unsigned long *var_field_width;
88}; 86};
89 87
90#define PINMUX_CFG_REG(name, r, r_width, f_width) \ 88#define PINMUX_CFG_REG(name, r, r_width, f_width) \
91 .reg = r, .reg_width = r_width, .field_width = f_width, \ 89 .reg = r, .reg_width = r_width, .field_width = f_width, \
92 .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)]) 90 .enum_ids = (u16 [(r_width / f_width) * (1 << f_width)])
93 91
94#define PINMUX_CFG_REG_VAR(name, r, r_width, var_fw0, var_fwn...) \ 92#define PINMUX_CFG_REG_VAR(name, r, r_width, var_fw0, var_fwn...) \
95 .reg = r, .reg_width = r_width, \ 93 .reg = r, .reg_width = r_width, \
96 .var_field_width = (unsigned long [r_width]) { var_fw0, var_fwn, 0 }, \ 94 .var_field_width = (unsigned long [r_width]) { var_fw0, var_fwn, 0 }, \
97 .enum_ids = (pinmux_enum_t []) 95 .enum_ids = (u16 [])
98 96
99struct pinmux_data_reg { 97struct pinmux_data_reg {
100 unsigned long reg, reg_width; 98 unsigned long reg, reg_width;
101 const pinmux_enum_t *enum_ids; 99 const u16 *enum_ids;
102}; 100};
103 101
104#define PINMUX_DATA_REG(name, r, r_width) \ 102#define PINMUX_DATA_REG(name, r, r_width) \
105 .reg = r, .reg_width = r_width, \ 103 .reg = r, .reg_width = r_width, \
106 .enum_ids = (pinmux_enum_t [r_width]) \ 104 .enum_ids = (u16 [r_width]) \
107 105
108struct pinmux_irq { 106struct pinmux_irq {
109 int irq; 107 int irq;
@@ -114,9 +112,9 @@ struct pinmux_irq {
114 { .irq = irq_nr, .gpios = (unsigned short []) { ids, 0 } } \ 112 { .irq = irq_nr, .gpios = (unsigned short []) { ids, 0 } } \
115 113
116struct pinmux_range { 114struct pinmux_range {
117 pinmux_enum_t begin; 115 u16 begin;
118 pinmux_enum_t end; 116 u16 end;
119 pinmux_enum_t force; 117 u16 force;
120}; 118};
121 119
122struct sh_pfc; 120struct sh_pfc;
@@ -152,7 +150,7 @@ struct sh_pfc_soc_info {
152 const struct pinmux_cfg_reg *cfg_regs; 150 const struct pinmux_cfg_reg *cfg_regs;
153 const struct pinmux_data_reg *data_regs; 151 const struct pinmux_data_reg *data_regs;
154 152
155 const pinmux_enum_t *gpio_data; 153 const u16 *gpio_data;
156 unsigned int gpio_data_size; 154 unsigned int gpio_data_size;
157 155
158 const struct pinmux_irq *gpio_irq; 156 const struct pinmux_irq *gpio_irq;
@@ -199,7 +197,7 @@ struct sh_pfc_soc_info {
199#define PORT_ALL(str) CPU_ALL_PORT(_PORT_ALL, PORT, str) 197#define PORT_ALL(str) CPU_ALL_PORT(_PORT_ALL, PORT, str)
200#define GPIO_FN(str) PINMUX_GPIO_FN(GPIO_FN_##str, PINMUX_FN_BASE, str##_MARK) 198#define GPIO_FN(str) PINMUX_GPIO_FN(GPIO_FN_##str, PINMUX_FN_BASE, str##_MARK)
201 199
202/* helper macro for pinmux_enum_t */ 200/* helper macro for pinmux data arrays */
203#define PORT_DATA_IO(nr) \ 201#define PORT_DATA_IO(nr) \
204 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \ 202 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
205 PORT##nr##_IN) 203 PORT##nr##_IN)