Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'gpio-v3.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull gpio fixes from Linus Walleij:

- a largeish fix for the IRQ handling in the new Zynq driver. The
quite verbose commit message gives the exact details.
- move some defines for gpiod flags outside an ifdef to make stub
functions work again.
- various minor fixes that we can accept for -rc1.

* tag 'gpio-v3.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
gpio-lynxpoint: enable input sensing in resume
gpio: move GPIOD flags outside #ifdef
gpio: delete unneeded test before of_node_put
gpio: zynq: Fix IRQ handlers
gpiolib: devres: use correct structure type name in sizeof
MAINTAINERS: Change maintainer for gpio-bcm-kona.c

+51 -15
+1 -1
MAINTAINERS
··· 2065 2065 F: drivers/scsi/bnx2i/ 2066 2066 2067 2067 BROADCOM KONA GPIO DRIVER 2068 - M: Markus Mayer <markus.mayer@linaro.org> 2068 + M: Ray Jui <rjui@broadcom.com> 2069 2069 L: bcm-kernel-feedback-list@broadcom.com 2070 2070 S: Supported 2071 2071 F: drivers/gpio/gpio-bcm-kona.c
+1 -1
drivers/gpio/devres.c
··· 90 90 struct gpio_desc **dr; 91 91 struct gpio_desc *desc; 92 92 93 - dr = devres_alloc(devm_gpiod_release, sizeof(struct gpiod_desc *), 93 + dr = devres_alloc(devm_gpiod_release, sizeof(struct gpio_desc *), 94 94 GFP_KERNEL); 95 95 if (!dr) 96 96 return ERR_PTR(-ENOMEM);
+18
drivers/gpio/gpio-lynxpoint.c
··· 407 407 return 0; 408 408 } 409 409 410 + static int lp_gpio_resume(struct device *dev) 411 + { 412 + struct platform_device *pdev = to_platform_device(dev); 413 + struct lp_gpio *lg = platform_get_drvdata(pdev); 414 + unsigned long reg; 415 + int i; 416 + 417 + /* on some hardware suspend clears input sensing, re-enable it here */ 418 + for (i = 0; i < lg->chip.ngpio; i++) { 419 + if (gpiochip_is_requested(&lg->chip, i) != NULL) { 420 + reg = lp_gpio_reg(&lg->chip, i, LP_CONFIG2); 421 + outl(inl(reg) & ~GPINDIS_BIT, reg); 422 + } 423 + } 424 + return 0; 425 + } 426 + 410 427 static const struct dev_pm_ops lp_gpio_pm_ops = { 411 428 .runtime_suspend = lp_gpio_runtime_suspend, 412 429 .runtime_resume = lp_gpio_runtime_resume, 430 + .resume = lp_gpio_resume, 413 431 }; 414 432 415 433 static const struct acpi_device_id lynxpoint_gpio_acpi_match[] = {
+28 -8
drivers/gpio/gpio-zynq.c
··· 95 95 struct clk *clk; 96 96 }; 97 97 98 + static struct irq_chip zynq_gpio_level_irqchip; 99 + static struct irq_chip zynq_gpio_edge_irqchip; 100 + 98 101 /** 99 102 * zynq_gpio_get_bank_pin - Get the bank number and pin number within that bank 100 103 * for a given pin in the GPIO device ··· 413 410 gpio->base_addr + ZYNQ_GPIO_INTPOL_OFFSET(bank_num)); 414 411 writel_relaxed(int_any, 415 412 gpio->base_addr + ZYNQ_GPIO_INTANY_OFFSET(bank_num)); 413 + 414 + if (type & IRQ_TYPE_LEVEL_MASK) { 415 + __irq_set_chip_handler_name_locked(irq_data->irq, 416 + &zynq_gpio_level_irqchip, handle_fasteoi_irq, NULL); 417 + } else { 418 + __irq_set_chip_handler_name_locked(irq_data->irq, 419 + &zynq_gpio_edge_irqchip, handle_level_irq, NULL); 420 + } 421 + 416 422 return 0; 417 423 } 418 424 ··· 436 424 } 437 425 438 426 /* irq chip descriptor */ 439 - static struct irq_chip zynq_gpio_irqchip = { 427 + static struct irq_chip zynq_gpio_level_irqchip = { 440 428 .name = DRIVER_NAME, 441 429 .irq_enable = zynq_gpio_irq_enable, 430 + .irq_eoi = zynq_gpio_irq_ack, 431 + .irq_mask = zynq_gpio_irq_mask, 432 + .irq_unmask = zynq_gpio_irq_unmask, 433 + .irq_set_type = zynq_gpio_set_irq_type, 434 + .irq_set_wake = zynq_gpio_set_wake, 435 + .flags = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED, 436 + }; 437 + 438 + static struct irq_chip zynq_gpio_edge_irqchip = { 439 + .name = DRIVER_NAME, 440 + .irq_enable = zynq_gpio_irq_enable, 441 + .irq_ack = zynq_gpio_irq_ack, 442 442 .irq_mask = zynq_gpio_irq_mask, 443 443 .irq_unmask = zynq_gpio_irq_unmask, 444 444 .irq_set_type = zynq_gpio_set_irq_type, ··· 493 469 offset); 494 470 generic_handle_irq(gpio_irq); 495 471 } 496 - 497 - /* clear IRQ in HW */ 498 - writel_relaxed(int_sts, gpio->base_addr + 499 - ZYNQ_GPIO_INTSTS_OFFSET(bank_num)); 500 472 } 501 473 } 502 474 ··· 630 610 writel_relaxed(ZYNQ_GPIO_IXR_DISABLE_ALL, gpio->base_addr + 631 611 ZYNQ_GPIO_INTDIS_OFFSET(bank_num)); 632 612 633 - ret = gpiochip_irqchip_add(chip, &zynq_gpio_irqchip, 0, 634 - handle_simple_irq, IRQ_TYPE_NONE); 613 + ret = gpiochip_irqchip_add(chip, &zynq_gpio_edge_irqchip, 0, 614 + handle_level_irq, IRQ_TYPE_NONE); 635 615 if (ret) { 636 616 dev_err(&pdev->dev, "Failed to add irq chip\n"); 637 617 goto err_rm_gpiochip; 638 618 } 639 619 640 - gpiochip_set_chained_irqchip(chip, &zynq_gpio_irqchip, irq, 620 + gpiochip_set_chained_irqchip(chip, &zynq_gpio_edge_irqchip, irq, 641 621 zynq_gpio_irqhandler); 642 622 643 623 pm_runtime_set_active(&pdev->dev);
+1 -3
drivers/gpio/gpiolib-of.c
··· 307 307 void of_gpiochip_remove(struct gpio_chip *chip) 308 308 { 309 309 gpiochip_remove_pin_ranges(chip); 310 - 311 - if (chip->of_node) 312 - of_node_put(chip->of_node); 310 + of_node_put(chip->of_node); 313 311 }
+2 -2
include/linux/gpio/consumer.h
··· 16 16 */ 17 17 struct gpio_desc; 18 18 19 - #ifdef CONFIG_GPIOLIB 20 - 21 19 #define GPIOD_FLAGS_BIT_DIR_SET BIT(0) 22 20 #define GPIOD_FLAGS_BIT_DIR_OUT BIT(1) 23 21 #define GPIOD_FLAGS_BIT_DIR_VAL BIT(2) ··· 31 33 GPIOD_OUT_HIGH = GPIOD_FLAGS_BIT_DIR_SET | GPIOD_FLAGS_BIT_DIR_OUT | 32 34 GPIOD_FLAGS_BIT_DIR_VAL, 33 35 }; 36 + 37 + #ifdef CONFIG_GPIOLIB 34 38 35 39 /* Acquire and dispose GPIOs */ 36 40 struct gpio_desc *__must_check __gpiod_get(struct device *dev,