[Headset]如何配置耳機ACCDET的MICBIAS輸出波形

[Headset]如何配置耳機ACCDET的MICBIAS輸出波形

[Description]:

如何配置耳機ACCDET的MICBIAS輸出波形

[Solution]:

以MT6589爲例:
在alps/mediatek/custom/<your project>/kernel/headset/accdet/accdet_custom.h 文件中,
有結構體
struct headset_mode_settings{
int pwm_width;//pwm frequence
int pwm_thresh;//pwm duty
int fall_delay;//falling stable time
int rise_delay;//rising stable time
int debounce0;//hook switch or double check debounce
int debounce1;//mic bias debounce
int debounce3;//plug out debounce
};
struct headset_mode_settings cust_headset_settings = {
0x1900, 0x140, 1, 0x12c, 0x3000, 0x3000, 0x400
};
其前兩項是設置耳機PWM輸出波形的,依次爲 pwm_width 和PWM_THRESH
設置公式如下:
PWM OUTPUT whole time =(pwm_width+1) /32768 sec //週期時間
PWM OUTPUT high time =(PWM_THRESH+1)/32768 sec //高電平時間 可以自行調整耳機檢測時間
其他參數同樣是以32K時鐘作爲時間計數


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章