have added the rk_headset driver to my 5.19-hdmi-tree, but it seems not triggering the mic-change, used same settings in dts like in bsp
root@bpi-r2pro:~# zgrep 'HEADSET' /proc/config.gz
CONFIG_RK_HEADSET=y
root@bpi-r2pro:~# uname -a
Linux bpi-r2pro 5.19.0-rc1-bpi-r2pro-r2pro-hdmi #1 SMP PREEMPT Wed Jun 15 15:07x
root@bpi-r2pro:~#
i see this messages, but it seems driver still does not switch mic to headset
root@bpi-r2pro:~# dmesg | grep -i headset
[ 1.251395] rockchip_headset rk-headset: Can not read property hook_gpio
[ 1.251456] rockchip_headset rk-headset: headset have hook adc mode
[ 1.251623] input: rk-headset as /devices/platform/rk-headset/input/input1
[ 1.413881] headset_interrupt:get pin level again, pin=114,i=0
[ 1.413887] (headset in is high level)headset status is in
any idea? on plugging in/out i see headset_interrupt messages in dmesg, but evtest does not show any change…and maybe i need to map this event to also somehow in userspace
root@bpi-r2pro:~# evtest /dev/input/event1
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x1 product 0x1 version 0x100
Input device name: "rk-headset"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 226 (KEY_MEDIA)
Properties:
Testing ... (interrupt to exit)
[ 423.194007] headset_interrupt:get pin level again, pin=114,i=0
[ 426.034037] headset_interrupt:get pin level again, pin=114,i=0
edit:
get it so far:
[ 127.406051] (headset in is high level)headset status is in
[ 127.610050] hook_once_work read adc value: 1023
[ 127.610307] hook_once_work notice android headset status = 1
[ 127.714012] DEBUG: hook_work_callback 329
...
[ 131.874090] hook_work_callback read adc value=1023
[ 131.874111] HOOK status is up , adc value = 1023 hook_time = 100
[ 131.874125] Hook adc read old_status == headset->hook_status=0 hook_time = 100
[ 131.929130] In the headset_interrupt
[ 131.978009] DEBUG: hook_work_callback 329
[ 131.978088] hook_work_callback read adc value=1023
[ 131.978100] Headset is out or waiting for headset is in or out, after same time check HOOK key
[ 132.086063] headset_interrupt:get pin level again, pin=114,i=0
[ 132.086063] headset_interrupt:get pin level again, pin=114,i=0
[ 132.086091] (headset in is high level)headset status is out
[ 132.086218] headset notice android headset status = 0
means driver recognizes the change, but mic is not switched yet to headphone…i see in driver there is some reference to an extcon_* and imho input-device should change too…currently debugging
HEADSET_OUT should set input device in headset_interrupt and !=HEADSET_OUT in hook_work_callback
inout device ist not updated because headset->hook_status is always HOOK_UP, i’m not sure whats the reasing for HOOK-STATUS, but is is set only to down in hook_work_callback which is not called if headset is removed. looks for me redundant with headset_info->headset_status = [HEADSET_IN,HEADSET_OUT]