OSDN Git Service

ASoC: sdm660_cdc: Fix 44.1 clip mute first time after boot
authorLaxminath Kasam <lkasam@codeaurora.org>
Sun, 19 Mar 2017 05:05:45 +0000 (10:35 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Wed, 22 Mar 2017 07:51:47 +0000 (00:51 -0700)
After boot, insert headphone and play 44.1 clip fails to play
first time sometimes. Since at bootup MCLK is acquired at
9.6MHz and not reset. And for 44.1MHz, request for 11.2896MHz
is done causes overwrite of frequency request at DSP which is not
allowed and causes playback to fail. At bootup regacache call for
digital codec result in additional vote for MCLK if int_mclk0_enabled
flag is false. Change the order in device_down call from analog codec
and also avoid notifier call for SUBSYS_DOWN at bootup.

Change-Id: Ifc0540826d38c5adf8b068ea87d5a5f71a4ac674
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c

index 0444026..5383e65 100644 (file)
@@ -3760,8 +3760,8 @@ static int msm_anlg_cdc_device_down(struct snd_soc_codec *codec)
        snd_soc_write(codec,
                MSM89XX_PMIC_ANALOG_SPKR_DAC_CTL, 0x93);
 
-       atomic_set(&pdata->int_mclk0_enabled, false);
        msm_anlg_cdc_dig_notifier_call(codec, DIG_CDC_EVENT_SSR_DOWN);
+       atomic_set(&pdata->int_mclk0_enabled, false);
        set_bit(BUS_DOWN, &sdm660_cdc_priv->status_mask);
        snd_soc_card_change_online_state(codec->component.card, 0);
 
@@ -3819,17 +3819,22 @@ static int sdm660_cdc_notifier_service_cb(struct notifier_block *nb,
        bool adsp_ready = false;
        bool timedout;
        unsigned long timeout;
+       static bool initial_boot = true;
 
        codec = sdm660_cdc_priv->codec;
        dev_dbg(codec->dev, "%s: Service opcode 0x%lx\n", __func__, opcode);
 
        switch (opcode) {
        case AUDIO_NOTIFIER_SERVICE_DOWN:
+               if (initial_boot)
+                       break;
                dev_dbg(codec->dev,
                        "ADSP is about to power down. teardown/reset codec\n");
                msm_anlg_cdc_device_down(codec);
                break;
        case AUDIO_NOTIFIER_SERVICE_UP:
+               if (initial_boot)
+                       initial_boot = false;
                dev_dbg(codec->dev,
                        "ADSP is about to power up. bring up codec\n");