diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 16:56:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 16:56:35 -0400 |
commit | 30304e5a79d424eb2c8707b3ff0e9b8bf6ab3e8f (patch) | |
tree | 63968fb97b86861e31922515395feef8a110f884 /drivers/gpio/gpio-stmpe.c | |
parent | 750f77064a290beb162352077b52c61b04bcae0e (diff) | |
parent | b8589e2a8065b8e7773742b60ae96b63b757bb69 (diff) |
Merge tag 'mfd_3.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD changes from Samuel Ortiz:
- 4 new drivers: Freescale i.MX on-chip Anatop, Ricoh's RC5T583 and
TI's TPS65090 and TPS65217.
- New variants support (8420, 8520 ab9540), cleanups and bug fixes for
the abx500 and db8500 ST-E chipsets.
- Some minor fixes and update for the wm8994 from Mark.
- The beginning of a long term TWL cleanup effort coming from the TI
folks.
- Various fixes and cleanups for the s5m, TPS659xx, pm860x, and MAX8997
drivers.
Fix up trivial conflicts due to duplicate patches and header file
cleanups (<linux/device.h> removal etc).
* tag 'mfd_3.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (97 commits)
gpio/twl: Add DT support to gpio-twl4030 driver
gpio/twl: Allocate irq_desc dynamically for SPARSE_IRQ support
mfd: Detach twl6040 from the pmic mfd driver
mfd: Replace twl-* pr_ macros by the dev_ equivalent and do various cleanups
mfd: Micro-optimization on twl4030 IRQ handler
mfd: Make twl4030 SIH SPARSE_IRQ capable
mfd: Move twl-core IRQ allocation into twl[4030|6030]-irq files
mfd: Remove references already defineid in header file from twl-core
mfd: Remove unneeded header from twl-core
mfd: Make twl-core not depend on pdata->irq_base/end
ARM: OMAP2+: board-omap4-*: Do not use anymore TWL6030_IRQ_BASE in board files
mfd: Return twl6030_mmc_card_detect IRQ for board setup
Revert "mfd: Add platform data for MAX8997 haptic driver"
mfd: Add support for TPS65090
mfd: Add some da9052-i2c section annotations
mfd: Build rtc5t583 only if I2C config is selected to y.
mfd: Add anatop mfd driver
mfd: Fix compilation error in tps65910.h
mfd: Add 8420 variant to db8500-prcmu
mfd: Add 8520 PRCMU variant to db8500-prcmu
...
Diffstat (limited to 'drivers/gpio/gpio-stmpe.c')
-rw-r--r-- | drivers/gpio/gpio-stmpe.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 87a68a896abf..094c5c4fd7f2 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c | |||
@@ -307,13 +307,11 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev) | |||
307 | struct stmpe_gpio_platform_data *pdata; | 307 | struct stmpe_gpio_platform_data *pdata; |
308 | struct stmpe_gpio *stmpe_gpio; | 308 | struct stmpe_gpio *stmpe_gpio; |
309 | int ret; | 309 | int ret; |
310 | int irq; | 310 | int irq = 0; |
311 | 311 | ||
312 | pdata = stmpe->pdata->gpio; | 312 | pdata = stmpe->pdata->gpio; |
313 | 313 | ||
314 | irq = platform_get_irq(pdev, 0); | 314 | irq = platform_get_irq(pdev, 0); |
315 | if (irq < 0) | ||
316 | return irq; | ||
317 | 315 | ||
318 | stmpe_gpio = kzalloc(sizeof(struct stmpe_gpio), GFP_KERNEL); | 316 | stmpe_gpio = kzalloc(sizeof(struct stmpe_gpio), GFP_KERNEL); |
319 | if (!stmpe_gpio) | 317 | if (!stmpe_gpio) |
@@ -330,21 +328,28 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev) | |||
330 | stmpe_gpio->chip.dev = &pdev->dev; | 328 | stmpe_gpio->chip.dev = &pdev->dev; |
331 | stmpe_gpio->chip.base = pdata ? pdata->gpio_base : -1; | 329 | stmpe_gpio->chip.base = pdata ? pdata->gpio_base : -1; |
332 | 330 | ||
333 | stmpe_gpio->irq_base = stmpe->irq_base + STMPE_INT_GPIO(0); | 331 | if (irq >= 0) |
332 | stmpe_gpio->irq_base = stmpe->irq_base + STMPE_INT_GPIO(0); | ||
333 | else | ||
334 | dev_info(&pdev->dev, | ||
335 | "device configured in no-irq mode; " | ||
336 | "irqs are not available\n"); | ||
334 | 337 | ||
335 | ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO); | 338 | ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO); |
336 | if (ret) | 339 | if (ret) |
337 | goto out_free; | 340 | goto out_free; |
338 | 341 | ||
339 | ret = stmpe_gpio_irq_init(stmpe_gpio); | 342 | if (irq >= 0) { |
340 | if (ret) | 343 | ret = stmpe_gpio_irq_init(stmpe_gpio); |
341 | goto out_disable; | 344 | if (ret) |
345 | goto out_disable; | ||
342 | 346 | ||
343 | ret = request_threaded_irq(irq, NULL, stmpe_gpio_irq, IRQF_ONESHOT, | 347 | ret = request_threaded_irq(irq, NULL, stmpe_gpio_irq, |
344 | "stmpe-gpio", stmpe_gpio); | 348 | IRQF_ONESHOT, "stmpe-gpio", stmpe_gpio); |
345 | if (ret) { | 349 | if (ret) { |
346 | dev_err(&pdev->dev, "unable to get irq: %d\n", ret); | 350 | dev_err(&pdev->dev, "unable to get irq: %d\n", ret); |
347 | goto out_removeirq; | 351 | goto out_removeirq; |
352 | } | ||
348 | } | 353 | } |
349 | 354 | ||
350 | ret = gpiochip_add(&stmpe_gpio->chip); | 355 | ret = gpiochip_add(&stmpe_gpio->chip); |
@@ -361,9 +366,11 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev) | |||
361 | return 0; | 366 | return 0; |
362 | 367 | ||
363 | out_freeirq: | 368 | out_freeirq: |
364 | free_irq(irq, stmpe_gpio); | 369 | if (irq >= 0) |
370 | free_irq(irq, stmpe_gpio); | ||
365 | out_removeirq: | 371 | out_removeirq: |
366 | stmpe_gpio_irq_remove(stmpe_gpio); | 372 | if (irq >= 0) |
373 | stmpe_gpio_irq_remove(stmpe_gpio); | ||
367 | out_disable: | 374 | out_disable: |
368 | stmpe_disable(stmpe, STMPE_BLOCK_GPIO); | 375 | stmpe_disable(stmpe, STMPE_BLOCK_GPIO); |
369 | out_free: | 376 | out_free: |
@@ -391,8 +398,10 @@ static int __devexit stmpe_gpio_remove(struct platform_device *pdev) | |||
391 | 398 | ||
392 | stmpe_disable(stmpe, STMPE_BLOCK_GPIO); | 399 | stmpe_disable(stmpe, STMPE_BLOCK_GPIO); |
393 | 400 | ||
394 | free_irq(irq, stmpe_gpio); | 401 | if (irq >= 0) { |
395 | stmpe_gpio_irq_remove(stmpe_gpio); | 402 | free_irq(irq, stmpe_gpio); |
403 | stmpe_gpio_irq_remove(stmpe_gpio); | ||
404 | } | ||
396 | platform_set_drvdata(pdev, NULL); | 405 | platform_set_drvdata(pdev, NULL); |
397 | kfree(stmpe_gpio); | 406 | kfree(stmpe_gpio); |
398 | 407 | ||