|
36 | 36 | #include "../core.h"
|
37 | 37 | #include "pinctrl-sunxi.h"
|
38 | 38 |
|
| 39 | +/* |
| 40 | + * These lock classes tell lockdep that GPIO IRQs are in a different |
| 41 | + * category than their parents, so it won't report false recursion. |
| 42 | + */ |
| 43 | +static struct lock_class_key sunxi_pinctrl_irq_lock_class; |
| 44 | +static struct lock_class_key sunxi_pinctrl_irq_request_class; |
| 45 | + |
39 | 46 | static struct irq_chip sunxi_pinctrl_edge_irq_chip;
|
40 | 47 | static struct irq_chip sunxi_pinctrl_level_irq_chip;
|
41 | 48 |
|
@@ -837,7 +844,8 @@ static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip,
|
837 | 844 | {
|
838 | 845 | struct sunxi_pinctrl *pctl = gpiochip_get_data(chip);
|
839 | 846 |
|
840 |
| - return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, true); |
| 847 | + return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, |
| 848 | + chip->base + offset, true); |
841 | 849 | }
|
842 | 850 |
|
843 | 851 | static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset)
|
@@ -890,7 +898,8 @@ static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip,
|
890 | 898 | struct sunxi_pinctrl *pctl = gpiochip_get_data(chip);
|
891 | 899 |
|
892 | 900 | sunxi_pinctrl_gpio_set(chip, offset, value);
|
893 |
| - return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, false); |
| 901 | + return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, |
| 902 | + chip->base + offset, false); |
894 | 903 | }
|
895 | 904 |
|
896 | 905 | static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
|
@@ -1555,6 +1564,8 @@ int sunxi_pinctrl_init_with_variant(struct platform_device *pdev,
|
1555 | 1564 | for (i = 0; i < (pctl->desc->irq_banks * IRQ_PER_BANK); i++) {
|
1556 | 1565 | int irqno = irq_create_mapping(pctl->domain, i);
|
1557 | 1566 |
|
| 1567 | + irq_set_lockdep_class(irqno, &sunxi_pinctrl_irq_lock_class, |
| 1568 | + &sunxi_pinctrl_irq_request_class); |
1558 | 1569 | irq_set_chip_and_handler(irqno, &sunxi_pinctrl_edge_irq_chip,
|
1559 | 1570 | handle_edge_irq);
|
1560 | 1571 | irq_set_chip_data(irqno, pctl);
|
|
0 commit comments