* added missing dprintf for errors
* fix a warning and zeroed the controller struct git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28846 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -55,6 +55,7 @@ init_driver(void)
|
|||||||
&& gNumCards < MAX_CARDS; i++) {
|
&& gNumCards < MAX_CARDS; i++) {
|
||||||
if (info.class_base == PCI_multimedia
|
if (info.class_base == PCI_multimedia
|
||||||
&& info.class_sub == PCI_hd_audio) {
|
&& info.class_sub == PCI_hd_audio) {
|
||||||
|
memset(&gCards[gNumCards], 0, sizeof(hda_controller));
|
||||||
gCards[gNumCards].pci_info = info;
|
gCards[gNumCards].pci_info = info;
|
||||||
gCards[gNumCards].opened = 0;
|
gCards[gNumCards].opened = 0;
|
||||||
sprintf(path, DEVFS_PATH_FORMAT, gNumCards);
|
sprintf(path, DEVFS_PATH_FORMAT, gNumCards);
|
||||||
|
|||||||
@@ -168,8 +168,9 @@ dump_audiogroup_widgets(hda_audio_group* audioGroup)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WT_PIN_COMPLEX:
|
case WT_PIN_COMPLEX:
|
||||||
dprintf("\t%s%s\n", PIN_CAP_IS_INPUT(widget.d.pin.capabilities) ? "[Input] " : "",
|
dprintf("\t%s%s%s\n", PIN_CAP_IS_INPUT(widget.d.pin.capabilities) ? "[Input] " : "",
|
||||||
PIN_CAP_IS_OUTPUT(widget.d.pin.capabilities) ? "[Output]" : "");
|
PIN_CAP_IS_OUTPUT(widget.d.pin.capabilities) ? "[Output]" : "",
|
||||||
|
PIN_CAP_IS_EAPD_CAP(widget.d.pin.capabilities) ? "[EAPD Cap]" : "");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1052,8 +1053,10 @@ hda_codec_new(hda_controller* controller, uint32 codecAddress)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
hda_codec* codec = (hda_codec*)calloc(1, sizeof(hda_codec));
|
hda_codec* codec = (hda_codec*)calloc(1, sizeof(hda_codec));
|
||||||
if (codec == NULL)
|
if (codec == NULL) {
|
||||||
|
dprintf("hda: Failed to alloc a codec\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
codec->controller = controller;
|
codec->controller = controller;
|
||||||
codec->addr = codecAddress;
|
codec->addr = codecAddress;
|
||||||
@@ -1080,8 +1083,10 @@ hda_codec_new(hda_controller* controller, uint32 codecAddress)
|
|||||||
verbs[2] = MAKE_VERB(codecAddress, 0, VID_GET_PARAMETER,
|
verbs[2] = MAKE_VERB(codecAddress, 0, VID_GET_PARAMETER,
|
||||||
PID_SUB_NODE_COUNT);
|
PID_SUB_NODE_COUNT);
|
||||||
|
|
||||||
if (hda_send_verbs(codec, verbs, (uint32*)&response, 3) != B_OK)
|
if (hda_send_verbs(codec, verbs, (uint32*)&response, 3) != B_OK) {
|
||||||
|
dprintf("hda: Failed to get vendor and revision parameters\n");
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
codec->vendor_id = response.vendor;
|
codec->vendor_id = response.vendor;
|
||||||
codec->product_id = response.device;
|
codec->product_id = response.device;
|
||||||
@@ -1100,8 +1105,10 @@ hda_codec_new(hda_controller* controller, uint32 codecAddress)
|
|||||||
verbs[0] = MAKE_VERB(codecAddress, nodeID, VID_GET_PARAMETER,
|
verbs[0] = MAKE_VERB(codecAddress, nodeID, VID_GET_PARAMETER,
|
||||||
PID_FUNCTION_GROUP_TYPE);
|
PID_FUNCTION_GROUP_TYPE);
|
||||||
|
|
||||||
if (hda_send_verbs(codec, verbs, &groupType, 1) != B_OK)
|
if (hda_send_verbs(codec, verbs, &groupType, 1) != B_OK) {
|
||||||
|
dprintf("hda: Failed to get function group type\n");
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
if ((groupType & FUNCTION_GROUP_NODETYPE_MASK) == FUNCTION_GROUP_NODETYPE_AUDIO) {
|
if ((groupType & FUNCTION_GROUP_NODETYPE_MASK) == FUNCTION_GROUP_NODETYPE_AUDIO) {
|
||||||
/* Found an Audio Function Group! */
|
/* Found an Audio Function Group! */
|
||||||
|
|||||||
Reference in New Issue
Block a user