diff options
| author | Rabin Vincent <rabin.vincent@stericsson.com> | 2010-09-13 08:04:02 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-09-19 07:12:28 -0400 |
| commit | f0a7a98d1d400e2a5fd9a63ed56d30d30f2864cb (patch) | |
| tree | 7b2b073ced77c27eed9a5817d648f42d83b000b5 | |
| parent | f066439cfc37d498a06de76fcab8c21d4094ca64 (diff) | |
ARM: 6373/1: tc35892-gpio: add setup/remove callbacks
For board-specific initialization.
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | drivers/gpio/tc35892-gpio.c | 8 | ||||
| -rw-r--r-- | include/linux/mfd/tc35892.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpio/tc35892-gpio.c b/drivers/gpio/tc35892-gpio.c index 1be6288780de..7e10c935a047 100644 --- a/drivers/gpio/tc35892-gpio.c +++ b/drivers/gpio/tc35892-gpio.c | |||
| @@ -322,6 +322,9 @@ static int __devinit tc35892_gpio_probe(struct platform_device *pdev) | |||
| 322 | goto out_freeirq; | 322 | goto out_freeirq; |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | if (pdata->setup) | ||
| 326 | pdata->setup(tc35892, tc35892_gpio->chip.base); | ||
| 327 | |||
| 325 | platform_set_drvdata(pdev, tc35892_gpio); | 328 | platform_set_drvdata(pdev, tc35892_gpio); |
| 326 | 329 | ||
| 327 | return 0; | 330 | return 0; |
| @@ -338,9 +341,14 @@ out_free: | |||
| 338 | static int __devexit tc35892_gpio_remove(struct platform_device *pdev) | 341 | static int __devexit tc35892_gpio_remove(struct platform_device *pdev) |
| 339 | { | 342 | { |
| 340 | struct tc35892_gpio *tc35892_gpio = platform_get_drvdata(pdev); | 343 | struct tc35892_gpio *tc35892_gpio = platform_get_drvdata(pdev); |
| 344 | struct tc35892 *tc35892 = tc35892_gpio->tc35892; | ||
| 345 | struct tc35892_gpio_platform_data *pdata = tc35892->pdata->gpio; | ||
| 341 | int irq = platform_get_irq(pdev, 0); | 346 | int irq = platform_get_irq(pdev, 0); |
| 342 | int ret; | 347 | int ret; |
| 343 | 348 | ||
| 349 | if (pdata->remove) | ||
| 350 | pdata->remove(tc35892, tc35892_gpio->chip.base); | ||
| 351 | |||
| 344 | ret = gpiochip_remove(&tc35892_gpio->chip); | 352 | ret = gpiochip_remove(&tc35892_gpio->chip); |
| 345 | if (ret < 0) { | 353 | if (ret < 0) { |
| 346 | dev_err(tc35892_gpio->dev, | 354 | dev_err(tc35892_gpio->dev, |
diff --git a/include/linux/mfd/tc35892.h b/include/linux/mfd/tc35892.h index e47f770d3068..eff3094ca84e 100644 --- a/include/linux/mfd/tc35892.h +++ b/include/linux/mfd/tc35892.h | |||
| @@ -111,9 +111,13 @@ extern int tc35892_set_bits(struct tc35892 *tc35892, u8 reg, u8 mask, u8 val); | |||
| 111 | * struct tc35892_gpio_platform_data - TC35892 GPIO platform data | 111 | * struct tc35892_gpio_platform_data - TC35892 GPIO platform data |
| 112 | * @gpio_base: first gpio number assigned to TC35892. A maximum of | 112 | * @gpio_base: first gpio number assigned to TC35892. A maximum of |
| 113 | * %TC35892_NR_GPIOS GPIOs will be allocated. | 113 | * %TC35892_NR_GPIOS GPIOs will be allocated. |
| 114 | * @setup: callback for board-specific initialization | ||
| 115 | * @remove: callback for board-specific teardown | ||
| 114 | */ | 116 | */ |
| 115 | struct tc35892_gpio_platform_data { | 117 | struct tc35892_gpio_platform_data { |
| 116 | int gpio_base; | 118 | int gpio_base; |
| 119 | void (*setup)(struct tc35892 *tc35892, unsigned gpio_base); | ||
| 120 | void (*remove)(struct tc35892 *tc35892, unsigned gpio_base); | ||
| 117 | }; | 121 | }; |
| 118 | 122 | ||
| 119 | /** | 123 | /** |
