diff options
author | Marek Vasut <marex@denx.de> | 2013-04-14 14:35:48 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-04-18 18:40:07 -0400 |
commit | 360e64d8bbe7c78784d769a60d152804f5079577 (patch) | |
tree | 44a1e15f1551d348a6492d997c310a114d78e943 /drivers/gpio/gpio-ucb1400.c | |
parent | 20fb277250816d6c3ff326552be0fea4173fd8ca (diff) |
mfd: ucb1400: Pass ucb1400-gpio data through ac97 bus
Cc: Jean Delvare <jdelvare@suse.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/gpio/gpio-ucb1400.c')
-rw-r--r-- | drivers/gpio/gpio-ucb1400.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/gpio/gpio-ucb1400.c b/drivers/gpio/gpio-ucb1400.c index 26405efe0f9f..6d0feb234d3c 100644 --- a/drivers/gpio/gpio-ucb1400.c +++ b/drivers/gpio/gpio-ucb1400.c | |||
@@ -12,8 +12,6 @@ | |||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/ucb1400.h> | 13 | #include <linux/ucb1400.h> |
14 | 14 | ||
15 | struct ucb1400_gpio_data *ucbdata; | ||
16 | |||
17 | static int ucb1400_gpio_dir_in(struct gpio_chip *gc, unsigned off) | 15 | static int ucb1400_gpio_dir_in(struct gpio_chip *gc, unsigned off) |
18 | { | 16 | { |
19 | struct ucb1400_gpio *gpio; | 17 | struct ucb1400_gpio *gpio; |
@@ -50,7 +48,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev) | |||
50 | struct ucb1400_gpio *ucb = dev->dev.platform_data; | 48 | struct ucb1400_gpio *ucb = dev->dev.platform_data; |
51 | int err = 0; | 49 | int err = 0; |
52 | 50 | ||
53 | if (!(ucbdata && ucbdata->gpio_offset)) { | 51 | if (!(ucb && ucb->gpio_offset)) { |
54 | err = -EINVAL; | 52 | err = -EINVAL; |
55 | goto err; | 53 | goto err; |
56 | } | 54 | } |
@@ -58,7 +56,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev) | |||
58 | platform_set_drvdata(dev, ucb); | 56 | platform_set_drvdata(dev, ucb); |
59 | 57 | ||
60 | ucb->gc.label = "ucb1400_gpio"; | 58 | ucb->gc.label = "ucb1400_gpio"; |
61 | ucb->gc.base = ucbdata->gpio_offset; | 59 | ucb->gc.base = ucb->gpio_offset; |
62 | ucb->gc.ngpio = 10; | 60 | ucb->gc.ngpio = 10; |
63 | ucb->gc.owner = THIS_MODULE; | 61 | ucb->gc.owner = THIS_MODULE; |
64 | 62 | ||
@@ -72,8 +70,8 @@ static int ucb1400_gpio_probe(struct platform_device *dev) | |||
72 | if (err) | 70 | if (err) |
73 | goto err; | 71 | goto err; |
74 | 72 | ||
75 | if (ucbdata && ucbdata->gpio_setup) | 73 | if (ucb && ucb->gpio_setup) |
76 | err = ucbdata->gpio_setup(&dev->dev, ucb->gc.ngpio); | 74 | err = ucb->gpio_setup(&dev->dev, ucb->gc.ngpio); |
77 | 75 | ||
78 | err: | 76 | err: |
79 | return err; | 77 | return err; |
@@ -85,8 +83,8 @@ static int ucb1400_gpio_remove(struct platform_device *dev) | |||
85 | int err = 0; | 83 | int err = 0; |
86 | struct ucb1400_gpio *ucb = platform_get_drvdata(dev); | 84 | struct ucb1400_gpio *ucb = platform_get_drvdata(dev); |
87 | 85 | ||
88 | if (ucbdata && ucbdata->gpio_teardown) { | 86 | if (ucb && ucb->gpio_teardown) { |
89 | err = ucbdata->gpio_teardown(&dev->dev, ucb->gc.ngpio); | 87 | err = ucb->gpio_teardown(&dev->dev, ucb->gc.ngpio); |
90 | if (err) | 88 | if (err) |
91 | return err; | 89 | return err; |
92 | } | 90 | } |
@@ -103,11 +101,6 @@ static struct platform_driver ucb1400_gpio_driver = { | |||
103 | }, | 101 | }, |
104 | }; | 102 | }; |
105 | 103 | ||
106 | void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data) | ||
107 | { | ||
108 | ucbdata = data; | ||
109 | } | ||
110 | |||
111 | module_platform_driver(ucb1400_gpio_driver); | 104 | module_platform_driver(ucb1400_gpio_driver); |
112 | 105 | ||
113 | MODULE_DESCRIPTION("Philips UCB1400 GPIO driver"); | 106 | MODULE_DESCRIPTION("Philips UCB1400 GPIO driver"); |