Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 453bd317 authored by Yandong Yang's avatar Yandong Yang
Browse files

ASoc: wcd: mbhc: Change keycode mapping and linein_th



1. Change the key code mapping of buttons as below
 according to Android L spec.

Button0 0-70 ohm - hook key
Button1 110-180 ohm - voice assist
Button2 210-290 ohm - volume up
Button3 360-680 ohm - volume down

2. Report SW_LINEOUT_INSERT
if headset speaker impedance is larger than 5 Kohm

CRs-Fixed: 863767
Change-Id: Icb12e00a2839e11ef6b947b158c58e9e0f1404b2
Signed-off-by: default avatarWalter Yang <yandongy@codeaurora.org>
parent d5dab523
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/io.h>
#include <linux/module.h>
#include <linux/switch.h>
#include <linux/input.h>
#include <sound/core.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
@@ -154,6 +155,10 @@ static int msm_snd_enable_codec_ext_clk(struct snd_soc_codec *codec,
					int enable, bool dapm);
static int msm8996_wsa881x_init(struct snd_soc_component *component);

/*
 * Need to report LINEIN
 * if R/L channel impedance is larger than 5K ohm
 */
static struct wcd_mbhc_config wcd_mbhc_cfg = {
	.read_fw_bin = false,
	.calibration = NULL,
@@ -161,6 +166,15 @@ static struct wcd_mbhc_config wcd_mbhc_cfg = {
	.mono_stero_detection = false,
	.swap_gnd_mic = NULL,
	.hs_ext_micbias = true,
	.key_code[0] = KEY_MEDIA,
	.key_code[1] = KEY_VOICECOMMAND,
	.key_code[2] = KEY_VOLUMEUP,
	.key_code[3] = KEY_VOLUMEDOWN,
	.key_code[4] = 0,
	.key_code[5] = 0,
	.key_code[6] = 0,
	.key_code[7] = 0,
	.linein_th = 5000,
};

static struct wcd9xxx_mbhc_config mbhc_cfg = {