From aa3e22473cb89eeb25c1bca8141ef00a13299e61 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 6 May 2013 12:27:24 +0900 Subject: gpio: langwell: remove unnecessary platform_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Linus Walleij --- drivers/gpio/gpio-langwell.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c index 62ef10a641c4..b8a5729ca4f6 100644 --- a/drivers/gpio/gpio-langwell.c +++ b/drivers/gpio/gpio-langwell.c @@ -481,7 +481,6 @@ static int wp_gpio_remove(struct platform_device *pdev) dev_err(&pdev->dev, "failed to remove gpio_chip.\n"); iounmap(lnw->reg_base); kfree(lnw); - platform_set_drvdata(pdev, NULL); return 0; } -- cgit v1.2.3-59-g8ed1b From 07606bfc73248fd9ef0bf5ac3c0b12098fb19b25 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 6 May 2013 12:28:37 +0900 Subject: gpio: lynxpoint: remove unnecessary platform_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Acked-by: Mathias Nyman Signed-off-by: Linus Walleij --- drivers/gpio/gpio-lynxpoint.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c index 86c17de87692..761c4705dfbb 100644 --- a/drivers/gpio/gpio-lynxpoint.c +++ b/drivers/gpio/gpio-lynxpoint.c @@ -447,7 +447,6 @@ static int lp_gpio_remove(struct platform_device *pdev) err = gpiochip_remove(&lg->chip); if (err) dev_warn(&pdev->dev, "failed to remove gpio_chip.\n"); - platform_set_drvdata(pdev, NULL); return 0; } -- cgit v1.2.3-59-g8ed1b From 8be2010ec96ae36e71df119eff0aba3d8ecd5622 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 6 May 2013 12:29:18 +0900 Subject: gpio: rdc321x: remove unnecessary platform_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Linus Walleij --- drivers/gpio/gpio-rdc321x.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-rdc321x.c b/drivers/gpio/gpio-rdc321x.c index 1bf55f67f7a5..368c3c00fca5 100644 --- a/drivers/gpio/gpio-rdc321x.c +++ b/drivers/gpio/gpio-rdc321x.c @@ -187,20 +187,18 @@ static int rdc321x_gpio_probe(struct platform_device *pdev) rdc321x_gpio_dev->reg1_data_base, &rdc321x_gpio_dev->data_reg[0]); if (err) - goto out_drvdata; + goto out_free; err = pci_read_config_dword(rdc321x_gpio_dev->sb_pdev, rdc321x_gpio_dev->reg2_data_base, &rdc321x_gpio_dev->data_reg[1]); if (err) - goto out_drvdata; + goto out_free; dev_info(&pdev->dev, "registering %d GPIOs\n", rdc321x_gpio_dev->chip.ngpio); return gpiochip_add(&rdc321x_gpio_dev->chip); -out_drvdata: - platform_set_drvdata(pdev, NULL); out_free: kfree(rdc321x_gpio_dev); return err; @@ -216,7 +214,6 @@ static int rdc321x_gpio_remove(struct platform_device *pdev) dev_err(&pdev->dev, "failed to unregister chip\n"); kfree(rdc321x_gpio_dev); - platform_set_drvdata(pdev, NULL); return ret; } -- cgit v1.2.3-59-g8ed1b From e1142aaeba1859c6c2416aa237f8ce93f777b332 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 6 May 2013 12:30:49 +0900 Subject: gpio: stmpe: remove unnecessary platform_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 3ce5bc38ac31..671913e63458 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -431,7 +431,6 @@ static int stmpe_gpio_remove(struct platform_device *pdev) if (irq >= 0) free_irq(irq, stmpe_gpio); - platform_set_drvdata(pdev, NULL); kfree(stmpe_gpio); return 0; -- cgit v1.2.3-59-g8ed1b From 04df77298ff0bc108395b17a7c8fa8c5c8c3deab Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 6 May 2013 12:32:19 +0900 Subject: gpio: tc3589x: remove unnecessary platform_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Acked-by: Lee Jones Signed-off-by: Linus Walleij --- drivers/gpio/gpio-tc3589x.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c index d34d80dfb083..4a5de273c230 100644 --- a/drivers/gpio/gpio-tc3589x.c +++ b/drivers/gpio/gpio-tc3589x.c @@ -407,7 +407,6 @@ static int tc3589x_gpio_remove(struct platform_device *pdev) free_irq(irq, tc3589x_gpio); - platform_set_drvdata(pdev, NULL); kfree(tc3589x_gpio); return 0; -- cgit v1.2.3-59-g8ed1b From 752057e5ba87876b9d1126272e886c6a1a6234d0 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 6 May 2013 12:35:19 +0900 Subject: gpio: timberdale: remove unnecessary platform_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Linus Walleij --- drivers/gpio/gpio-timberdale.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c index 43774058b693..4c65f8883204 100644 --- a/drivers/gpio/gpio-timberdale.c +++ b/drivers/gpio/gpio-timberdale.c @@ -342,8 +342,6 @@ static int timbgpio_remove(struct platform_device *pdev) release_mem_region(iomem->start, resource_size(iomem)); kfree(tgpio); - platform_set_drvdata(pdev, NULL); - return 0; } -- cgit v1.2.3-59-g8ed1b From 1cdd8d52ecbedbce1cbac063aa5715810a228ab3 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 6 May 2013 12:36:51 +0900 Subject: gpio: vx855: remove unnecessary platform_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Linus Walleij --- drivers/gpio/gpio-vx855.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpio/gpio-vx855.c b/drivers/gpio/gpio-vx855.c index 2b7252cb2427..cddfa22edb41 100644 --- a/drivers/gpio/gpio-vx855.c +++ b/drivers/gpio/gpio-vx855.c @@ -279,7 +279,6 @@ out_release: release_region(res_gpi->start, resource_size(res_gpi)); if (vg->gpo_reserved) release_region(res_gpi->start, resource_size(res_gpo)); - platform_set_drvdata(pdev, NULL); kfree(vg); return ret; } @@ -301,7 +300,6 @@ static int vx855gpio_remove(struct platform_device *pdev) release_region(res->start, resource_size(res)); } - platform_set_drvdata(pdev, NULL); kfree(vg); return 0; } -- cgit v1.2.3-59-g8ed1b From 8700d0afc8ec3bc93f1105a94babfec6f9573b82 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 10 May 2013 17:32:28 +0800 Subject: gpio: stmpe: Staticize non-exported symbols Both stmpe_gpio_irq_map() and stmpe_gpio_irq_unmap() are not referenced outside of this file, make them static. Signed-off-by: Axel Lin Acked-by: Lee Jones Signed-off-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 671913e63458..b33bad1bb4df 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -271,8 +271,8 @@ static irqreturn_t stmpe_gpio_irq(int irq, void *dev) return IRQ_HANDLED; } -int stmpe_gpio_irq_map(struct irq_domain *d, unsigned int virq, - irq_hw_number_t hwirq) +static int stmpe_gpio_irq_map(struct irq_domain *d, unsigned int virq, + irq_hw_number_t hwirq) { struct stmpe_gpio *stmpe_gpio = d->host_data; @@ -292,7 +292,7 @@ int stmpe_gpio_irq_map(struct irq_domain *d, unsigned int virq, return 0; } -void stmpe_gpio_irq_unmap(struct irq_domain *d, unsigned int virq) +static void stmpe_gpio_irq_unmap(struct irq_domain *d, unsigned int virq) { #ifdef CONFIG_ARM set_irq_flags(virq, 0); -- cgit v1.2.3-59-g8ed1b From 2b861f4b2b4787772b4f508c8cdfa492a01a60db Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 19 May 2013 14:25:48 +0800 Subject: gpio: max7300: Fix trivial typo in Kconfig help text max7301 is controlled through SPI interface which means another driver. Signed-off-by: Axel Lin Acked-by: Wolfram Sang Signed-off-by: Linus Walleij --- drivers/gpio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 573c449c49b9..d133dd85443e 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -330,7 +330,7 @@ config GPIO_MAX7300 depends on I2C select GPIO_MAX730X help - GPIO driver for Maxim MAX7301 I2C-based GPIO expander. + GPIO driver for Maxim MAX7300 I2C-based GPIO expander. config GPIO_MAX732X tristate "MAX7319, MAX7320-7327 I2C Port Expanders" -- cgit v1.2.3-59-g8ed1b From aeb168f77c745fa4964e217400c9d43685e46705 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 22 May 2013 13:20:10 +0300 Subject: gpio-langwell: initialize lock before usage Otherwise we will end up with traceback from LOCKDEP: INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-rc2-next-20130521-00028-g09aa9fc #487 00000000 00000000 f6c55c54 c1541fe4 f6040bf8 f6c55c8c c1069ef1 c1726bc1 c1726cc8 c1726c9e 00000000 f6c584e0 f6c58000 f6c55ce8 00000000 f6040bf8 f6040bf8 00000046 f6c58000 f6c55d00 c106a18d 00000a2b 00000003 00004f02 Call Trace: [] dump_stack+0x49/0x77 [] register_lock_class+0x58/0x260 [] __lock_acquire+0x94/0xcff [] ? __lock_acquire+0xccf/0xcff [] lock_acquire+0xcc/0x10d [] ? lnw_irq_type+0x63/0xe9 [] _raw_spin_lock_irqsave+0x32/0x42 [] ? lnw_irq_type+0x63/0xe9 [] lnw_irq_type+0x63/0xe9 [] __irq_set_trigger+0x98/0x123 [] irq_set_irq_type+0x2f/0x51 [] ? irq_set_irq_type+0x2f/0x51 [] ? lnw_irq_type+0xe9/0xe9 [] lnw_gpio_irq_map+0x32/0x3b [] irq_domain_add_legacy+0xe2/0x107 [] irq_domain_add_simple+0x47/0x60 [] lnw_gpio_probe+0x119/0x217 [] pci_device_probe+0x5a/0x92 ... Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Acked-by: David Cohen Signed-off-by: Linus Walleij --- drivers/gpio/gpio-langwell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c index b8a5729ca4f6..a0190de14371 100644 --- a/drivers/gpio/gpio-langwell.c +++ b/drivers/gpio/gpio-langwell.c @@ -380,6 +380,8 @@ static int lnw_gpio_probe(struct pci_dev *pdev, lnw->chip.can_sleep = 0; lnw->pdev = pdev; + spin_lock_init(&lnw->lock); + lnw->domain = irq_domain_add_simple(pdev->dev.of_node, ngpio, irq_base, &lnw_gpio_irq_ops, lnw); if (!lnw->domain) { @@ -399,8 +401,6 @@ static int lnw_gpio_probe(struct pci_dev *pdev, irq_set_handler_data(pdev->irq, lnw); irq_set_chained_handler(pdev->irq, lnw_irq_handler); - spin_lock_init(&lnw->lock); - pm_runtime_put_noidle(&pdev->dev); pm_runtime_allow(&pdev->dev); -- cgit v1.2.3-59-g8ed1b From 64c8cbc17c8d4af3b600c66247e47eac99e46aaf Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 22 May 2013 13:20:11 +0300 Subject: gpio-langwell: do not use direct access to iomapped memory We better to use readl() function instead of bad looking direct access. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Acked-by: David Cohen Signed-off-by: Linus Walleij --- drivers/gpio/gpio-langwell.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c index a0190de14371..fff661126dc7 100644 --- a/drivers/gpio/gpio-langwell.c +++ b/drivers/gpio/gpio-langwell.c @@ -65,7 +65,7 @@ enum GPIO_REG { struct lnw_gpio { struct gpio_chip chip; - void *reg_base; + void __iomem *reg_base; spinlock_t lock; struct pci_dev *pdev; struct irq_domain *domain; @@ -318,9 +318,9 @@ static const struct dev_pm_ops lnw_gpio_pm_ops = { }; static int lnw_gpio_probe(struct pci_dev *pdev, - const struct pci_device_id *id) + const struct pci_device_id *id) { - void *base; + void __iomem *base; resource_size_t start, len; struct lnw_gpio *lnw; u32 gpio_base; @@ -346,8 +346,10 @@ static int lnw_gpio_probe(struct pci_dev *pdev, retval = -EFAULT; goto err_ioremap; } - irq_base = *(u32 *)base; - gpio_base = *((u32 *)base + 1); + + irq_base = readl(base); + gpio_base = readl(sizeof(u32) + base); + /* release the IO mapping, since we already get the info from bar1 */ iounmap(base); /* get the register base from bar0 */ -- cgit v1.2.3-59-g8ed1b From 786e07ecb5b2ef896c9d42fa982d02da168e4290 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 22 May 2013 13:20:12 +0300 Subject: gpio-langwell: use managed functions pcim_* and devm_* This makes the error handling much more simpler than open-coding everything and in addition makes the probe function smaller an tidier. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Acked-by: David Cohen [Rebased on the platform-data set to NULL removal patch] Signed-off-by: Linus Walleij --- drivers/gpio/gpio-langwell.c | 78 ++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 57 deletions(-) diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c index fff661126dc7..54b6caf1742e 100644 --- a/drivers/gpio/gpio-langwell.c +++ b/drivers/gpio/gpio-langwell.c @@ -321,55 +321,37 @@ static int lnw_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id) { void __iomem *base; - resource_size_t start, len; struct lnw_gpio *lnw; u32 gpio_base; u32 irq_base; int retval; int ngpio = id->driver_data; - retval = pci_enable_device(pdev); + retval = pcim_enable_device(pdev); if (retval) return retval; - retval = pci_request_regions(pdev, "langwell_gpio"); + retval = pcim_iomap_regions(pdev, 1 << 0 | 1 << 1, pci_name(pdev)); if (retval) { - dev_err(&pdev->dev, "error requesting resources\n"); - goto err_pci_req_region; - } - /* get the gpio_base from bar1 */ - start = pci_resource_start(pdev, 1); - len = pci_resource_len(pdev, 1); - base = ioremap_nocache(start, len); - if (!base) { - dev_err(&pdev->dev, "error mapping bar1\n"); - retval = -EFAULT; - goto err_ioremap; + dev_err(&pdev->dev, "I/O memory mapping error\n"); + return retval; } + base = pcim_iomap_table(pdev)[1]; + irq_base = readl(base); gpio_base = readl(sizeof(u32) + base); /* release the IO mapping, since we already get the info from bar1 */ - iounmap(base); - /* get the register base from bar0 */ - start = pci_resource_start(pdev, 0); - len = pci_resource_len(pdev, 0); - base = devm_ioremap_nocache(&pdev->dev, start, len); - if (!base) { - dev_err(&pdev->dev, "error mapping bar0\n"); - retval = -EFAULT; - goto err_ioremap; - } + pcim_iounmap_regions(pdev, 1 << 1); lnw = devm_kzalloc(&pdev->dev, sizeof(*lnw), GFP_KERNEL); if (!lnw) { dev_err(&pdev->dev, "can't allocate langwell_gpio chip data\n"); - retval = -ENOMEM; - goto err_ioremap; + return -ENOMEM; } - lnw->reg_base = base; + lnw->reg_base = pcim_iomap_table(pdev)[0]; lnw->chip.label = dev_name(&pdev->dev); lnw->chip.request = lnw_gpio_request; lnw->chip.direction_input = lnw_gpio_direction_input; @@ -386,16 +368,14 @@ static int lnw_gpio_probe(struct pci_dev *pdev, lnw->domain = irq_domain_add_simple(pdev->dev.of_node, ngpio, irq_base, &lnw_gpio_irq_ops, lnw); - if (!lnw->domain) { - retval = -ENOMEM; - goto err_ioremap; - } + if (!lnw->domain) + return -ENOMEM; pci_set_drvdata(pdev, lnw); retval = gpiochip_add(&lnw->chip); if (retval) { dev_err(&pdev->dev, "langwell gpiochip_add error %d\n", retval); - goto err_ioremap; + return retval; } lnw_irq_init_hw(lnw); @@ -407,12 +387,6 @@ static int lnw_gpio_probe(struct pci_dev *pdev, pm_runtime_allow(&pdev->dev); return 0; - -err_ioremap: - pci_release_regions(pdev); -err_pci_req_region: - pci_disable_device(pdev); - return retval; } static struct pci_driver lnw_gpio_driver = { @@ -430,23 +404,20 @@ static int wp_gpio_probe(struct platform_device *pdev) struct lnw_gpio *lnw; struct gpio_chip *gc; struct resource *rc; - int retval = 0; - - rc = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!rc) - return -EINVAL; + int retval; - lnw = kzalloc(sizeof(struct lnw_gpio), GFP_KERNEL); + lnw = devm_kzalloc(&pdev->dev, sizeof(struct lnw_gpio), GFP_KERNEL); if (!lnw) { dev_err(&pdev->dev, "can't allocate whitneypoint_gpio chip data\n"); return -ENOMEM; } - lnw->reg_base = ioremap_nocache(rc->start, resource_size(rc)); - if (lnw->reg_base == NULL) { - retval = -EINVAL; - goto err_kmalloc; - } + + rc = platform_get_resource(pdev, IORESOURCE_MEM, 0); + lnw->reg_base = devm_ioremap_resource(&pdev->dev, rc); + if (IS_ERR(lnw->reg_base)) + return PTR_ERR(lnw->reg_base); + spin_lock_init(&lnw->lock); gc = &lnw->chip; gc->label = dev_name(&pdev->dev); @@ -463,15 +434,10 @@ static int wp_gpio_probe(struct platform_device *pdev) if (retval) { dev_err(&pdev->dev, "whitneypoint gpiochip_add error %d\n", retval); - goto err_ioremap; + return retval; } platform_set_drvdata(pdev, lnw); return 0; -err_ioremap: - iounmap(lnw->reg_base); -err_kmalloc: - kfree(lnw); - return retval; } static int wp_gpio_remove(struct platform_device *pdev) @@ -481,8 +447,6 @@ static int wp_gpio_remove(struct platform_device *pdev) err = gpiochip_remove(&lnw->chip); if (err) dev_err(&pdev->dev, "failed to remove gpio_chip.\n"); - iounmap(lnw->reg_base); - kfree(lnw); return 0; } -- cgit v1.2.3-59-g8ed1b From 8aca119f561ddb51d407b26f5dacb4f4ce3b3364 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 22 May 2013 13:20:13 +0300 Subject: gpio-langwell: amend error messages There is no need to use hardcoded device name in the error messages, because dev_err() prefixes the message with the device name anyway. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Acked-by: David Cohen Signed-off-by: Linus Walleij --- drivers/gpio/gpio-langwell.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c index 54b6caf1742e..313d190c528d 100644 --- a/drivers/gpio/gpio-langwell.c +++ b/drivers/gpio/gpio-langwell.c @@ -347,7 +347,7 @@ static int lnw_gpio_probe(struct pci_dev *pdev, lnw = devm_kzalloc(&pdev->dev, sizeof(*lnw), GFP_KERNEL); if (!lnw) { - dev_err(&pdev->dev, "can't allocate langwell_gpio chip data\n"); + dev_err(&pdev->dev, "can't allocate chip data\n"); return -ENOMEM; } @@ -374,7 +374,7 @@ static int lnw_gpio_probe(struct pci_dev *pdev, pci_set_drvdata(pdev, lnw); retval = gpiochip_add(&lnw->chip); if (retval) { - dev_err(&pdev->dev, "langwell gpiochip_add error %d\n", retval); + dev_err(&pdev->dev, "gpiochip_add error %d\n", retval); return retval; } @@ -408,8 +408,7 @@ static int wp_gpio_probe(struct platform_device *pdev) lnw = devm_kzalloc(&pdev->dev, sizeof(struct lnw_gpio), GFP_KERNEL); if (!lnw) { - dev_err(&pdev->dev, - "can't allocate whitneypoint_gpio chip data\n"); + dev_err(&pdev->dev, "can't allocate chip data\n"); return -ENOMEM; } @@ -432,8 +431,7 @@ static int wp_gpio_probe(struct platform_device *pdev) gc->can_sleep = 0; retval = gpiochip_add(gc); if (retval) { - dev_err(&pdev->dev, "whitneypoint gpiochip_add error %d\n", - retval); + dev_err(&pdev->dev, "gpiochip_add error %d\n", retval); return retval; } platform_set_drvdata(pdev, lnw); -- cgit v1.2.3-59-g8ed1b From 611a485b5fac3a6dce32a1ae6ddd3e0df215aecd Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 22 May 2013 13:20:14 +0300 Subject: gpio-langwell: drop away explicit casting Since the type of the reg_base member is void __iomem * we don't need to have explicit casting in gpio_reg() and gpio_reg_2bit(). Update year in the copyright notice as well. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Acked-by: David Cohen Signed-off-by: Linus Walleij --- drivers/gpio/gpio-langwell.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c index 313d190c528d..fec85ca89c58 100644 --- a/drivers/gpio/gpio-langwell.c +++ b/drivers/gpio/gpio-langwell.c @@ -1,7 +1,7 @@ /* * Moorestown platform Langwell chip GPIO driver * - * Copyright (c) 2008 - 2009, Intel Corporation. + * Copyright (c) 2008, 2009, 2013, Intel Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -74,15 +74,13 @@ struct lnw_gpio { #define to_lnw_priv(chip) container_of(chip, struct lnw_gpio, chip) static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned offset, - enum GPIO_REG reg_type) + enum GPIO_REG reg_type) { struct lnw_gpio *lnw = to_lnw_priv(chip); unsigned nreg = chip->ngpio / 32; u8 reg = offset / 32; - void __iomem *ptr; - ptr = (void __iomem *)(lnw->reg_base + reg_type * nreg * 4 + reg * 4); - return ptr; + return lnw->reg_base + reg_type * nreg * 4 + reg * 4; } static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned offset, @@ -91,10 +89,8 @@ static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned offset, struct lnw_gpio *lnw = to_lnw_priv(chip); unsigned nreg = chip->ngpio / 32; u8 reg = offset / 16; - void __iomem *ptr; - ptr = (void __iomem *)(lnw->reg_base + reg_type * nreg * 4 + reg * 4); - return ptr; + return lnw->reg_base + reg_type * nreg * 4 + reg * 4; } static int lnw_gpio_request(struct gpio_chip *chip, unsigned offset) -- cgit v1.2.3-59-g8ed1b From df46dce09113ea0a52ce7403d35087e167f3a460 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Tue, 21 May 2013 23:11:10 +0800 Subject: gpio-ml-ioh: fix error return code in ioh_gpio_probe() Fix to return a negative error code in the irq descs alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Signed-off-by: Linus Walleij --- drivers/gpio/gpio-ml-ioh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c index 0966f2637ad2..6da6d7667c6d 100644 --- a/drivers/gpio/gpio-ml-ioh.c +++ b/drivers/gpio/gpio-ml-ioh.c @@ -465,6 +465,7 @@ static int ioh_gpio_probe(struct pci_dev *pdev, dev_warn(&pdev->dev, "ml_ioh_gpio: Failed to get IRQ base num\n"); chip->irq_base = -1; + ret = irq_base; goto err_irq_alloc_descs; } chip->irq_base = irq_base; -- cgit v1.2.3-59-g8ed1b From d15b71796316100b31729c8305ac11f03a189670 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Sun, 26 May 2013 11:50:54 +0900 Subject: MAINTAINERS: add linux-gpio mailing list Signed-off-by: Alexandre Courbot Signed-off-by: Linus Walleij --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index fd3a495a0005..e9049a8f1218 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3566,6 +3566,7 @@ GPIO SUBSYSTEM M: Grant Likely M: Linus Walleij S: Maintained +L: linux-gpio@vger.kernel.org T: git git://git.secretlab.ca/git/linux-2.6.git F: Documentation/gpio.txt F: drivers/gpio/ -- cgit v1.2.3-59-g8ed1b From 644c8df2fb276e6cdfab18d60e9e0bf7a5b65b9a Mon Sep 17 00:00:00 2001 From: Nikolay Balandin Date: Tue, 28 May 2013 15:02:50 -0700 Subject: gpio: sx150x: convert to use devm_* functions Use devm_* functions to make cleanup paths simpler. Signed-off-by: Nikolay Balandin Signed-off-by: Linus Walleij --- drivers/gpio/gpio-sx150x.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c index 796b6c42fa70..f371732591d2 100644 --- a/drivers/gpio/gpio-sx150x.c +++ b/drivers/gpio/gpio-sx150x.c @@ -548,7 +548,8 @@ static int sx150x_install_irq_chip(struct sx150x_chip *chip, #endif } - err = request_threaded_irq(irq_summary, + err = devm_request_threaded_irq(&chip->client->dev, + irq_summary, NULL, sx150x_irq_thread_fn, IRQF_SHARED | IRQF_TRIGGER_FALLING, @@ -567,8 +568,6 @@ static void sx150x_remove_irq_chip(struct sx150x_chip *chip) unsigned n; unsigned irq; - free_irq(chip->irq_summary, chip); - for (n = 0; n < chip->dev_cfg->ngpios; ++n) { irq = chip->irq_base + n; irq_set_chip_and_handler(irq, NULL, NULL); @@ -591,18 +590,19 @@ static int sx150x_probe(struct i2c_client *client, if (!i2c_check_functionality(client->adapter, i2c_funcs)) return -ENOSYS; - chip = kzalloc(sizeof(struct sx150x_chip), GFP_KERNEL); + chip = devm_kzalloc(&client->dev, + sizeof(struct sx150x_chip), GFP_KERNEL); if (!chip) return -ENOMEM; sx150x_init_chip(chip, client, id->driver_data, pdata); rc = sx150x_init_hw(chip, pdata); if (rc < 0) - goto probe_fail_pre_gpiochip_add; + return rc; rc = gpiochip_add(&chip->gpio_chip); - if (rc < 0) - goto probe_fail_pre_gpiochip_add; + if (rc) + return rc; if (pdata->irq_summary >= 0) { rc = sx150x_install_irq_chip(chip, @@ -617,8 +617,6 @@ static int sx150x_probe(struct i2c_client *client, return 0; probe_fail_post_gpiochip_add: WARN_ON(gpiochip_remove(&chip->gpio_chip) < 0); -probe_fail_pre_gpiochip_add: - kfree(chip); return rc; } @@ -635,8 +633,6 @@ static int sx150x_remove(struct i2c_client *client) if (chip->irq_summary >= 0) sx150x_remove_irq_chip(chip); - kfree(chip); - return 0; } -- cgit v1.2.3-59-g8ed1b From 6f8bf50031a68f533ae7eba3d3277c38ee7806f5 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 3 Jun 2013 14:31:16 +0200 Subject: GPIO: xilinx: Simplify driver probe function Simplification is done by using OF helper function which increase readability of code and remove (if (var) var = be32_to_cpup;) assignment. Signed-off-by: Michal Simek Signed-off-by: Linus Walleij --- drivers/gpio/gpio-xilinx.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index 9ae7aa8ca48a..2aad53497a63 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -170,24 +170,20 @@ static int xgpio_of_probe(struct device_node *np) return -ENOMEM; /* Update GPIO state shadow register with default value */ - tree_info = of_get_property(np, "xlnx,dout-default", NULL); - if (tree_info) - chip->gpio_state = be32_to_cpup(tree_info); + of_property_read_u32(np, "xlnx,dout-default", &chip->gpio_state); + + /* By default, all pins are inputs */ + chip->gpio_dir = 0xFFFFFFFF; /* Update GPIO direction shadow register with default value */ - chip->gpio_dir = 0xFFFFFFFF; /* By default, all pins are inputs */ - tree_info = of_get_property(np, "xlnx,tri-default", NULL); - if (tree_info) - chip->gpio_dir = be32_to_cpup(tree_info); + of_property_read_u32(np, "xlnx,tri-default", &chip->gpio_dir); + + /* By default assume full GPIO controller */ + chip->mmchip.gc.ngpio = 32; /* Check device node and parent device node for device width */ - chip->mmchip.gc.ngpio = 32; /* By default assume full GPIO controller */ - tree_info = of_get_property(np, "xlnx,gpio-width", NULL); - if (!tree_info) - tree_info = of_get_property(np->parent, - "xlnx,gpio-width", NULL); - if (tree_info) - chip->mmchip.gc.ngpio = be32_to_cpup(tree_info); + of_property_read_u32(np, "xlnx,gpio-width", + (u32 *)&chip->mmchip.gc.ngpio); spin_lock_init(&chip->gpio_lock); -- cgit v1.2.3-59-g8ed1b From 74600ee017557b2ebb669e45237f655e9e2fbac8 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 3 Jun 2013 14:31:17 +0200 Subject: GPIO: xilinx: Add support for dual channel Supporting the second channel in the driver. Offset is 0x8 and both channnels share the same IRQ. Signed-off-by: Michal Simek Signed-off-by: Linus Walleij --- drivers/gpio/gpio-xilinx.c | 103 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 91 insertions(+), 12 deletions(-) diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index 2aad53497a63..626eaa876f09 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -1,7 +1,7 @@ /* - * Xilinx gpio driver + * Xilinx gpio driver for xps/axi_gpio IP. * - * Copyright 2008 Xilinx, Inc. + * Copyright 2008 - 2013 Xilinx, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -12,6 +12,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include @@ -26,11 +27,26 @@ #define XGPIO_DATA_OFFSET (0x0) /* Data register */ #define XGPIO_TRI_OFFSET (0x4) /* I/O direction register */ +#define XGPIO_CHANNEL_OFFSET 0x8 + +/* Read/Write access to the GPIO registers */ +#define xgpio_readreg(offset) in_be32(offset) +#define xgpio_writereg(offset, val) out_be32(offset, val) + +/** + * struct xgpio_instance - Stores information about GPIO device + * struct of_mm_gpio_chip mmchip: OF GPIO chip for memory mapped banks + * gpio_state: GPIO state shadow register + * gpio_dir: GPIO direction shadow register + * offset: GPIO channel offset + * gpio_lock: Lock used for synchronization + */ struct xgpio_instance { struct of_mm_gpio_chip mmchip; - u32 gpio_state; /* GPIO state shadow register */ - u32 gpio_dir; /* GPIO direction shadow register */ - spinlock_t gpio_lock; /* Lock used for synchronization */ + u32 gpio_state; + u32 gpio_dir; + u32 offset; + spinlock_t gpio_lock; }; /** @@ -44,8 +60,12 @@ struct xgpio_instance { static int xgpio_get(struct gpio_chip *gc, unsigned int gpio) { struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); + struct xgpio_instance *chip = + container_of(mm_gc, struct xgpio_instance, mmchip); - return (in_be32(mm_gc->regs + XGPIO_DATA_OFFSET) >> gpio) & 1; + void __iomem *regs = mm_gc->regs + chip->offset; + + return !!(xgpio_readreg(regs + XGPIO_DATA_OFFSET) & BIT(gpio)); } /** @@ -63,6 +83,7 @@ static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val) struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); struct xgpio_instance *chip = container_of(mm_gc, struct xgpio_instance, mmchip); + void __iomem *regs = mm_gc->regs; spin_lock_irqsave(&chip->gpio_lock, flags); @@ -71,7 +92,9 @@ static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val) chip->gpio_state |= 1 << gpio; else chip->gpio_state &= ~(1 << gpio); - out_be32(mm_gc->regs + XGPIO_DATA_OFFSET, chip->gpio_state); + + xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET, + chip->gpio_state); spin_unlock_irqrestore(&chip->gpio_lock, flags); } @@ -91,12 +114,13 @@ static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio) struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); struct xgpio_instance *chip = container_of(mm_gc, struct xgpio_instance, mmchip); + void __iomem *regs = mm_gc->regs; spin_lock_irqsave(&chip->gpio_lock, flags); /* Set the GPIO bit in shadow register and set direction as input */ chip->gpio_dir |= (1 << gpio); - out_be32(mm_gc->regs + XGPIO_TRI_OFFSET, chip->gpio_dir); + xgpio_writereg(regs + chip->offset + XGPIO_TRI_OFFSET, chip->gpio_dir); spin_unlock_irqrestore(&chip->gpio_lock, flags); @@ -119,6 +143,7 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); struct xgpio_instance *chip = container_of(mm_gc, struct xgpio_instance, mmchip); + void __iomem *regs = mm_gc->regs; spin_lock_irqsave(&chip->gpio_lock, flags); @@ -127,11 +152,12 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) chip->gpio_state |= 1 << gpio; else chip->gpio_state &= ~(1 << gpio); - out_be32(mm_gc->regs + XGPIO_DATA_OFFSET, chip->gpio_state); + xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET, + chip->gpio_state); /* Clear the GPIO bit in shadow register and set direction as output */ chip->gpio_dir &= (~(1 << gpio)); - out_be32(mm_gc->regs + XGPIO_TRI_OFFSET, chip->gpio_dir); + xgpio_writereg(regs + chip->offset + XGPIO_TRI_OFFSET, chip->gpio_dir); spin_unlock_irqrestore(&chip->gpio_lock, flags); @@ -147,8 +173,10 @@ static void xgpio_save_regs(struct of_mm_gpio_chip *mm_gc) struct xgpio_instance *chip = container_of(mm_gc, struct xgpio_instance, mmchip); - out_be32(mm_gc->regs + XGPIO_DATA_OFFSET, chip->gpio_state); - out_be32(mm_gc->regs + XGPIO_TRI_OFFSET, chip->gpio_dir); + xgpio_writereg(mm_gc->regs + chip->offset + XGPIO_DATA_OFFSET, + chip->gpio_state); + xgpio_writereg(mm_gc->regs + chip->offset + XGPIO_TRI_OFFSET, + chip->gpio_dir); } /** @@ -202,6 +230,57 @@ static int xgpio_of_probe(struct device_node *np) np->full_name, status); return status; } + + pr_info("XGpio: %s: registered, base is %d\n", np->full_name, + chip->mmchip.gc.base); + + tree_info = of_get_property(np, "xlnx,is-dual", NULL); + if (tree_info && be32_to_cpup(tree_info)) { + chip = kzalloc(sizeof(*chip), GFP_KERNEL); + if (!chip) + return -ENOMEM; + + /* Add dual channel offset */ + chip->offset = XGPIO_CHANNEL_OFFSET; + + /* Update GPIO state shadow register with default value */ + of_property_read_u32(np, "xlnx,dout-default-2", + &chip->gpio_state); + + /* By default, all pins are inputs */ + chip->gpio_dir = 0xFFFFFFFF; + + /* Update GPIO direction shadow register with default value */ + of_property_read_u32(np, "xlnx,tri-default-2", &chip->gpio_dir); + + /* By default assume full GPIO controller */ + chip->mmchip.gc.ngpio = 32; + + /* Check device node and parent device node for device width */ + of_property_read_u32(np, "xlnx,gpio2-width", + (u32 *)&chip->mmchip.gc.ngpio); + + spin_lock_init(&chip->gpio_lock); + + chip->mmchip.gc.direction_input = xgpio_dir_in; + chip->mmchip.gc.direction_output = xgpio_dir_out; + chip->mmchip.gc.get = xgpio_get; + chip->mmchip.gc.set = xgpio_set; + + chip->mmchip.save_regs = xgpio_save_regs; + + /* Call the OF gpio helper to setup and register the GPIO dev */ + status = of_mm_gpiochip_add(np, &chip->mmchip); + if (status) { + kfree(chip); + pr_err("%s: error in probe function with status %d\n", + np->full_name, status); + return status; + } + pr_info("XGpio: %s: dual channel registered, base is %d\n", + np->full_name, chip->mmchip.gc.base); + } + return 0; } -- cgit v1.2.3-59-g8ed1b From cc090d61d1a88f30f2fb75a91bce684ad1bd2e94 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 3 Jun 2013 14:31:18 +0200 Subject: GPIO: xilinx: Use __raw_readl/__raw_writel IO functions This driver can be used on Xilinx ARM Zynq platform where in_be32/out_be32 functions are not implemented. Use __raw_readl/__raw_writel functions which are implemented on Microblaze and PowerPC. For ARM readl/writel functions are used instead. The correct way how to implement this is to detect endians directly on IP. But for the gpio case without interrupt connected(it means without interrupt logic) there are just 2 registers data and tristate where auto detection can't be done. Signed-off-by: Michal Simek Signed-off-by: Linus Walleij --- drivers/gpio/gpio-xilinx.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index 626eaa876f09..791ddaedbfb4 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -30,8 +30,13 @@ #define XGPIO_CHANNEL_OFFSET 0x8 /* Read/Write access to the GPIO registers */ -#define xgpio_readreg(offset) in_be32(offset) -#define xgpio_writereg(offset, val) out_be32(offset, val) +#ifdef CONFIG_ARCH_ZYNQ +# define xgpio_readreg(offset) readl(offset) +# define xgpio_writereg(offset, val) writel(val, offset) +#else +# define xgpio_readreg(offset) __raw_readl(offset) +# define xgpio_writereg(offset, val) __raw_writel(val, offset) +#endif /** * struct xgpio_instance - Stores information about GPIO device -- cgit v1.2.3-59-g8ed1b From 9f7f0b2bbcff719233e6724d756a8c93d3285ade Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 3 Jun 2013 14:31:19 +0200 Subject: GPIO: xilinx: Use BIT macro Use BIT macro from linux/bitops.h. Signed-off-by: Michal Simek Signed-off-by: Linus Walleij --- drivers/gpio/gpio-xilinx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index 791ddaedbfb4..792a05ad4649 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -94,9 +94,9 @@ static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val) /* Write to GPIO signal and set its direction to output */ if (val) - chip->gpio_state |= 1 << gpio; + chip->gpio_state |= BIT(gpio); else - chip->gpio_state &= ~(1 << gpio); + chip->gpio_state &= ~BIT(gpio); xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET, chip->gpio_state); @@ -124,7 +124,7 @@ static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio) spin_lock_irqsave(&chip->gpio_lock, flags); /* Set the GPIO bit in shadow register and set direction as input */ - chip->gpio_dir |= (1 << gpio); + chip->gpio_dir |= BIT(gpio); xgpio_writereg(regs + chip->offset + XGPIO_TRI_OFFSET, chip->gpio_dir); spin_unlock_irqrestore(&chip->gpio_lock, flags); @@ -154,14 +154,14 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) /* Write state of GPIO signal */ if (val) - chip->gpio_state |= 1 << gpio; + chip->gpio_state |= BIT(gpio); else - chip->gpio_state &= ~(1 << gpio); + chip->gpio_state &= ~BIT(gpio); xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET, chip->gpio_state); /* Clear the GPIO bit in shadow register and set direction as output */ - chip->gpio_dir &= (~(1 << gpio)); + chip->gpio_dir &= ~BIT(gpio); xgpio_writereg(regs + chip->offset + XGPIO_TRI_OFFSET, chip->gpio_dir); spin_unlock_irqrestore(&chip->gpio_lock, flags); -- cgit v1.2.3-59-g8ed1b From 6090a0fa5cefe6cc0aa95786b21dcf1bf19942da Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 3 Jun 2013 14:31:21 +0200 Subject: DT: Add documentation for gpio-xilinx Describe gpio-xilinx binding. Signed-off-by: Michal Simek Signed-off-by: Linus Walleij --- .../devicetree/bindings/gpio/gpio-xilinx.txt | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-xilinx.txt diff --git a/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt b/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt new file mode 100644 index 000000000000..63bf4becd5f0 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt @@ -0,0 +1,48 @@ +Xilinx plb/axi GPIO controller + +Dual channel GPIO controller with configurable number of pins +(from 1 to 32 per channel). Every pin can be configured as +input/output/tristate. Both channels share the same global IRQ but +local interrupts can be enabled on channel basis. + +Required properties: +- compatible : Should be "xlnx,xps-gpio-1.00.a" +- reg : Address and length of the register set for the device +- #gpio-cells : Should be two. The first cell is the pin number and the + second cell is used to specify optional parameters (currently unused). +- gpio-controller : Marks the device node as a GPIO controller. + +Optional properties: +- interrupts : Interrupt mapping for GPIO IRQ. +- interrupt-parent : Phandle for the interrupt controller that + services interrupts for this device. +- xlnx,all-inputs : if n-th bit is setup, GPIO-n is input +- xlnx,dout-default : if n-th bit is 1, GPIO-n default value is 1 +- xlnx,gpio-width : gpio width +- xlnx,tri-default : if n-th bit is 1, GPIO-n is in tristate mode +- xlnx,is-dual : if 1, controller also uses the second channel +- xlnx,all-inputs-2 : as above but for the second channel +- xlnx,dout-default-2 : as above but the second channel +- xlnx,gpio2-width : as above but for the second channel +- xlnx,tri-default-2 : as above but for the second channel + + +Example: +gpio: gpio@40000000 { + #gpio-cells = <2>; + compatible = "xlnx,xps-gpio-1.00.a"; + gpio-controller ; + interrupt-parent = <µblaze_0_intc>; + interrupts = < 6 2 >; + reg = < 0x40000000 0x10000 >; + xlnx,all-inputs = <0x0>; + xlnx,all-inputs-2 = <0x0>; + xlnx,dout-default = <0x0>; + xlnx,dout-default-2 = <0x0>; + xlnx,gpio-width = <0x2>; + xlnx,gpio2-width = <0x2>; + xlnx,interrupt-present = <0x1>; + xlnx,is-dual = <0x1>; + xlnx,tri-default = <0xffffffff>; + xlnx,tri-default-2 = <0xffffffff>; +} ; -- cgit v1.2.3-59-g8ed1b From 78c7d8d289cf943ba7733a974b243650b2164f9e Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 3 Jun 2013 14:31:20 +0200 Subject: GPIO: xilinx: Enable driver for Xilinx zynq Enable gpio driver for usage on Xilinx ARM zynq platform. Signed-off-by: Michal Simek Signed-off-by: Linus Walleij --- drivers/gpio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index d133dd85443e..0d514f6af469 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -234,7 +234,7 @@ config GPIO_TS5500 config GPIO_XILINX bool "Xilinx GPIO support" - depends on PPC_OF || MICROBLAZE + depends on PPC_OF || MICROBLAZE || ARCH_ZYNQ help Say yes here to support the Xilinx FPGA GPIO device -- cgit v1.2.3-59-g8ed1b From 713b7ef835813c36e7a01ae18feac29b13082374 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Tue, 4 Jun 2013 17:48:36 +0200 Subject: gpio: devres: make comments proper The free-function mentioned "interrupt" instead of "GPIO". While we are here, use "GPIO" (capital letters) consistently. Signed-off-by: Wolfram Sang Signed-off-by: Linus Walleij --- drivers/gpio/devres.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c index 1077754f8289..3e7812f0405e 100644 --- a/drivers/gpio/devres.c +++ b/drivers/gpio/devres.c @@ -34,10 +34,10 @@ static int devm_gpio_match(struct device *dev, void *res, void *data) } /** - * devm_gpio_request - request a gpio for a managed device - * @dev: device to request the gpio for - * @gpio: gpio to allocate - * @label: the name of the requested gpio + * devm_gpio_request - request a GPIO for a managed device + * @dev: device to request the GPIO for + * @gpio: GPIO to allocate + * @label: the name of the requested GPIO * * Except for the extra @dev argument, this function takes the * same arguments and performs the same function as @@ -101,9 +101,9 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio, EXPORT_SYMBOL(devm_gpio_request_one); /** - * devm_gpio_free - free an interrupt - * @dev: device to free gpio for - * @gpio: gpio to free + * devm_gpio_free - free a GPIO + * @dev: device to free GPIO for + * @gpio: GPIO to free * * Except for the extra @dev argument, this function takes the * same arguments and performs the same function as gpio_free(). -- cgit v1.2.3-59-g8ed1b From 83bf2db916a53113dccaeb0bf306fe062fb3ca80 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Tue, 4 Jun 2013 12:20:00 -0700 Subject: gpio: msm-v1: Remove errant __devinit to fix compile Commit 7bce696 (gpio: Make gpio-msm-v1 into a platform driver, 2013-03-04) was based on an older kernel where __devinit still existed. Remove the erroneous __devinit marking. Cc: David Brown Signed-off-by: Stephen Boyd Signed-off-by: Linus Walleij --- drivers/gpio/gpio-msm-v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-msm-v1.c b/drivers/gpio/gpio-msm-v1.c index c798585a3fe5..fb2cc90d0134 100644 --- a/drivers/gpio/gpio-msm-v1.c +++ b/drivers/gpio/gpio-msm-v1.c @@ -630,7 +630,7 @@ static struct irq_chip msm_gpio_irq_chip = { .irq_set_type = msm_gpio_irq_set_type, }; -static int __devinit gpio_msm_v1_probe(struct platform_device *pdev) +static int gpio_msm_v1_probe(struct platform_device *pdev) { int i, j = 0; const struct platform_device_id *dev_id = platform_get_device_id(pdev); -- cgit v1.2.3-59-g8ed1b From ea4a21a298e1a9c4e5ea58309850477b2a19aa87 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 31 May 2013 17:59:46 +0200 Subject: gpio/omap: omap_gpio_init_context stub must be inline The bug fix 352a2d5bf "gpio/omap: ensure gpio context is initialised" has caused a new warning for omap1_defconfig: drivers/gpio/gpio-omap.c:1465:13: warning: 'omap_gpio_init_context' defined but not used [-Wunused-function] static void omap_gpio_init_context(struct gpio_bank *p) {} ^ The solution is to mark the stub function as 'static inline' so it gets left out of the build when unused. Signed-off-by: Arnd Bergmann Acked-by: Tony Lindgren Acked-by: Santosh Shilimkar Signed-off-by: Linus Walleij --- drivers/gpio/gpio-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index d3f7d2db870f..e5fba6576c75 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1462,7 +1462,7 @@ static void omap_gpio_restore_context(struct gpio_bank *bank) #else #define omap_gpio_runtime_suspend NULL #define omap_gpio_runtime_resume NULL -static void omap_gpio_init_context(struct gpio_bank *p) {} +static inline void omap_gpio_init_context(struct gpio_bank *p) {} #endif static const struct dev_pm_ops gpio_pm_ops = { -- cgit v1.2.3-59-g8ed1b From cd73891647a19f4b52f23d23f5c68175b93b56fe Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 12 Jun 2013 09:32:45 +0530 Subject: gpio-sta2x11: Fix potential NULL pointer dereference devm_kzalloc can return NULL. Check for it before dereferencing. Signed-off-by: Sachin Kamat Signed-off-by: Linus Walleij --- drivers/gpio/gpio-sta2x11.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c index 558542552aae..9b5564564bcd 100644 --- a/drivers/gpio/gpio-sta2x11.c +++ b/drivers/gpio/gpio-sta2x11.c @@ -371,6 +371,8 @@ static int gsta_probe(struct platform_device *dev) res = platform_get_resource(dev, IORESOURCE_MEM, 0); chip = devm_kzalloc(&dev->dev, sizeof(*chip), GFP_KERNEL); + if (!chip) + return -ENOMEM; chip->dev = &dev->dev; chip->reg_base = devm_request_and_ioremap(&dev->dev, res); -- cgit v1.2.3-59-g8ed1b From ae9550f635533b1ca5d0b50e24a720426ad237c6 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Mon, 17 Jun 2013 08:41:52 +0900 Subject: gpio-rcar: Use OUTDT when reading GPIOs configured as output Testing on r8a7790 shows that INDT does not indicate the correct pin state when reading a GPIO configured as output, so update the gpio_rcar_get() function to handle this case. Signed-off-by: Magnus Damm Signed-off-by: Linus Walleij --- drivers/gpio/gpio-rcar.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index b4ca450947b8..6b78ad96d3d4 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -214,7 +214,14 @@ static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset) static int gpio_rcar_get(struct gpio_chip *chip, unsigned offset) { - return (int)(gpio_rcar_read(gpio_to_priv(chip), INDT) & BIT(offset)); + u32 bit = BIT(offset); + + /* testing on r8a7790 shows that INDT does not show correct pin state + * when configured as output, so use OUTDT in case of output pins */ + if (gpio_rcar_read(gpio_to_priv(chip), INOUTSEL) & bit) + return (int)(gpio_rcar_read(gpio_to_priv(chip), OUTDT) & bit); + else + return (int)(gpio_rcar_read(gpio_to_priv(chip), INDT) & bit); } static void gpio_rcar_set(struct gpio_chip *chip, unsigned offset, int value) -- cgit v1.2.3-59-g8ed1b From 68515bbe76d6d274d8dc2ba3a57260154cef059d Mon Sep 17 00:00:00 2001 From: Tushar Behera Date: Mon, 10 Jun 2013 17:05:02 +0530 Subject: gpio_msm: Convert to use devm_ioremap_resource Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()") introduced devm_ioremap_resource() and deprecated the use of devm_request_and_ioremap(). Signed-off-by: Tushar Behera CC: linux-gpio@vger.kernel.org CC: Linus Walleij CC: Grant Likely Signed-off-by: Linus Walleij --- drivers/gpio/gpio-msm-v1.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-msm-v1.c b/drivers/gpio/gpio-msm-v1.c index fb2cc90d0134..e3ceaacde45c 100644 --- a/drivers/gpio/gpio-msm-v1.c +++ b/drivers/gpio/gpio-msm-v1.c @@ -652,14 +652,14 @@ static int gpio_msm_v1_probe(struct platform_device *pdev) return irq2; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base1 = devm_request_and_ioremap(&pdev->dev, res); - if (!base1) - return -EADDRNOTAVAIL; + base1 = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(base1)) + return PTR_ERR(base1); res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - base2 = devm_request_and_ioremap(&pdev->dev, res); - if (!base2) - return -EADDRNOTAVAIL; + base2 = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(base2)) + return PTR_ERR(base2); for (i = FIRST_GPIO_IRQ; i < FIRST_GPIO_IRQ + NR_GPIO_IRQS; i++) { if (i - FIRST_GPIO_IRQ >= -- cgit v1.2.3-59-g8ed1b From 62ffac141e82334ed0065c118b0544e23f3f5243 Mon Sep 17 00:00:00 2001 From: Tushar Behera Date: Mon, 10 Jun 2013 17:05:03 +0530 Subject: gpio-sta2x11: Convert to use devm_ioremap_resource Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()") introduced devm_ioremap_resource() and deprecated the use of devm_request_and_ioremap(). Signed-off-by: Tushar Behera CC: linux-gpio@vger.kernel.org CC: Grant Likely CC: Linus Walleij Signed-off-by: Linus Walleij --- drivers/gpio/gpio-sta2x11.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c index 9b5564564bcd..f43ab6aea281 100644 --- a/drivers/gpio/gpio-sta2x11.c +++ b/drivers/gpio/gpio-sta2x11.c @@ -374,7 +374,9 @@ static int gsta_probe(struct platform_device *dev) if (!chip) return -ENOMEM; chip->dev = &dev->dev; - chip->reg_base = devm_request_and_ioremap(&dev->dev, res); + chip->reg_base = devm_ioremap_resource(&dev->dev, res); + if (IS_ERR(chip->reg_base)) + return PTR_ERR(chip->reg_base); for (i = 0; i < GSTA_NR_BLOCKS; i++) { chip->regs[i] = chip->reg_base + i * 4096; -- cgit v1.2.3-59-g8ed1b From 7f6569f54695c18e13be2c538834fdd0fad1d3a6 Mon Sep 17 00:00:00 2001 From: Vincent Donnefort Date: Mon, 17 Jun 2013 14:03:49 +0200 Subject: gpio: ich: add GPO_BLINK support This patch makes sure blink hardware is disabled for selected GPIO. Blink hardware is controled by GPO_BLINK register and is available for GPIOs from 0 to 31. Signed-off-by: Vincent Donnefort Signed-off-by: Linus Walleij --- drivers/gpio/gpio-ich.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c index e16d932fd444..2729e3d2d5bb 100644 --- a/drivers/gpio/gpio-ich.c +++ b/drivers/gpio/gpio-ich.c @@ -41,12 +41,14 @@ enum GPIO_REG { GPIO_USE_SEL = 0, GPIO_IO_SEL, GPIO_LVL, + GPO_BLINK }; -static const u8 ichx_regs[3][3] = { +static const u8 ichx_regs[4][3] = { {0x00, 0x30, 0x40}, /* USE_SEL[1-3] offsets */ {0x04, 0x34, 0x44}, /* IO_SEL[1-3] offsets */ {0x0c, 0x38, 0x48}, /* LVL[1-3] offsets */ + {0x18, 0x18, 0x18}, /* BLINK offset */ }; static const u8 ichx_reglen[3] = { @@ -148,6 +150,10 @@ static int ichx_gpio_direction_input(struct gpio_chip *gpio, unsigned nr) static int ichx_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, int val) { + /* Disable blink hardware which is available for GPIOs from 0 to 31. */ + if (nr < 32) + ichx_write_bit(GPO_BLINK, nr, 0, 0); + /* Set GPIO output value. */ ichx_write_bit(GPIO_LVL, nr, val, 0); -- cgit v1.2.3-59-g8ed1b From 10b20a931c74a828bd02b5b879223a3d51cb4985 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Mon, 17 Jun 2013 16:57:06 +0300 Subject: gpio-langwell: remove Withney point support It seems there is no user of the wp_gpio driver in the kernel. Let's remove it. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Linus Walleij --- drivers/gpio/gpio-langwell.c | 69 +------------------------------------------- 1 file changed, 1 insertion(+), 68 deletions(-) diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c index fec85ca89c58..f4b72456faaf 100644 --- a/drivers/gpio/gpio-langwell.c +++ b/drivers/gpio/gpio-langwell.c @@ -20,7 +20,6 @@ /* Supports: * Moorestown platform Langwell chip. * Medfield platform Penwell chip. - * Whitney point. */ #include @@ -394,75 +393,9 @@ static struct pci_driver lnw_gpio_driver = { }, }; - -static int wp_gpio_probe(struct platform_device *pdev) -{ - struct lnw_gpio *lnw; - struct gpio_chip *gc; - struct resource *rc; - int retval; - - lnw = devm_kzalloc(&pdev->dev, sizeof(struct lnw_gpio), GFP_KERNEL); - if (!lnw) { - dev_err(&pdev->dev, "can't allocate chip data\n"); - return -ENOMEM; - } - - rc = platform_get_resource(pdev, IORESOURCE_MEM, 0); - lnw->reg_base = devm_ioremap_resource(&pdev->dev, rc); - if (IS_ERR(lnw->reg_base)) - return PTR_ERR(lnw->reg_base); - - spin_lock_init(&lnw->lock); - gc = &lnw->chip; - gc->label = dev_name(&pdev->dev); - gc->owner = THIS_MODULE; - gc->direction_input = lnw_gpio_direction_input; - gc->direction_output = lnw_gpio_direction_output; - gc->get = lnw_gpio_get; - gc->set = lnw_gpio_set; - gc->to_irq = NULL; - gc->base = 0; - gc->ngpio = 64; - gc->can_sleep = 0; - retval = gpiochip_add(gc); - if (retval) { - dev_err(&pdev->dev, "gpiochip_add error %d\n", retval); - return retval; - } - platform_set_drvdata(pdev, lnw); - return 0; -} - -static int wp_gpio_remove(struct platform_device *pdev) -{ - struct lnw_gpio *lnw = platform_get_drvdata(pdev); - int err; - err = gpiochip_remove(&lnw->chip); - if (err) - dev_err(&pdev->dev, "failed to remove gpio_chip.\n"); - return 0; -} - -static struct platform_driver wp_gpio_driver = { - .probe = wp_gpio_probe, - .remove = wp_gpio_remove, - .driver = { - .name = "wp_gpio", - .owner = THIS_MODULE, - }, -}; - static int __init lnw_gpio_init(void) { - int ret; - ret = pci_register_driver(&lnw_gpio_driver); - if (ret < 0) - return ret; - ret = platform_driver_register(&wp_gpio_driver); - if (ret < 0) - pci_unregister_driver(&lnw_gpio_driver); - return ret; + return pci_register_driver(&lnw_gpio_driver); } device_initcall(lnw_gpio_init); -- cgit v1.2.3-59-g8ed1b From 61e3884ec1b41ebd0395e7faf856592f228c8724 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Tue, 18 Jun 2013 17:07:03 +0530 Subject: gpio: grgpio: Staticize local symbols Local symbols accessed only in this file are made static. Signed-off-by: Sachin Kamat Acked-by: Andreas Larsson Signed-off-by: Linus Walleij --- drivers/gpio/gpio-grgpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c index 8e08b8647655..84d2478ec294 100644 --- a/drivers/gpio/gpio-grgpio.c +++ b/drivers/gpio/gpio-grgpio.c @@ -235,8 +235,8 @@ static irqreturn_t grgpio_irq_handler(int irq, void *dev) * This function will be called as a consequence of the call to * irq_create_mapping in grgpio_to_irq */ -int grgpio_irq_map(struct irq_domain *d, unsigned int irq, - irq_hw_number_t hwirq) +static int grgpio_irq_map(struct irq_domain *d, unsigned int irq, + irq_hw_number_t hwirq) { struct grgpio_priv *priv = d->host_data; struct grgpio_lirq *lirq; @@ -291,7 +291,7 @@ int grgpio_irq_map(struct irq_domain *d, unsigned int irq, return ret; } -void grgpio_irq_unmap(struct irq_domain *d, unsigned int irq) +static void grgpio_irq_unmap(struct irq_domain *d, unsigned int irq) { struct grgpio_priv *priv = d->host_data; int index; -- cgit v1.2.3-59-g8ed1b From 3bae4811fb6d0b2849e3129abaf9c116f956c7a3 Mon Sep 17 00:00:00 2001 From: Zhangfei Gao Date: Sun, 9 Jun 2013 11:08:32 +0800 Subject: gpiolib: remove warnning of allocations with IRQs disabled Move of_gpiochip_add outof spin_lock, since kzalloc inside of_gpiochip_add -> of_gpiochip_add_pin_range -> gpiochip_add_pin_range -> kzalloc WARNING: at kernel/lockdep.c:2740 lockdep_trace_alloc+0xf8/0xfc() DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags)) Signed-off-by: Zhangfei Gao Signed-off-by: Linus Walleij --- drivers/gpio/gpiolib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index c2534d62911c..ff0fd655729f 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1214,15 +1214,14 @@ int gpiochip_add(struct gpio_chip *chip) } } + spin_unlock_irqrestore(&gpio_lock, flags); + #ifdef CONFIG_PINCTRL INIT_LIST_HEAD(&chip->pin_ranges); #endif of_gpiochip_add(chip); -unlock: - spin_unlock_irqrestore(&gpio_lock, flags); - if (status) goto fail; @@ -1235,6 +1234,9 @@ unlock: chip->label ? : "generic"); return 0; + +unlock: + spin_unlock_irqrestore(&gpio_lock, flags); fail: /* failures here can mean systems won't boot... */ pr_err("gpiochip_add: gpios %d..%d (%s) failed to register\n", -- cgit v1.2.3-59-g8ed1b From 038f0babc98a16211959010d7cd48b4a14f108cc Mon Sep 17 00:00:00 2001 From: Yijing Wang Date: Thu, 27 Jun 2013 20:58:55 +0800 Subject: Gpio/trivial: replace numeric with standard PM state macros Use standard PM state macros PCI_Dx instead of numeric 0/1/2.. Signed-off-by: Yijing Wang Cc: Michael Buesch Cc: Grant Likely Cc: Linus Walleij Cc: Jiri Kosina Cc: linux-kernel@vger.kernel.org Signed-off-by: Linus Walleij --- drivers/gpio/gpio-bt8xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-bt8xx.c b/drivers/gpio/gpio-bt8xx.c index 7d9d7cb35f28..8369e71ebe4f 100644 --- a/drivers/gpio/gpio-bt8xx.c +++ b/drivers/gpio/gpio-bt8xx.c @@ -286,7 +286,7 @@ static int bt8xxgpio_resume(struct pci_dev *pdev) unsigned long flags; int err; - pci_set_power_state(pdev, 0); + pci_set_power_state(pdev, PCI_D0); err = pci_enable_device(pdev); if (err) return err; -- cgit v1.2.3-59-g8ed1b