diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2012-12-15 17:50:43 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-01-24 19:24:20 -0500 |
commit | d4e62d0094e1b0f69946c3f16ce8ec882302a461 (patch) | |
tree | fd39f7a3ee241d0c8af31220143caebdafe45c7c /include | |
parent | e62ebcdbce9eff4dc48168e86960c0dfcba086ea (diff) |
sh-pfc: Split platform data from the sh_pfc structure
Create a sh_pfc_platform_data structure to store platform data and
reference it from the core sh_pfc structure.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sh_pfc.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h index c19a0925829a..58587f94d67a 100644 --- a/include/linux/sh_pfc.h +++ b/include/linux/sh_pfc.h | |||
@@ -94,7 +94,7 @@ struct pfc_window { | |||
94 | unsigned long size; | 94 | unsigned long size; |
95 | }; | 95 | }; |
96 | 96 | ||
97 | struct sh_pfc { | 97 | struct sh_pfc_platform_data { |
98 | char *name; | 98 | char *name; |
99 | pinmux_enum_t reserved_id; | 99 | pinmux_enum_t reserved_id; |
100 | struct pinmux_range data; | 100 | struct pinmux_range data; |
@@ -117,17 +117,21 @@ struct sh_pfc { | |||
117 | struct pinmux_irq *gpio_irq; | 117 | struct pinmux_irq *gpio_irq; |
118 | unsigned int gpio_irq_size; | 118 | unsigned int gpio_irq_size; |
119 | 119 | ||
120 | spinlock_t lock; | ||
121 | |||
122 | struct resource *resource; | 120 | struct resource *resource; |
123 | unsigned int num_resources; | 121 | unsigned int num_resources; |
124 | struct pfc_window *window; | ||
125 | 122 | ||
126 | unsigned long unlock_reg; | 123 | unsigned long unlock_reg; |
127 | }; | 124 | }; |
128 | 125 | ||
126 | struct sh_pfc { | ||
127 | struct sh_pfc_platform_data *pdata; | ||
128 | spinlock_t lock; | ||
129 | |||
130 | struct pfc_window *window; | ||
131 | }; | ||
132 | |||
129 | /* XXX compat for now */ | 133 | /* XXX compat for now */ |
130 | #define pinmux_info sh_pfc | 134 | #define pinmux_info sh_pfc_platform_data |
131 | 135 | ||
132 | /* drivers/sh/pfc/gpio.c */ | 136 | /* drivers/sh/pfc/gpio.c */ |
133 | int sh_pfc_register_gpiochip(struct sh_pfc *pfc); | 137 | int sh_pfc_register_gpiochip(struct sh_pfc *pfc); |
@@ -136,7 +140,7 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc); | |||
136 | int sh_pfc_register_pinctrl(struct sh_pfc *pfc); | 140 | int sh_pfc_register_pinctrl(struct sh_pfc *pfc); |
137 | 141 | ||
138 | /* drivers/sh/pfc/core.c */ | 142 | /* drivers/sh/pfc/core.c */ |
139 | int register_sh_pfc(struct sh_pfc *pfc); | 143 | int register_sh_pfc(struct sh_pfc_platform_data *pfc); |
140 | 144 | ||
141 | int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos); | 145 | int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos); |
142 | void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos, | 146 | void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos, |
@@ -151,8 +155,8 @@ int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type, | |||
151 | /* xxx */ | 155 | /* xxx */ |
152 | static inline int register_pinmux(struct pinmux_info *pip) | 156 | static inline int register_pinmux(struct pinmux_info *pip) |
153 | { | 157 | { |
154 | struct sh_pfc *pfc = pip; | 158 | struct sh_pfc_platform_data *pdata = pip; |
155 | return register_sh_pfc(pfc); | 159 | return register_sh_pfc(pdata); |
156 | } | 160 | } |
157 | 161 | ||
158 | enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE }; | 162 | enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE }; |