Pin control fixes for the v5.17 series
These two fixes should fix the issues seen on the OrangePi, first we needed the correct offset when calling pinctrl_gpio_direction(), and fixing that made a lockdep issue explode in our face. Both now fixed. -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmIhULsACgkQQRCzN7AZ XXOJZg/+JpIXrmql9Rs+ZhXxJfLooYs+4Lx+PLijJ06Mvkl1Zk5FjYhPwl3Nx2cp 9I+c9Pu5+H67NQIGwBJmKrNYpkypDBM+tDCK0fn5ol2jdq0CH58HhF//8ucIjGlT VXE4MUMwsCt4wyLoMrgC2P3jJ3uTZn6fdg2IVMKxiDQfi+9yQn4VgrLty7KhGSbo g1W2HbSWf+lNgue++Hf2yCgndfRGZo43Ic+kOWb6kgQHN32biWO5pHTifsJB/hJq emJDzwWsnRa3ZUIRE1hv5FaErfJK1GPJF1mRjPcYckkkhIos44KSuDGEgThSJOFi AE0svvlA5m5AaWmSseCzRQb0kg+glwd5nDJ0ZWEY2IWlyrnld7OH6cv6wfLfLVLC TuTql/EBJrobXjgBvPKkFy/wd1yV9fVmtBWeDMaisdTFY9ws++O5snXhL0d/tE+7 oZXFceQzZ4/wsELgSpCzHGYFpLDYqWzZ7pE4zjELei/KCA3HWJuVsY8V47v9etgJ ku6dmPSu+xxzN6a113UdOBHNtM5ZfPgIvQ5/Wi7jXsRAEXuoVIzT8WCxv1HoujQj VrDhGnqpp6xn5QW/ABcO33H1kCJgmyusRsY9DRn3p/6ar/u9JUi3yuOXy6QEyXOu nnM4XLIexMuaIwCfc36xiimfLtW7Eux8pZRaCzAVTFlyVF7S5Cw= =7ZC5 -----END PGP SIGNATURE----- Merge tag 'pinctrl-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "These two fixes should fix the issues seen on the OrangePi, first we needed the correct offset when calling pinctrl_gpio_direction(), and fixing that made a lockdep issue explode in our face. Both now fixed" * tag 'pinctrl-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: sunxi: Use unique lockdep classes for IRQs pinctrl-sunxi: sunxi_pinctrl_gpio_direction_in/output: use correct offset
This commit is contained in:
commit
0b7344a658
@ -36,6 +36,13 @@
|
||||
#include "../core.h"
|
||||
#include "pinctrl-sunxi.h"
|
||||
|
||||
/*
|
||||
* These lock classes tell lockdep that GPIO IRQs are in a different
|
||||
* category than their parents, so it won't report false recursion.
|
||||
*/
|
||||
static struct lock_class_key sunxi_pinctrl_irq_lock_class;
|
||||
static struct lock_class_key sunxi_pinctrl_irq_request_class;
|
||||
|
||||
static struct irq_chip sunxi_pinctrl_edge_irq_chip;
|
||||
static struct irq_chip sunxi_pinctrl_level_irq_chip;
|
||||
|
||||
@ -837,7 +844,8 @@ static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip,
|
||||
{
|
||||
struct sunxi_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
|
||||
return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, true);
|
||||
return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL,
|
||||
chip->base + offset, true);
|
||||
}
|
||||
|
||||
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,
|
||||
struct sunxi_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
|
||||
sunxi_pinctrl_gpio_set(chip, offset, value);
|
||||
return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, false);
|
||||
return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL,
|
||||
chip->base + offset, false);
|
||||
}
|
||||
|
||||
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,
|
||||
for (i = 0; i < (pctl->desc->irq_banks * IRQ_PER_BANK); i++) {
|
||||
int irqno = irq_create_mapping(pctl->domain, i);
|
||||
|
||||
irq_set_lockdep_class(irqno, &sunxi_pinctrl_irq_lock_class,
|
||||
&sunxi_pinctrl_irq_request_class);
|
||||
irq_set_chip_and_handler(irqno, &sunxi_pinctrl_edge_irq_chip,
|
||||
handle_edge_irq);
|
||||
irq_set_chip_data(irqno, pctl);
|
||||
|
Loading…
Reference in New Issue
Block a user