Changeset 65b09c1 in mainline for uspace/drv/audio/hdaudio/codec.c


Ignore:
Timestamp:
2014-08-14T18:37:31Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1412a184
Parents:
d2d5329
Message:

Read pin configuration default. Add missing verbs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/hdaudio/codec.c

    rd2d5329 r65b09c1  
    4848        uint32_t verb;
    4949
    50         verb = (codec->address << 28) | (node << 20) | ((hda_get_param) << 8) | param;
     50        verb = (codec->address << 28) | (node << 20) | ((hda_param_get) << 8) | param;
    5151        return hda_cmd(codec->hda, verb, resp);
    5252}
     
    104104}
    105105
     106/** Get Configuration Default */
     107static int hda_get_cfg_def(hda_codec_t *codec, int node, uint32_t *cfgdef)
     108{
     109        uint32_t verb;
     110
     111        verb = (codec->address << 28) | (node << 20) | ((hda_cfg_def_get) << 8) | 0;
     112        return hda_cmd(codec->hda, verb, cfgdef);
     113}
     114
    106115hda_codec_t *hda_codec_init(hda_t *hda, uint8_t address)
    107116{
     
    115124        hda_awidget_type_t awtype;
    116125        uint32_t awcaps;
     126        uint32_t cfgdef;
    117127
    118128        codec = calloc(1, sizeof(hda_codec_t));
     
    153163                        ddf_msg(LVL_NOTE, "aw %d: type=0x%x caps=0x%x",
    154164                            aw, awtype, awcaps);
     165
     166                        if (awtype == awt_pin_complex) {
     167                                rc = hda_get_cfg_def(codec, aw, &cfgdef);
     168                                if (rc != EOK)
     169                                        goto error;
     170                                ddf_msg(LVL_NOTE, "aw %d: PIN cdfgef=0x%x",
     171                                    aw, cfgdef);
     172
     173                        }
    155174                }
    156175        }
Note: See TracChangeset for help on using the changeset viewer.