aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-stmpe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-stmpe.c')
-rw-r--r--drivers/gpio/gpio-stmpe.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index dce34727bbf8..522c90ee96e8 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -12,6 +12,7 @@
12#include <linux/gpio.h> 12#include <linux/gpio.h>
13#include <linux/irq.h> 13#include <linux/irq.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/of.h>
15#include <linux/mfd/stmpe.h> 16#include <linux/mfd/stmpe.h>
16 17
17/* 18/*
@@ -304,6 +305,7 @@ static void stmpe_gpio_irq_remove(struct stmpe_gpio *stmpe_gpio)
304static int __devinit stmpe_gpio_probe(struct platform_device *pdev) 305static int __devinit stmpe_gpio_probe(struct platform_device *pdev)
305{ 306{
306 struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); 307 struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent);
308 struct device_node *np = pdev->dev.of_node;
307 struct stmpe_gpio_platform_data *pdata; 309 struct stmpe_gpio_platform_data *pdata;
308 struct stmpe_gpio *stmpe_gpio; 310 struct stmpe_gpio *stmpe_gpio;
309 int ret; 311 int ret;
@@ -321,13 +323,17 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)
321 323
322 stmpe_gpio->dev = &pdev->dev; 324 stmpe_gpio->dev = &pdev->dev;
323 stmpe_gpio->stmpe = stmpe; 325 stmpe_gpio->stmpe = stmpe;
324 stmpe_gpio->norequest_mask = pdata ? pdata->norequest_mask : 0;
325
326 stmpe_gpio->chip = template_chip; 326 stmpe_gpio->chip = template_chip;
327 stmpe_gpio->chip.ngpio = stmpe->num_gpios; 327 stmpe_gpio->chip.ngpio = stmpe->num_gpios;
328 stmpe_gpio->chip.dev = &pdev->dev; 328 stmpe_gpio->chip.dev = &pdev->dev;
329 stmpe_gpio->chip.base = pdata ? pdata->gpio_base : -1; 329 stmpe_gpio->chip.base = pdata ? pdata->gpio_base : -1;
330 330
331 if (pdata)
332 stmpe_gpio->norequest_mask = pdata->norequest_mask;
333 else if (np)
334 of_property_read_u32(np, "st,norequest-mask",
335 &stmpe_gpio->norequest_mask);
336
331 if (irq >= 0) 337 if (irq >= 0)
332 stmpe_gpio->irq_base = stmpe->irq_base + STMPE_INT_GPIO(0); 338 stmpe_gpio->irq_base = stmpe->irq_base + STMPE_INT_GPIO(0);
333 else 339 else