Merge branch 'fix/hda' into topic/hda
[pandora-kernel.git] / sound / pci / hda / hda_codec.c
index aa55407..24401d5 100644 (file)
@@ -44,6 +44,7 @@ struct hda_vendor_id {
 /* codec vendor labels */
 static struct hda_vendor_id hda_vendor_ids[] = {
        { 0x1002, "ATI" },
+       { 0x1013, "Cirrus Logic" },
        { 0x1057, "Motorola" },
        { 0x1095, "Silicon Image" },
        { 0x10de, "Nvidia" },
@@ -184,7 +185,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
        mutex_lock(&bus->cmd_mutex);
        err = bus->ops.command(bus, cmd);
        if (!err && res)
-               *res = bus->ops.get_response(bus);
+               *res = bus->ops.get_response(bus, codec->addr);
        mutex_unlock(&bus->cmd_mutex);
        snd_hda_power_down(codec);
        if (res && *res == -1 && bus->rirb_error) {
@@ -301,12 +302,15 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
        unsigned int parm;
        int i, conn_len, conns;
        unsigned int shift, num_elems, mask;
+       unsigned int wcaps;
        hda_nid_t prev_nid;
 
        if (snd_BUG_ON(!conn_list || max_conns <= 0))
                return -EINVAL;
 
-       if ((get_wcaps(codec, nid) & AC_WCAP_CONN_LIST) == 0) {
+       wcaps = get_wcaps(codec, nid);
+       if (!(wcaps & AC_WCAP_CONN_LIST) &&
+           get_wcaps_type(wcaps) != AC_WID_VOL_KNB) {
                snd_printk(KERN_WARNING "hda_codec: "
                           "connection list not available for 0x%x\n", nid);
                return -EINVAL;
@@ -748,8 +752,7 @@ static int read_pin_defaults(struct hda_codec *codec)
        for (i = 0; i < codec->num_nodes; i++, nid++) {
                struct hda_pincfg *pin;
                unsigned int wcaps = get_wcaps(codec, nid);
-               unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >>
-                               AC_WCAP_TYPE_SHIFT;
+               unsigned int wid_type = get_wcaps_type(wcaps);
                if (wid_type != AC_WID_PIN)
                        continue;
                pin = snd_array_new(&codec->init_pins);
@@ -2386,8 +2389,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
        for (i = 0; i < codec->num_nodes; i++, nid++) {
                unsigned int wcaps = get_wcaps(codec, nid);
                if (wcaps & AC_WCAP_POWER) {
-                       unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >>
-                               AC_WCAP_TYPE_SHIFT;
+                       unsigned int wid_type = get_wcaps_type(wcaps);
                        if (power_state == AC_PWRST_D3 &&
                            wid_type == AC_WID_PIN) {
                                unsigned int pincap;
@@ -3678,8 +3680,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
        end_nid = codec->start_nid + codec->num_nodes;
        for (nid = codec->start_nid; nid < end_nid; nid++) {
                unsigned int wid_caps = get_wcaps(codec, nid);
-               unsigned int wid_type =
-                       (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
+               unsigned int wid_type = get_wcaps_type(wid_caps);
                unsigned int def_conf;
                short assoc, loc;