linux耳机检测,Audio Jack 的耳机检测和按键检测

本文详细介绍了在Linux系统中,特别是基于QCM 8960平台,如何检测Audio Jack的耳机插入和拔出,以及如何处理耳机按键事件。通过调试信息获取、GPIO状态查看、中断处理函数设置等步骤,阐述了耳机插入检测的实现原理,并探讨了按键事件的中断触发和电压阈值判断机制。
摘要由CSDN通过智能技术生成

基于QCM 8960

二十七、Audio jack1. https://wiki.sonyericsson.net/androiki/Huashan_legacy_feature:_Vibrator_%26_Audio_Jack

2. How to get debug info

1 dump register before and after headset plug, use following command to dump register

1.1 $ adb shell 'mount -t debugfs debugfs /sys/kernel/debug/'

1.2 $ adb shell 'cat /sys/kernel/debug/asoc/msm8960-snd-card/tabla_codec/codec_reg'

2 Log message during insertion please enable wcd9xxx-core.c +p, wcd9310.c +p, wcd9xxx-irq.c like following

2.1 $ adb shell 'mount -t debugfs debugfs /sys/kernel/debug/'

2.2 $ adb shell 'echo -n "file wcd9310.c +p" > /sys/kernel/debug/dynamic_debug/control'

2.3 $ adb shell 'echo -n "file wcd9xxx-core.c +p" > /sys/kernel/debug/dynamic_debug/control'

2.4 $ adb shell 'echo -n "file wcd9xxx-irq.c +p" > /sys/kernel/debug/dynamic_debug/control'

4. $ adb shell 'cat /sys/kernel/debug/gpio' 得到GPIO状态  gpio-189 = 151 + PMIC8921的38 Pin

gpio-189 (--          ) in         lo 0x05 0x10 0x22 0x30 0x40 0x58

5. cat sys/module/snd_soc_msm8960/parameters/hs_detect_use_gpio; 可查看是否使用gpio中断检测headset insert/remove

二十八、如何检测 headset/headphon

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值