+static int rt5651_asrc_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec);
+
+ ucontrol->value.integer.value[0] = rt5651->asrc_en;
+
+ return 0;
+}
+
+static int rt5651_asrc_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec);
+
+ rt5651->asrc_en = ucontrol->value.integer.value[0];
+ if (rt5651->asrc_en) {
+ snd_soc_write(codec, 0x80, 0x4000);
+ snd_soc_write(codec, 0x81, 0x0302);
+ snd_soc_write(codec, 0x82, 0x0800);
+ snd_soc_write(codec, 0x73, 0x1004);
+ snd_soc_write(codec, 0x83, 0x1000);
+ snd_soc_write(codec, 0x84, 0x7000);
+ snd_soc_update_bits(codec, 0x64, 0x0200, 0x0200);
+ } else {
+ snd_soc_write(codec, 0x83, 0x0);
+ snd_soc_write(codec, 0x84, 0x0);
+ }
+ return 0;
+}
+