* store vendor, revision, stepping, revision, minor, major in the codec struct
* check specific node ids for nodes declared as inputs which are really beepers * when unmuting/setting amp on the input amplifier, iterate on each input instead of only the first one * also unmute/set amp on the output and input amplifiers for the input and output paths, respectively git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28683 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -275,8 +275,10 @@ struct hda_audio_group {
|
|||||||
struct hda_codec {
|
struct hda_codec {
|
||||||
uint16 vendor_id;
|
uint16 vendor_id;
|
||||||
uint16 product_id;
|
uint16 product_id;
|
||||||
|
uint8 major;
|
||||||
|
uint8 minor;
|
||||||
uint8 revision;
|
uint8 revision;
|
||||||
uint16 stepping;
|
uint8 stepping;
|
||||||
uint8 addr;
|
uint8 addr;
|
||||||
|
|
||||||
sem_id response_sem;
|
sem_id response_sem;
|
||||||
|
|||||||
@@ -528,6 +528,25 @@ hda_codec_parse_audio_group(hda_audio_group* audioGroup)
|
|||||||
|
|
||||||
widget.type = (hda_widget_type)((capabilities & AUDIO_CAP_TYPE_MASK)
|
widget.type = (hda_widget_type)((capabilities & AUDIO_CAP_TYPE_MASK)
|
||||||
>> AUDIO_CAP_TYPE_SHIFT);
|
>> AUDIO_CAP_TYPE_SHIFT);
|
||||||
|
|
||||||
|
/* Check specific node ids declared as inputs as beepers */
|
||||||
|
switch ((audioGroup->codec->vendor_id << 16) | audioGroup->codec->product_id) {
|
||||||
|
case 0x10ec0260:
|
||||||
|
if (nodeID == 23)
|
||||||
|
widget.type = WT_BEEP_GENERATOR;
|
||||||
|
break;
|
||||||
|
case 0x10ec0262:
|
||||||
|
case 0x10ec0268:
|
||||||
|
case 0x10ec0880:
|
||||||
|
case 0x10ec0882:
|
||||||
|
case 0x10ec0883:
|
||||||
|
case 0x10ec0885:
|
||||||
|
case 0x10ec0888:
|
||||||
|
case 0x10ec0889:
|
||||||
|
if (nodeID == 29)
|
||||||
|
widget.type = WT_BEEP_GENERATOR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
widget.active_input = -1;
|
widget.active_input = -1;
|
||||||
widget.capabilities.audio = capabilities;
|
widget.capabilities.audio = capabilities;
|
||||||
widget.node_id = nodeID;
|
widget.node_id = nodeID;
|
||||||
@@ -930,8 +949,7 @@ dprintf("ENABLE pin widget %ld\n", widget.node_id);
|
|||||||
hda_send_verbs(audioGroup->codec, &verb, NULL, 1);
|
hda_send_verbs(audioGroup->codec, &verb, NULL, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (widget.capabilities.output_amplifier != 0
|
if (widget.capabilities.output_amplifier != 0) {
|
||||||
&& widget.flags & WIDGET_FLAG_OUTPUT_PATH) {
|
|
||||||
dprintf("UNMUTE/SET OUTPUT GAIN widget %ld (offset %ld)\n", widget.node_id,
|
dprintf("UNMUTE/SET OUTPUT GAIN widget %ld (offset %ld)\n", widget.node_id,
|
||||||
widget.capabilities.output_amplifier & AMP_CAP_OFFSET_MASK);
|
widget.capabilities.output_amplifier & AMP_CAP_OFFSET_MASK);
|
||||||
uint32 verb = MAKE_VERB(audioGroup->codec->addr,
|
uint32 verb = MAKE_VERB(audioGroup->codec->addr,
|
||||||
@@ -943,20 +961,22 @@ dprintf("UNMUTE/SET OUTPUT GAIN widget %ld (offset %ld)\n", widget.node_id,
|
|||||||
& AMP_CAP_OFFSET_MASK));
|
& AMP_CAP_OFFSET_MASK));
|
||||||
hda_send_verbs(audioGroup->codec, &verb, NULL, 1);
|
hda_send_verbs(audioGroup->codec, &verb, NULL, 1);
|
||||||
}
|
}
|
||||||
if (widget.capabilities.input_amplifier != 0
|
if (widget.capabilities.input_amplifier != 0) {
|
||||||
&& widget.flags & WIDGET_FLAG_INPUT_PATH) {
|
|
||||||
dprintf("UNMUTE/SET INPUT GAIN widget %ld (offset %ld)\n", widget.node_id,
|
dprintf("UNMUTE/SET INPUT GAIN widget %ld (offset %ld)\n", widget.node_id,
|
||||||
widget.capabilities.output_amplifier & AMP_CAP_OFFSET_MASK);
|
widget.capabilities.input_amplifier & AMP_CAP_OFFSET_MASK);
|
||||||
|
for (uint32 i = 0; i < widget.num_inputs; i++) {
|
||||||
uint32 verb = MAKE_VERB(audioGroup->codec->addr,
|
uint32 verb = MAKE_VERB(audioGroup->codec->addr,
|
||||||
widget.node_id,
|
widget.node_id,
|
||||||
VID_SET_AMPLIFIER_GAIN_MUTE,
|
VID_SET_AMPLIFIER_GAIN_MUTE,
|
||||||
AMP_SET_INPUT | AMP_SET_LEFT_CHANNEL
|
AMP_SET_INPUT | AMP_SET_LEFT_CHANNEL
|
||||||
| AMP_SET_RIGHT_CHANNEL
|
| AMP_SET_RIGHT_CHANNEL
|
||||||
|
| AMP_SET_INPUT_INDEX(i)
|
||||||
| (widget.capabilities.input_amplifier
|
| (widget.capabilities.input_amplifier
|
||||||
& AMP_CAP_OFFSET_MASK));
|
& AMP_CAP_OFFSET_MASK));
|
||||||
hda_send_verbs(audioGroup->codec, &verb, NULL, 1);
|
hda_send_verbs(audioGroup->codec, &verb, NULL, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (widget.type != type || (widget.flags & flags) == 0
|
if (widget.type != type || (widget.flags & flags) == 0
|
||||||
|| (widget.capabilities.audio
|
|| (widget.capabilities.audio
|
||||||
@@ -1038,6 +1058,13 @@ hda_codec_new(hda_controller* controller, uint32 codecAddress)
|
|||||||
if (hda_send_verbs(codec, verbs, (uint32*)&response, 3) != B_OK)
|
if (hda_send_verbs(codec, verbs, (uint32*)&response, 3) != B_OK)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
codec->vendor_id = response.vendor;
|
||||||
|
codec->product_id = response.device;
|
||||||
|
codec->stepping = response.stepping;
|
||||||
|
codec->revision = response.revision;
|
||||||
|
codec->minor = response.minor;
|
||||||
|
codec->major = response.major;
|
||||||
|
|
||||||
dprintf("Codec %ld Vendor: %04lx Product: %04lx, Revision: "
|
dprintf("Codec %ld Vendor: %04lx Product: %04lx, Revision: "
|
||||||
"%lu.%lu.%lu.%lu\n", codecAddress, response.vendor, response.device,
|
"%lu.%lu.%lu.%lu\n", codecAddress, response.vendor, response.device,
|
||||||
response.major, response.minor, response.revision, response.stepping);
|
response.major, response.minor, response.revision, response.stepping);
|
||||||
|
|||||||
Reference in New Issue
Block a user