It seems that many ASoC drivers do not create kctls - the argument pins is zero in the snd_soc_card_jack_new() call. The SND_JACK_HEADSET should be remapped to kctl in sound/soc/intel/boards/sof_rt5682.c, too.
Did you mean something like the patch below Jaroslav? If yes, most of the Chromebook machine drivers are missing this remapping. That would also explain why the jack detection didn't work on my GLK test device, despite a UCM file that looked good...
Yes, it looks like a way to go. It seems that the drivers were tested only with the CRAS audio server. Note that pulseaudio can be run with the user permissions only - thus the input devices may not be reachable.
I added a similar patch on a GeminiLake device, and it does help with jack detection (along with an update in https://github.com/alsa-project/alsa-ucm-conf/pull/150).
I can see PulseAudio detecting the changes, but for some reason the automatic switch only happens when the jack is unplugged. I still have to manually select the headphone/headset after plugging it in. Likely still missing something in the UCM file?
D: [pulseaudio] module-alsa-card.c: Jack 'Headphone Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port [Out] Headphone to status no
D: [pulseaudio] module-switch-on-port-available.c: Trying to switch away from port [Out] Headphone, found [Out] Speaker
D: [pulseaudio] module-alsa-card.c: Jack 'Headset Mic Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port [In] Headset to status no
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
D: [pulseaudio] module-switch-on-port-available.c: Trying to switch away from port [In] Headset, found [In] InternalMic
<<< AUTOMATIC SWITCH DONE
D: [pulseaudio] module-alsa-card.c: Jack 'Headphone Jack' is now plugged in
D: [pulseaudio] device-port.c: Setting port [Out] Headphone to status yes
D: [pulseaudio] module-alsa-card.c: Jack 'Headset Mic Jack' is now plugged in
D: [pulseaudio] device-port.c: Setting port [In] Headset to status yes
<<< NOTHING HAPPENS HERE
D: [pulseaudio] module-alsa-card.c: Jack 'Headphone Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port [Out] Headphone to status no
D: [pulseaudio] module-switch-on-port-available.c: Trying to switch away from port [Out] Headphone, found [Out] Speaker
D: [pulseaudio] module-alsa-card.c: Jack 'Headset Mic Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port [In] Headset to status no
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
D: [pulseaudio] module-switch-on-port-available.c: Trying to switch away from port [In] Headset, found [In] InternalMic