Jack detection using J511 pin 10 AUD_HP_JD (call sens2_Ret by intel)

I would like to detect if an audio jack is pluged in/out using the detection pin on the j511 from the Nvidia AGX xavier (Kernel version 4.9.140).
If I put this pin to GND, the only way I found to detect the state changement is to use the hexdump command:

/home/install# hexdump /dev/input/event4
0000000 7346 5df2 0000 0000 bd34 0003 0000 0000
0000010 0005 0002 0000 0000 7346 5df2 0000 0000
0000020 bd34 0003 0000 0000 0000 0000 0000 0000

0000030 7346 5df2 0000 0000 2c0e 000e 0000 0000
0000040 0005 0002 0001 0000 7346 5df2 0000 0000
0000050 2c0e 000e 0000 0000 0000 0000 0000 0000

As you can see, the eleventh byte is changing from 0x0000 to 0x0001.

So my question is: is there any other way to acces this information ?
I looked on:
or on
for exemple, no changes.

Thanks for your time.


Apologies for the delay. Could you try installing evtest and seeing if it detects the input event?

$ sudo apt install evtest

When running evtest you should see something like …

$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      tegra-hda-galen-t194 HDMI/DP,pcm=3
/dev/input/event1:      tegra-hda-galen-t194 HDMI/DP,pcm=7
/dev/input/event2:      tegra-hda-galen-t194 HDMI/DP,pcm=8
/dev/input/event3:      tegra-hda-galen-t194 HDMI/DP,pcm=9
/dev/input/event4:      tegra-snd-t19x-mobile-rt565x Headset Jack
/dev/input/event5:      gpio-keys
Select the device event number [0-5]: 4
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "tegra-snd-t19x-mobile-rt565x Headset Jack"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 226 (KEY_MEDIA)
  Event type 5 (EV_SW)
    Event code 2 (SW_HEADPHONE_INSERT) state 0
    Event code 4 (SW_MICROPHONE_INSERT) state 0
Testing ... (interrupt to exit)

You can take a look at the source code to see how this works. There is some more information here on the input subsystem.