Headphone jack detection reversed with nau8824

I have an Intel CherryTrail laptop with a nau8824 sound card . When I have the headphones plugged in then it shows this :
ports:
[Out] Headphones: Headphones (priority 200, latency offset 0 usec, available: no)
properties:

	[Out] Speaker: Speaker (priority 100, latency offset 0 usec, available: unknown)
		properties:
			
active port: <[Out] Speaker>

and when unplugged:
ports:
[Out] Headphones: Headphones (priority 200, latency offset 0 usec, available: yes)
properties:

	[Out] Speaker: Speaker (priority 100, latency offset 0 usec, available: unknown)
		properties:
			
active port: <[Out] Headphones>

It’s exactly the other way around that it really is. Is the nau driver handling the hack detection ? I think pulse or also is just looking somewhere in /sys , right ?
I want to get this fixed but I want to pinpoint the issue first. Any help would be appreciated. Thanks.

The full outputs from pacmd list-sinks .

plugged in:

unplugged:

I have three laptops with the nau8824 sound card. I updated two of them to the latest kernel (5.12) and the audio no longer shows the sound card at all. (I did not update the third one)

Any suggestions?
I checked the loaded kernel modules and snd_soc_nau8824 appears to be loaded. Other than that, I’m at a loss…

I personally gave up on this as I’ve been using wireless headphone that has a USB dongle.

Inverted jack detection can be corrected in the codec parser with a Hint String that can be added using tool hdajackretask

  1. Install package alsa-tools - `pamac install alsa-tools

  2. Run retasking tool with root privileges – sudo hdajackretask

  3. Enable Parser hints in Options
    and double-click on inv_jack_detect in Hints to change value to yes

  1. Click Install Boot override

  2. Reboot system to load boot override

More Notes on HD-Audio Driver - Hint Strings — The Linux Kernel documentation