AsahiLinux / linux

Linux kernel source tree
Other
2.35k stars 90 forks source link

cs42l84: add basic handling of ring sense interrupts #330

Closed chadmed closed 1 month ago

chadmed commented 1 month ago

Supersedes #328 and serves the same purpose. If users are unfortunate with their timing when inserting a 3.5mm jack, the trigger-happy tip sense line on these machines will misdetect the thing they're plugging in. We can use ring sense to force re-detection if and only if tip sense doesn't change, but the ring sense line detects a change in plug state. Typically, this will only occur in cases where we have finished handling the tip sense IRQ before the plug was fully seated.

chadmed commented 1 month ago

Something I have considered is getting rid of the detection entirely on tip sense and just using it to "arm" ring sense by unmasking ring sense interrupts, then only doing detection on ring sense. This will avoid having to run detection twice on dodgy connections.

jannau commented 1 month ago

pulled manually into asahi-6.11.2-1