Revert "Merge commit 'main-jb-2012.08.03-B4' into t114-0806"
[linux-2.6.git] / sound / pci / hda / hda_codec.c
index 7a8fcc4..6f3a857 100644 (file)
@@ -776,7 +776,7 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card,
 
        snprintf(bus->workq_name, sizeof(bus->workq_name),
                 "hd-audio%d", card->number);
-       bus->workq = create_singlethread_workqueue(bus->workq_name);
+       bus->workq = create_freezable_workqueue(bus->workq_name);
        if (!bus->workq) {
                snd_printk(KERN_ERR "cannot create workqueue %s\n",
                           bus->workq_name);
@@ -1192,6 +1192,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
 {
        if (!codec)
                return;
+       snd_hda_jack_tbl_clear(codec);
        restore_init_pincfgs(codec);
 #ifdef CONFIG_SND_HDA_POWER_SAVE
        cancel_delayed_work(&codec->power_work);
@@ -1200,6 +1201,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
        list_del(&codec->list);
        snd_array_free(&codec->mixers);
        snd_array_free(&codec->nids);
+       snd_array_free(&codec->cvt_setups);
        snd_array_free(&codec->conn_lists);
        snd_array_free(&codec->spdif_out);
        codec->bus->caddr_tbl[codec->addr] = NULL;
@@ -3016,6 +3018,25 @@ static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol,
        return change;
 }
 
+int snd_hda_hdmi_decode_info(struct snd_kcontrol *kcontrol,
+                               struct snd_ctl_elem_info *uinfo)
+{
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+       uinfo->count = 1;
+       uinfo->value.integer.min = 0;
+       uinfo->value.integer.max = 0xFFFFFFFF;
+       return 0;
+}
+
+static int snd_hda_hdmi_decode_get(struct snd_kcontrol *kcontrol,
+                                       struct snd_ctl_elem_value *ucontrol)
+{
+       struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+
+       ucontrol->value.integer.value[0] = codec->recv_dec_cap;
+       return 0;
+}
+
 static struct snd_kcontrol_new dig_mixes[] = {
        {
                .access = SNDRV_CTL_ELEM_ACCESS_READ,
@@ -3045,6 +3066,12 @@ static struct snd_kcontrol_new dig_mixes[] = {
                .get = snd_hda_spdif_out_switch_get,
                .put = snd_hda_spdif_out_switch_put,
        },
+       {
+               .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+               .name = "HDA Decode Capability",
+               .info = snd_hda_hdmi_decode_info,
+               .get = snd_hda_hdmi_decode_get,
+       },
        { } /* end */
 };
 
@@ -3437,7 +3464,7 @@ void snd_hda_codec_set_power_to_all(struct hda_codec *codec, hda_nid_t fg,
                                                   AC_VERB_GET_POWER_STATE, 0);
                        if (state == power_state)
                                break;
-                       msleep(1);
+                       mdelay(1);
                } while (time_after_eq(end_time, jiffies));
        }
 }
@@ -5444,10 +5471,6 @@ int snd_hda_suspend(struct hda_bus *bus)
        list_for_each_entry(codec, &bus->codec_list, list) {
                if (hda_codec_is_power_on(codec))
                        hda_call_codec_suspend(codec);
-               else /* forcibly change the power to D3 even if not used */
-                       hda_set_power_state(codec,
-                                           codec->afg ? codec->afg : codec->mfg,
-                                           AC_PWRST_D3);
                if (codec->patch_ops.post_suspend)
                        codec->patch_ops.post_suspend(codec);
        }