mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
mfd: ucb1400: Pass ucb1400-gpio data through ac97 bus
Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Grant Likely <[email protected]> Acked-by: Linus Walleij <[email protected]> Reviewed-by: Mark Brown <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
parent
20fb277250
commit
360e64d8bb
3 changed files with 17 additions and 25 deletions
|
|
@ -12,8 +12,6 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/ucb1400.h>
|
||||
|
||||
struct ucb1400_gpio_data *ucbdata;
|
||||
|
||||
static int ucb1400_gpio_dir_in(struct gpio_chip *gc, unsigned off)
|
||||
{
|
||||
struct ucb1400_gpio *gpio;
|
||||
|
|
@ -50,7 +48,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
|
|||
struct ucb1400_gpio *ucb = dev->dev.platform_data;
|
||||
int err = 0;
|
||||
|
||||
if (!(ucbdata && ucbdata->gpio_offset)) {
|
||||
if (!(ucb && ucb->gpio_offset)) {
|
||||
err = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
|
@ -58,7 +56,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
|
|||
platform_set_drvdata(dev, ucb);
|
||||
|
||||
ucb->gc.label = "ucb1400_gpio";
|
||||
ucb->gc.base = ucbdata->gpio_offset;
|
||||
ucb->gc.base = ucb->gpio_offset;
|
||||
ucb->gc.ngpio = 10;
|
||||
ucb->gc.owner = THIS_MODULE;
|
||||
|
||||
|
|
@ -72,8 +70,8 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
|
|||
if (err)
|
||||
goto err;
|
||||
|
||||
if (ucbdata && ucbdata->gpio_setup)
|
||||
err = ucbdata->gpio_setup(&dev->dev, ucb->gc.ngpio);
|
||||
if (ucb && ucb->gpio_setup)
|
||||
err = ucb->gpio_setup(&dev->dev, ucb->gc.ngpio);
|
||||
|
||||
err:
|
||||
return err;
|
||||
|
|
@ -85,8 +83,8 @@ static int ucb1400_gpio_remove(struct platform_device *dev)
|
|||
int err = 0;
|
||||
struct ucb1400_gpio *ucb = platform_get_drvdata(dev);
|
||||
|
||||
if (ucbdata && ucbdata->gpio_teardown) {
|
||||
err = ucbdata->gpio_teardown(&dev->dev, ucb->gc.ngpio);
|
||||
if (ucb && ucb->gpio_teardown) {
|
||||
err = ucb->gpio_teardown(&dev->dev, ucb->gc.ngpio);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
|
@ -103,11 +101,6 @@ static struct platform_driver ucb1400_gpio_driver = {
|
|||
},
|
||||
};
|
||||
|
||||
void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data)
|
||||
{
|
||||
ucbdata = data;
|
||||
}
|
||||
|
||||
module_platform_driver(ucb1400_gpio_driver);
|
||||
|
||||
MODULE_DESCRIPTION("Philips UCB1400 GPIO driver");
|
||||
|
|
|
|||
Loading…
Reference in a new issue