case MIC_OFF:
if (pre_path != MIC_OFF)
rk616_codec_power_down(RK616_CODEC_CAPTURE);
+
+ if (rk616->hpmic_from_mic2in)
+ snd_soc_update_bits(codec, RK616_MICBIAS_CTL,
+ RK616_MICBIAS1_PWRD | RK616_MICBIAS1_V_MASK,
+ RK616_MICBIAS1_PWRD);
+
break;
case Main_Mic:
if (pre_path == MIC_OFF)
if (rk616->hpmic_from_mic2in) {
snd_soc_write(codec, 0x848, 0x06); //MIXINL power up and unmute, MININL from MICMUX, MICMUX from BST_L
snd_soc_write(codec, 0x840, 0x69); //BST_L power up, unmute, and Single-Ended(bit 6), volume 0-20dB(bit 5)
+ snd_soc_update_bits(codec, RK616_MICBIAS_CTL,
+ RK616_MICBIAS1_PWRD | RK616_MICBIAS1_V_MASK,
+ RK616_MICBIAS1_V_1_7);
}
rk616_set_gpio(RK616_CODEC_SET_MIC, GPIO_HIGH);
break;
if (rk616->hpmic_from_mic2in) {
snd_soc_write(codec, 0x848, 0x26); //MIXINL power up and unmute, MININL from MICMUX, MICMUX from BST_R
snd_soc_write(codec, 0x840, 0x96); //BST_R power up, unmute, and Single-Ended(bit 2), volume 0-20dB(bit 1)
+ snd_soc_update_bits(codec, RK616_MICBIAS_CTL,
+ RK616_MICBIAS1_PWRD | RK616_MICBIAS1_V_MASK,
+ RK616_MICBIAS1_PWRD);
}
rk616_set_gpio(RK616_CODEC_SET_MIC, GPIO_LOW);
break;
switch (rk616->voip_path) {
case OFF:
- if (rk616->playback_path == OFF)
- rk616_codec_power_down(RK616_CODEC_PLAYBACK);
- if (rk616->capture_path == OFF)
- rk616_codec_power_down(RK616_CODEC_CAPTURE);
break;
case RCV:
case SPK_PATH:
static int rk616_resume(struct snd_soc_codec *codec)
{
+ struct rk616_codec_priv *rk616 = rk616_priv;
+
+ if (!rk616) {
+ printk("%s : rk616 priv is NULL!\n", __func__);
+ return -EINVAL;
+ }
+
if (rk616_for_mid) {
- snd_soc_write(codec, RK616_MICBIAS_CTL,
- RK616_MICBIAS2_PWRD | RK616_MICBIAS1_V_1_7);
+ if (rk616->hpmic_from_mic2in)
+ snd_soc_write(codec, RK616_MICBIAS_CTL,
+ RK616_MICBIAS1_PWRD | RK616_MICBIAS2_V_1_7);
+ else
+ snd_soc_write(codec, RK616_MICBIAS_CTL,
+ RK616_MICBIAS2_PWRD | RK616_MICBIAS1_V_1_7);
} else {
rk616_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
}
if (rk616_for_mid) {
snd_soc_add_codec_controls(codec, rk616_snd_path_controls,
ARRAY_SIZE(rk616_snd_path_controls));
- snd_soc_write(codec, RK616_MICBIAS_CTL,
- RK616_MICBIAS2_PWRD | RK616_MICBIAS1_V_1_7);
+ if (rk616->hpmic_from_mic2in)
+ snd_soc_write(codec, RK616_MICBIAS_CTL,
+ RK616_MICBIAS1_PWRD | RK616_MICBIAS2_V_1_7);
+ else
+ snd_soc_write(codec, RK616_MICBIAS_CTL,
+ RK616_MICBIAS2_PWRD | RK616_MICBIAS1_V_1_7);
} else {
codec->dapm.bias_level = SND_SOC_BIAS_OFF;
rk616_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
{
snd_soc_unregister_codec(&pdev->dev);
- if (rk616_priv)
+ if (rk616_priv) {
kfree(rk616_priv);
- rk616_priv = NULL;
+ rk616_priv = NULL;
+ }
+
rk616_mfd = NULL;
return 0;
mdelay(10);
snd_soc_write(codec, RK616_RESET, 0x3);
- if (rk616)
+ if (rk616) {
kfree(rk616);
+ rk616_priv = NULL;
+ }
}
static struct platform_driver rk616_codec_driver = {