aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-11-25 05:02:19 -0500
committerLinus Walleij <linus.walleij@linaro.org>2016-12-07 09:22:50 -0500
commit6da7b0dd517592e12966af7ec55eecf6ebd2c589 (patch)
tree52c50bad64f85aab32b3f2030e7603ecc232ef59 /drivers/gpio
parent562b488443f658151abc9732e1a9762e27c694a0 (diff)
gpio: pl061: delete platform data handling
Platform data is a remnant of board files and all boards using the PL061 have been migrated to use device tree or ACPI instead. The custom mechanism to set line by default as inputs/outputs has been superceded by the GPIO-internal hogging mechanism. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-pl061.c41
1 files changed, 3 insertions, 38 deletions
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index cbcc631181e0..0a6bfd2b06e5 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -38,19 +38,6 @@
38 38
39#define PL061_GPIO_NR 8 39#define PL061_GPIO_NR 8
40 40
41struct pl061_platform_data {
42 /* number of the first GPIO */
43 unsigned gpio_base;
44
45 /* number of the first IRQ.
46 * If the IRQ functionality in not desired this must be set to 0.
47 */
48 unsigned irq_base;
49
50 u8 directions; /* startup directions, 1: out, 0: in */
51 u8 values; /* startup values */
52};
53
54#ifdef CONFIG_PM 41#ifdef CONFIG_PM
55struct pl061_context_save_regs { 42struct pl061_context_save_regs {
56 u8 gpio_data; 43 u8 gpio_data;
@@ -306,26 +293,13 @@ static struct irq_chip pl061_irqchip = {
306static int pl061_probe(struct amba_device *adev, const struct amba_id *id) 293static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
307{ 294{
308 struct device *dev = &adev->dev; 295 struct device *dev = &adev->dev;
309 struct pl061_platform_data *pdata = dev_get_platdata(dev);
310 struct pl061 *pl061; 296 struct pl061 *pl061;
311 int ret, irq, i, irq_base; 297 int ret, irq;
312 298
313 pl061 = devm_kzalloc(dev, sizeof(*pl061), GFP_KERNEL); 299 pl061 = devm_kzalloc(dev, sizeof(*pl061), GFP_KERNEL);
314 if (pl061 == NULL) 300 if (pl061 == NULL)
315 return -ENOMEM; 301 return -ENOMEM;
316 302
317 if (pdata) {
318 pl061->gc.base = pdata->gpio_base;
319 irq_base = pdata->irq_base;
320 if (irq_base <= 0) {
321 dev_err(&adev->dev, "invalid IRQ base in pdata\n");
322 return -ENODEV;
323 }
324 } else {
325 pl061->gc.base = -1;
326 irq_base = 0;
327 }
328
329 pl061->base = devm_ioremap_resource(dev, &adev->res); 303 pl061->base = devm_ioremap_resource(dev, &adev->res);
330 if (IS_ERR(pl061->base)) 304 if (IS_ERR(pl061->base))
331 return PTR_ERR(pl061->base); 305 return PTR_ERR(pl061->base);
@@ -336,6 +310,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
336 pl061->gc.free = gpiochip_generic_free; 310 pl061->gc.free = gpiochip_generic_free;
337 } 311 }
338 312
313 pl061->gc.base = -1;
339 pl061->gc.get_direction = pl061_get_direction; 314 pl061->gc.get_direction = pl061_get_direction;
340 pl061->gc.direction_input = pl061_direction_input; 315 pl061->gc.direction_input = pl061_direction_input;
341 pl061->gc.direction_output = pl061_direction_output; 316 pl061->gc.direction_output = pl061_direction_output;
@@ -362,7 +337,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
362 pl061->parent_irq = irq; 337 pl061->parent_irq = irq;
363 338
364 ret = gpiochip_irqchip_add(&pl061->gc, &pl061_irqchip, 339 ret = gpiochip_irqchip_add(&pl061->gc, &pl061_irqchip,
365 irq_base, handle_bad_irq, 340 0, handle_bad_irq,
366 IRQ_TYPE_NONE); 341 IRQ_TYPE_NONE);
367 if (ret) { 342 if (ret) {
368 dev_info(&adev->dev, "could not add irqchip\n"); 343 dev_info(&adev->dev, "could not add irqchip\n");
@@ -371,16 +346,6 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
371 gpiochip_set_chained_irqchip(&pl061->gc, &pl061_irqchip, 346 gpiochip_set_chained_irqchip(&pl061->gc, &pl061_irqchip,
372 irq, pl061_irq_handler); 347 irq, pl061_irq_handler);
373 348
374 for (i = 0; i < PL061_GPIO_NR; i++) {
375 if (pdata) {
376 if (pdata->directions & (BIT(i)))
377 pl061_direction_output(&pl061->gc, i,
378 pdata->values & (BIT(i)));
379 else
380 pl061_direction_input(&pl061->gc, i);
381 }
382 }
383
384 amba_set_drvdata(adev, pl061); 349 amba_set_drvdata(adev, pl061);
385 dev_info(&adev->dev, "PL061 GPIO chip @%pa registered\n", 350 dev_info(&adev->dev, "PL061 GPIO chip @%pa registered\n",
386 &adev->res.start); 351 &adev->res.start);