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>
This commit is contained in:
Laurent Pinchart
2012-12-15 23:50:43 +01:00
committed by Simon Horman
parent e62ebcdbce
commit d4e62d0094
4 changed files with 80 additions and 77 deletions
+12 -8
View File
@@ -94,7 +94,7 @@ struct pfc_window {
unsigned long size;
};
struct sh_pfc {
struct sh_pfc_platform_data {
char *name;
pinmux_enum_t reserved_id;
struct pinmux_range data;
@@ -117,17 +117,21 @@ struct sh_pfc {
struct pinmux_irq *gpio_irq;
unsigned int gpio_irq_size;
spinlock_t lock;
struct resource *resource;
unsigned int num_resources;
struct pfc_window *window;
unsigned long unlock_reg;
};
struct sh_pfc {
struct sh_pfc_platform_data *pdata;
spinlock_t lock;
struct pfc_window *window;
};
/* XXX compat for now */
#define pinmux_info sh_pfc
#define pinmux_info sh_pfc_platform_data
/* drivers/sh/pfc/gpio.c */
int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
@@ -136,7 +140,7 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
/* drivers/sh/pfc/core.c */
int register_sh_pfc(struct sh_pfc *pfc);
int register_sh_pfc(struct sh_pfc_platform_data *pfc);
int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos);
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,
/* xxx */
static inline int register_pinmux(struct pinmux_info *pip)
{
struct sh_pfc *pfc = pip;
return register_sh_pfc(pfc);
struct sh_pfc_platform_data *pdata = pip;
return register_sh_pfc(pdata);
}
enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE };