On Wed, 08 May 2019 10:59:53 +0200, Mark Brown wrote: > > On Wed, May 08, 2019 at 10:16:06AM +0200, Takashi Iwai wrote: > > Mark Brown wrote: > > > > The GPIO/IRQ equivalence thing should just be a purely Linux internal > > > thing - looking at the driver it appears that there's no need to look at > > > the GPIO status, Linux can tell if something is plugged in purely by > > > reading the chip registers so the jack status function could directly be > > > the interrupt handler. > > > But it can't see the button status or detect the headset type without > > reading the codec's magic registers... So some help from the codec > > side is required, and the irq handler isn't in the codec side because > > The whole thing should be in the CODEC side. > > > there is no i2c irq assigned but only ACPI gpio, as far as I checked. > > You can map through an ACPI GPIO to an interrupt without worrying about > the fact that it's mapped as a GPIO in ACPI IIRC - if you can't there's > lots of other drivers are going to have issues. But what gives a benefit? It needs more plumbing between codec and machine driver. The i2c probe doesn't give the irq, so you'd need and extra stuff to enable the irq in a different route if you'd need to implement the handler in the codec driver. Actually, my latest patchset already eliminates the exported stuff by moving to set_jack callback like some other drivers do. If you have an idea for further simplification / fixes, let me know. I haven't submitted because of the merge window. The patch is found at topic/soc-cx2072x-5.2 branch, the commit is https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=topic/soc-cx2072x-5.2&id=ca7f4eee5ecbefcf347f5a4984c0a17629360186 thanks, Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxx https://mailman.alsa-project.org/mailman/listinfo/alsa-devel