Changeset 9034876 in mainline
- Timestamp:
- 2014-08-27T09:02:43Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cc91ab4
- Parents:
- dda5848
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/codec.c
rdda5848 r9034876 54 54 resp = &myresp; 55 55 56 verb = (codec->address << 28) | (node << 20) | (vid << 8) | payload; 56 if ((vid & 0x700) != 0) { 57 verb = (codec->address << 28) | 58 ((node & 0x1ff) << 20) | 59 ((vid & 0xfff) << 8) | 60 (payload & 0xff); 61 } else { 62 verb = (codec->address << 28) | 63 ((node & 0x1ff) << 20) | 64 ((vid & 0xf) << 16) | 65 (payload & 0xffff); 66 } 57 67 int rc = hda_cmd(codec->hda, verb, resp); 58 /* 68 59 69 if (resp != NULL) { 60 70 ddf_msg(LVL_NOTE, "verb 0x%" PRIx32 " -> 0x%" PRIx32, verb, … … 63 73 ddf_msg(LVL_NOTE, "verb 0x%" PRIx32, verb); 64 74 } 65 */ 75 66 76 return rc; 67 77 } … … 214 224 goto error; 215 225 226 offset = ampcaps & 0x7f; 227 ddf_msg(LVL_NOTE, "out amp caps 0x%x (offset=0x%x)", 228 ampcaps, offset); 229 230 rc = hda_set_amp_gain_mute(codec, aw, 0xb000 + offset/2); 231 if (rc != EOK) 232 goto error; 233 216 234 rc = hda_get_amp_gain_mute(codec, aw, 0x8000, &gmleft); 217 235 if (rc != EOK) 218 236 goto error; 219 237 220 rc = hda_get_amp_gain_mute(codec, aw, 0xc000, &gmright); 221 if (rc != EOK) 222 goto error; 223 224 offset = ampcaps & 0x7f; 225 ddf_msg(LVL_NOTE, "out amp caps 0x%x (offset=0x%x)" 226 "gain/mute: L:0x%x R:0x%x", 227 ampcaps, offset, gmleft, gmright); 228 229 rc = hda_set_amp_gain_mute(codec, aw, 0xb000 + offset); 230 if (rc != EOK) 231 goto error; 238 rc = hda_get_amp_gain_mute(codec, aw, 0xa000, &gmright); 239 if (rc != EOK) 240 goto error; 241 242 ddf_msg(LVL_NOTE, "gain/mute: L:0x%x R:0x%x", gmleft, gmright); 232 243 233 244 return EOK; … … 253 264 254 265 for (i = 0; i < 15; i++) { 266 rc = hda_set_amp_gain_mute(codec, aw, 0x7000 + (i << 8) + offset/2); 267 if (rc != EOK) 268 goto error; 269 255 270 rc = hda_get_amp_gain_mute(codec, aw, 0x0000 + i, &gmleft); 256 271 if (rc != EOK) 257 272 goto error; 258 273 259 rc = hda_get_amp_gain_mute(codec, aw, 0x 4000 + i, &gmright);274 rc = hda_get_amp_gain_mute(codec, aw, 0x2000 + i, &gmright); 260 275 if (rc != EOK) 261 276 goto error; … … 263 278 ddf_msg(LVL_NOTE, "in:%d gain/mute: L:0x%x R:0x%x", 264 279 i, gmleft, gmright); 265 266 rc = hda_set_amp_gain_mute(codec, aw, 0x7000 + (i << 8) + offset);267 if (rc != EOK)268 goto error;269 280 } 270 281
Note:
See TracChangeset
for help on using the changeset viewer.