gpio fixes for v6.8-rc2

- add a quirk to GPIO ACPI handling to ignore touchpad wakeups
   on GPD G1619-04
 - clear interrupt status bits (that may have been set before enabling
   the interrupts) after setting the interrupt type in gpio-eic-sprd
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmWzpkkACgkQEacuoBRx
 13JGvxAA2rikf+Zn0oKjh2lJUno6/CLQgHqwDut2ZzveW9EVw5+HCLiq/kI3DVnx
 lmFH0gT8XhGQRF40+zSnNRITFL1kyAhnPOdkvWbB6I/lWOrl2QDHm7TDeZiNhnjB
 IJA4KjJe+1TF+148f/NFR/HcTPIYPEEsiYdPvDBCBAD9vkT7ki5RziVYl6P04cs6
 XNhbats5LPFqhaHepcTd31aBN/l86GqmDYZeNukwb8h17uXAPIpmvqGvM/RGhCM+
 ZLsIOK2LFcmXty0BXzgxHGLqGqxJCAZuz8RQSnLFJK311eAEyQa6U19/UPBvtRiB
 U9sT9ciIYPCaUxkI8HfgBmQ3wfu6s9AojiYTyZH4WZA6MybKauW2T1bVssdy4ojL
 yTpW6HM/84EEVFUXGJ4L2woSihvIHiIptXz6aHbByrkMSNogMYGTWQ05q9AO5KNQ
 NK2nj2XOss3LN9mIe4Xuv5KxR+VSuFAwnNDIQb1kBlt07YaIDuC3lwKzzZNtUhCm
 ZJpQLQyTTXVHylTY2SVTIdmFlpyIfqcaePjxPvvtpr+tKUWugJhSephC7A2GKwoo
 don0cEvsG23lDI2wgL0PZwZkc02AHNXINBX1KpghzGlTe9njO3/RsmWdkCe7elDp
 CuVf6X7BJF9UcaVkWnrbgn2FWa4bpIYjKgRfiQlguGiX5xU5iCg=
 =CWRK
 -----END PGP SIGNATURE-----

Merge tag 'gpio-fixes-for-v6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

 - add a quirk to GPIO ACPI handling to ignore touchpad wakeups on GPD
   G1619-04

 - clear interrupt status bits (that may have been set before enabling
   the interrupts) after setting the interrupt type in gpio-eic-sprd

* tag 'gpio-fixes-for-v6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: eic-sprd: Clear interrupt after set the interrupt type
  gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04
This commit is contained in:
Linus Torvalds 2024-01-26 12:26:02 -08:00
commit 5f91b9ba5a
2 changed files with 42 additions and 4 deletions

View File

@ -330,20 +330,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
switch (flow_type) {
case IRQ_TYPE_LEVEL_HIGH:
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 1);
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
break;
case IRQ_TYPE_LEVEL_LOW:
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 0);
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
break;
case IRQ_TYPE_EDGE_RISING:
case IRQ_TYPE_EDGE_FALLING:
case IRQ_TYPE_EDGE_BOTH:
state = sprd_eic_get(chip, offset);
if (state)
if (state) {
sprd_eic_update(chip, offset,
SPRD_EIC_DBNC_IEV, 0);
else
sprd_eic_update(chip, offset,
SPRD_EIC_DBNC_IC, 1);
} else {
sprd_eic_update(chip, offset,
SPRD_EIC_DBNC_IEV, 1);
sprd_eic_update(chip, offset,
SPRD_EIC_DBNC_IC, 1);
}
break;
default:
return -ENOTSUPP;
@ -355,20 +362,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
switch (flow_type) {
case IRQ_TYPE_LEVEL_HIGH:
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 0);
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
break;
case IRQ_TYPE_LEVEL_LOW:
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 1);
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
break;
case IRQ_TYPE_EDGE_RISING:
case IRQ_TYPE_EDGE_FALLING:
case IRQ_TYPE_EDGE_BOTH:
state = sprd_eic_get(chip, offset);
if (state)
if (state) {
sprd_eic_update(chip, offset,
SPRD_EIC_LATCH_INTPOL, 0);
else
sprd_eic_update(chip, offset,
SPRD_EIC_LATCH_INTCLR, 1);
} else {
sprd_eic_update(chip, offset,
SPRD_EIC_LATCH_INTPOL, 1);
sprd_eic_update(chip, offset,
SPRD_EIC_LATCH_INTCLR, 1);
}
break;
default:
return -ENOTSUPP;
@ -382,29 +396,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
irq_set_handler_locked(data, handle_edge_irq);
break;
case IRQ_TYPE_EDGE_FALLING:
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
irq_set_handler_locked(data, handle_edge_irq);
break;
case IRQ_TYPE_EDGE_BOTH:
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
irq_set_handler_locked(data, handle_edge_irq);
break;
case IRQ_TYPE_LEVEL_HIGH:
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
irq_set_handler_locked(data, handle_level_irq);
break;
case IRQ_TYPE_LEVEL_LOW:
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
irq_set_handler_locked(data, handle_level_irq);
break;
default:
@ -417,29 +436,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
irq_set_handler_locked(data, handle_edge_irq);
break;
case IRQ_TYPE_EDGE_FALLING:
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
irq_set_handler_locked(data, handle_edge_irq);
break;
case IRQ_TYPE_EDGE_BOTH:
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
irq_set_handler_locked(data, handle_edge_irq);
break;
case IRQ_TYPE_LEVEL_HIGH:
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
irq_set_handler_locked(data, handle_level_irq);
break;
case IRQ_TYPE_LEVEL_LOW:
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
irq_set_handler_locked(data, handle_level_irq);
break;
default:

View File

@ -1651,6 +1651,20 @@ static const struct dmi_system_id gpiolib_acpi_quirks[] __initconst = {
.ignore_interrupt = "INT33FC:00@3",
},
},
{
/*
* Spurious wakeups from TP_ATTN# pin
* Found in BIOS 0.35
* https://gitlab.freedesktop.org/drm/amd/-/issues/3073
*/
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "GPD"),
DMI_MATCH(DMI_PRODUCT_NAME, "G1619-04"),
},
.driver_data = &(struct acpi_gpiolib_dmi_quirk) {
.ignore_wake = "PNP0C50:00@8",
},
},
{} /* Terminating entry */
};