Commit 6e747d53 authored by Bard Liao's avatar Bard Liao Committed by Mark Brown

ASoC: rt5645: Adds push button support for rt5650

rt5650 support headset button detection. Currently, the button detection
is only implemented for rt5650 codec. The button detection configuration
register's default value is different from rt5645.
And we didn't touch the register in the driver, so we will get the wrong
value when we dump the registers. We will fix it in another patch.
Signed-off-by: default avatarBard Liao <bardliao@realtek.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c0d44e59
This diff is collapsed.
...@@ -2184,6 +2184,7 @@ struct rt5645_priv { ...@@ -2184,6 +2184,7 @@ struct rt5645_priv {
struct i2c_client *i2c; struct i2c_client *i2c;
struct snd_soc_jack *hp_jack; struct snd_soc_jack *hp_jack;
struct snd_soc_jack *mic_jack; struct snd_soc_jack *mic_jack;
struct snd_soc_jack *btn_jack;
struct delayed_work jack_detect_work; struct delayed_work jack_detect_work;
int codec_type; int codec_type;
...@@ -2196,9 +2197,12 @@ struct rt5645_priv { ...@@ -2196,9 +2197,12 @@ struct rt5645_priv {
int pll_src; int pll_src;
int pll_in; int pll_in;
int pll_out; int pll_out;
int jack_type;
bool en_button_func;
}; };
int rt5645_set_jack_detect(struct snd_soc_codec *codec, int rt5645_set_jack_detect(struct snd_soc_codec *codec,
struct snd_soc_jack *hp_jack, struct snd_soc_jack *mic_jack); struct snd_soc_jack *hp_jack, struct snd_soc_jack *mic_jack,
struct snd_soc_jack *btn_jack);
#endif /* __RT5645_H__ */ #endif /* __RT5645_H__ */
...@@ -185,7 +185,7 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -185,7 +185,7 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
return ret; return ret;
} }
rt5645_set_jack_detect(codec, &ctx->hp_jack, &ctx->mic_jack); rt5645_set_jack_detect(codec, &ctx->hp_jack, &ctx->mic_jack, NULL);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment