hda: cleanup tracing.
* Make sure all traces are prefixed with the driver name (for easier grepping) * Remove some useless traces * 80 column limit fixes
This commit is contained in:
parent
0a3ea2cfa4
commit
9457b76963
@ -57,8 +57,8 @@ init_driver(void)
|
||||
if (info.class_base == PCI_multimedia
|
||||
&& info.class_sub == PCI_hd_audio) {
|
||||
#ifdef __HAIKU__
|
||||
if ((*gPci->reserve_device)(info.bus, info.device, info.function, "hda",
|
||||
&gCards[gNumCards]) < B_OK) {
|
||||
if ((*gPci->reserve_device)(info.bus, info.device, info.function,
|
||||
"hda", &gCards[gNumCards]) < B_OK) {
|
||||
dprintf("HDA: Failed to reserve PCI:%d:%d:%d\n",
|
||||
info.bus, info.device, info.function);
|
||||
continue;
|
||||
@ -70,10 +70,10 @@ init_driver(void)
|
||||
sprintf(path, DEVFS_PATH_FORMAT, gNumCards);
|
||||
gCards[gNumCards++].devfs_path = strdup(path);
|
||||
|
||||
dprintf("HDA: Detected controller @ PCI:%d:%d:%d, IRQ:%d, type %04x/%04x (%04x/%04x)\n",
|
||||
dprintf("HDA: Detected controller @ PCI:%d:%d:%d, IRQ:%d, "
|
||||
"type %04x/%04x (%04x/%04x)\n",
|
||||
info.bus, info.device, info.function,
|
||||
info.u.h0.interrupt_line,
|
||||
info.vendor_id, info.device_id,
|
||||
info.u.h0.interrupt_line, info.vendor_id, info.device_id,
|
||||
info.u.h0.subsystem_vendor_id, info.u.h0.subsystem_id);
|
||||
}
|
||||
}
|
||||
@ -94,12 +94,11 @@ init_driver(void)
|
||||
extern "C" void
|
||||
uninit_driver(void)
|
||||
{
|
||||
dprintf("IRA: %s\n", __func__);
|
||||
|
||||
for (uint32 i = 0; i < gNumCards; i++) {
|
||||
#ifdef __HAIKU__
|
||||
(*gPci->unreserve_device)(gCards[i].pci_info.bus, gCards[i].pci_info.device,
|
||||
gCards[i].pci_info.function, "hda", &gCards[i]);
|
||||
(*gPci->unreserve_device)(gCards[i].pci_info.bus,
|
||||
gCards[i].pci_info.device, gCards[i].pci_info.function, "hda",
|
||||
&gCards[i]);
|
||||
#endif
|
||||
free((void*)gCards[i].devfs_path);
|
||||
gCards[i].devfs_path = NULL;
|
||||
@ -119,7 +118,6 @@ publish_devices(void)
|
||||
static const char* devs[MAX_CARDS + 1];
|
||||
uint32 i;
|
||||
|
||||
dprintf("IRA: %s\n", __func__);
|
||||
for (i = 0; i < gNumCards; i++) {
|
||||
devs[i] = gCards[i].devfs_path;
|
||||
}
|
||||
@ -133,6 +131,5 @@ publish_devices(void)
|
||||
extern "C" device_hooks*
|
||||
find_device(const char* name)
|
||||
{
|
||||
dprintf("IRA: %s\n", __func__);
|
||||
return &gDriverHooks;
|
||||
}
|
||||
|
@ -16,11 +16,11 @@
|
||||
#undef TRACE
|
||||
#define TRACE_CODEC
|
||||
#ifdef TRACE_CODEC
|
||||
# define TRACE(a...) dprintf(a)
|
||||
# define TRACE(a...) dprintf("hda: " a)
|
||||
#else
|
||||
# define TRACE(a...)
|
||||
#endif
|
||||
#define ERROR(a...) dprintf(a)
|
||||
#define ERROR(a...) dprintf("hda: " a)
|
||||
|
||||
|
||||
#define HDA_ALL 0xffffffff
|
||||
@ -593,7 +593,7 @@ hda_widget_get_connections(hda_audio_group* audioGroup, hda_widget* widget)
|
||||
VID_GET_CONNECTION_LIST_ENTRY, i);
|
||||
if (hda_send_verbs(audioGroup->codec, &verb, &response, 1)
|
||||
!= B_OK) {
|
||||
ERROR("hda: Error parsing inputs for widget %ld!\n",
|
||||
ERROR("Error parsing inputs for widget %ld!\n",
|
||||
widget->node_id);
|
||||
break;
|
||||
}
|
||||
@ -607,7 +607,7 @@ hda_widget_get_connections(hda_audio_group* audioGroup, hda_widget* widget)
|
||||
input &= ~rangeMask;
|
||||
|
||||
if (input < previousInput || previousInput == -1) {
|
||||
ERROR("hda: invalid range from %ld to %ld\n", previousInput,
|
||||
ERROR("invalid range from %ld to %ld\n", previousInput,
|
||||
input);
|
||||
continue;
|
||||
}
|
||||
@ -726,12 +726,12 @@ hda_codec_parse_audio_group(hda_audio_group* audioGroup)
|
||||
if (hda_send_verbs(audioGroup->codec, verbs, resp, 3) != B_OK)
|
||||
return B_ERROR;
|
||||
|
||||
TRACE("hda: Audio Group: Output delay: %ld samples, Input delay: %ld "
|
||||
TRACE("Audio Group: Output delay: %ld samples, Input delay: %ld "
|
||||
"samples, Beep Generator: %s\n", AUDIO_GROUP_CAP_OUTPUT_DELAY(resp[0]),
|
||||
AUDIO_GROUP_CAP_INPUT_DELAY(resp[0]),
|
||||
AUDIO_GROUP_CAP_BEEPGEN(resp[0]) ? "yes" : "no");
|
||||
|
||||
TRACE("hda: #GPIO: %ld, #GPO: %ld, #GPI: %ld, unsol: %s, wake: %s\n",
|
||||
TRACE(" #GPIO: %ld, #GPO: %ld, #GPI: %ld, unsol: %s, wake: %s\n",
|
||||
GPIO_COUNT_NUM_GPIO(resp[1]), GPIO_COUNT_NUM_GPO(resp[1]),
|
||||
GPIO_COUNT_NUM_GPI(resp[1]), GPIO_COUNT_GPIUNSOL(resp[1]) ? "yes" : "no",
|
||||
GPIO_COUNT_GPIWAKE(resp[1]) ? "yes" : "no");
|
||||
@ -741,7 +741,7 @@ hda_codec_parse_audio_group(hda_audio_group* audioGroup)
|
||||
audioGroup->widget_start = SUB_NODE_COUNT_START(resp[2]);
|
||||
audioGroup->widget_count = SUB_NODE_COUNT_TOTAL(resp[2]);
|
||||
|
||||
TRACE("hda: widget start %lu, count %lu\n", audioGroup->widget_start,
|
||||
TRACE(" widget start %lu, count %lu\n", audioGroup->widget_start,
|
||||
audioGroup->widget_count);
|
||||
|
||||
audioGroup->widgets = (hda_widget*)calloc(audioGroup->widget_count,
|
||||
@ -1101,7 +1101,7 @@ TRACE("try without mixer!\n");
|
||||
}
|
||||
|
||||
if (!hda_audio_group_build_input_tree(audioGroup)) {
|
||||
ERROR("hda: build input tree failed\n");
|
||||
ERROR("build input tree failed\n");
|
||||
}
|
||||
|
||||
TRACE("build tree!\n");
|
||||
@ -1124,7 +1124,7 @@ TRACE("build tree!\n");
|
||||
corb_t verb = MAKE_VERB(audioGroup->codec->addr,
|
||||
widget.node_id, VID_SET_CONNECTION_SELECT, widget.active_input);
|
||||
if (hda_send_verbs(audioGroup->codec, &verb, NULL, 1) != B_OK)
|
||||
ERROR("hda: Setting output selector %ld failed on widget %ld!\n",
|
||||
ERROR("Setting output selector %ld failed on widget %ld!\n",
|
||||
widget.active_input, widget.node_id);
|
||||
}
|
||||
|
||||
@ -1146,9 +1146,9 @@ TRACE("build tree!\n");
|
||||
MAKE_VERB(audioGroup->codec->addr,
|
||||
audioGroup->widget.node_id, VID_SET_GPIO_DIR, gpio)
|
||||
};
|
||||
TRACE("hda: Setting gpio 0x%lx\n", gpio);
|
||||
TRACE("Setting gpio 0x%lx\n", gpio);
|
||||
if (hda_send_verbs(audioGroup->codec, verb, NULL, 3) != B_OK)
|
||||
ERROR("hda: Setting gpio failed!\n");
|
||||
ERROR("Setting gpio failed!\n");
|
||||
}
|
||||
|
||||
dump_audiogroup_widgets(audioGroup);
|
||||
@ -1171,7 +1171,7 @@ hda_audio_group_switch_init(hda_audio_group* audioGroup)
|
||||
corb_t verb = MAKE_VERB(audioGroup->codec->addr, widget.node_id,
|
||||
VID_SET_UNSOLRESP, UNSOLRESP_ENABLE);
|
||||
hda_send_verbs(audioGroup->codec, &verb, NULL, 1);
|
||||
TRACE("hda: Enabled unsolicited responses on widget %ld\n",
|
||||
TRACE("Enabled unsolicited responses on widget %ld\n",
|
||||
widget.node_id);
|
||||
}
|
||||
}
|
||||
@ -1195,7 +1195,7 @@ hda_audio_group_check_sense(hda_audio_group* audioGroup, bool disable)
|
||||
uint32 response;
|
||||
hda_send_verbs(audioGroup->codec, &verb, &response, 1);
|
||||
disable = response & PIN_SENSE_PRESENCE_DETECT;
|
||||
TRACE("hda: sensed pin widget %ld, %d\n", widget.node_id, disable);
|
||||
TRACE("sensed pin widget %ld, %d\n", widget.node_id, disable);
|
||||
|
||||
uint32 ctrl = hda_widget_prepare_pin_ctrl(audioGroup, &widget,
|
||||
true);
|
||||
@ -1292,7 +1292,7 @@ hda_codec_new_audio_group(hda_codec* codec, uint32 audioGroupNodeID)
|
||||
|
||||
audioGroup->playback_stream = hda_stream_new(audioGroup, STREAM_PLAYBACK);
|
||||
audioGroup->record_stream = hda_stream_new(audioGroup, STREAM_RECORD);
|
||||
TRACE("hda: streams playback %p, record %p\n", audioGroup->playback_stream,
|
||||
TRACE("streams playback %p, record %p\n", audioGroup->playback_stream,
|
||||
audioGroup->record_stream);
|
||||
|
||||
if (audioGroup->playback_stream != NULL
|
||||
@ -1446,7 +1446,7 @@ hda_codec_new(hda_controller* controller, uint32 codecAddress)
|
||||
|
||||
hda_codec* codec = (hda_codec*)calloc(1, sizeof(hda_codec));
|
||||
if (codec == NULL) {
|
||||
ERROR("hda: Failed to alloc a codec\n");
|
||||
ERROR("Failed to alloc a codec\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1456,14 +1456,14 @@ hda_codec_new(hda_controller* controller, uint32 codecAddress)
|
||||
codec->addr = codecAddress;
|
||||
codec->response_sem = create_sem(0, "hda_codec_response_sem");
|
||||
if (codec->response_sem < B_OK) {
|
||||
ERROR("hda: Failed to create semaphore\n");
|
||||
ERROR("Failed to create semaphore\n");
|
||||
goto err;
|
||||
}
|
||||
controller->codecs[codecAddress] = codec;
|
||||
|
||||
codec->unsol_response_sem = create_sem(0, "hda_codec_unsol_response_sem");
|
||||
if (codec->unsol_response_sem < B_OK) {
|
||||
ERROR("hda: Failed to create semaphore\n");
|
||||
ERROR("Failed to create semaphore\n");
|
||||
goto err;
|
||||
}
|
||||
codec->unsol_response_read = 0;
|
||||
@ -1491,7 +1491,7 @@ hda_codec_new(hda_controller* controller, uint32 codecAddress)
|
||||
|
||||
status = hda_send_verbs(codec, verbs, (uint32*)&response, 3);
|
||||
if (status != B_OK) {
|
||||
ERROR("hda: Failed to get vendor and revision parameters: %s\n",
|
||||
ERROR("Failed to get vendor and revision parameters: %s\n",
|
||||
strerror(status));
|
||||
goto err;
|
||||
}
|
||||
@ -1516,7 +1516,7 @@ hda_codec_new(hda_controller* controller, uint32 codecAddress)
|
||||
PID_FUNCTION_GROUP_TYPE);
|
||||
|
||||
if (hda_send_verbs(codec, verbs, &groupType, 1) != B_OK) {
|
||||
ERROR("hda: Failed to get function group type\n");
|
||||
ERROR("Failed to get function group type\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@ -1525,7 +1525,7 @@ hda_codec_new(hda_controller* controller, uint32 codecAddress)
|
||||
// Found an Audio Function Group!
|
||||
status_t status = hda_codec_new_audio_group(codec, nodeID);
|
||||
if (status != B_OK) {
|
||||
ERROR("hda: Failed to setup new audio function group (%s)!\n",
|
||||
ERROR("Failed to setup new audio function group (%s)!\n",
|
||||
strerror(status));
|
||||
goto err;
|
||||
}
|
||||
@ -1536,7 +1536,7 @@ hda_codec_new(hda_controller* controller, uint32 codecAddress)
|
||||
(status_t(*)(void*))hda_codec_switch_handler,
|
||||
"hda_codec_unsol_thread", B_LOW_PRIORITY, codec);
|
||||
if (codec->unsol_response_thread < B_OK) {
|
||||
ERROR("hda: Failed to spawn thread\n");
|
||||
ERROR("Failed to spawn thread\n");
|
||||
goto err;
|
||||
}
|
||||
resume_thread(codec->unsol_response_thread);
|
||||
|
@ -740,9 +740,9 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
stream->buffer_size = ALIGN(stream->buffer_length * stream->num_channels
|
||||
* stream->sample_size, 128);
|
||||
|
||||
dprintf("HDA: sample size %ld, num channels %ld, buffer length %ld\n",
|
||||
dprintf("hda: sample size %ld, num channels %ld, buffer length %ld\n",
|
||||
stream->sample_size, stream->num_channels, stream->buffer_length);
|
||||
dprintf("IRA: %s: setup stream %ld: SR=%ld, SF=%ld F=0x%x (0x%lx)\n",
|
||||
dprintf("hda: %s: setup stream %ld: SR=%ld, SF=%ld F=0x%x (0x%lx)\n",
|
||||
__func__, stream->id, stream->rate, stream->bps, format,
|
||||
stream->sample_format);
|
||||
|
||||
@ -772,7 +772,7 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
bufferPhysicalAddress, B_MTR_UC);
|
||||
}
|
||||
|
||||
dprintf("%s(%s): Allocated %lu bytes for %ld buffers\n", __func__, desc,
|
||||
dprintf("hda: %s(%s): Allocated %lu bytes for %ld buffers\n", __func__, desc,
|
||||
alloc, stream->num_buffers);
|
||||
|
||||
// Store pointers (both virtual/physical)
|
||||
@ -811,7 +811,7 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
stream->physical_buffer_descriptors, B_MTR_UC);
|
||||
}
|
||||
|
||||
dprintf("%s(%s): Allocated %ld bytes for %ld BDLEs\n", __func__, desc,
|
||||
dprintf("hda: %s(%s): Allocated %ld bytes for %ld BDLEs\n", __func__, desc,
|
||||
alloc, bdlCount);
|
||||
|
||||
// Setup buffer descriptor list (BDL) entries
|
||||
@ -869,9 +869,9 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
hda_widget* widget = hda_audio_group_get_widget(audioGroup,
|
||||
stream->io_widgets[i]);
|
||||
if ((widget->capabilities.audio & AUDIO_CAP_DIGITAL) != 0) {
|
||||
verb[0] = MAKE_VERB(codec->addr, stream->io_widgets[i],
|
||||
verb[0] = MAKE_VERB(codec->addr, stream->io_widgets[i],
|
||||
VID_SET_DIGITAL_CONVERTER_CONTROL1, format);
|
||||
hda_send_verbs(codec, verb, response, 1);
|
||||
hda_send_verbs(codec, verb, response, 1);
|
||||
}
|
||||
}
|
||||
dprintf("\n");
|
||||
|
@ -18,11 +18,11 @@
|
||||
|
||||
//#define TRACE_MULTI_AUDIO
|
||||
#ifdef TRACE_MULTI_AUDIO
|
||||
# define TRACE(a...) dprintf("\33[34mhda:\33[0m " a)
|
||||
# define TRACE(a...) dprintf("hda: " a)
|
||||
#else
|
||||
# define TRACE(a...) ;
|
||||
#endif
|
||||
#define ERROR(a...) dprintf("\33[34mhda:\33[0m " a)
|
||||
#define ERROR(a...) dprintf("hda: " a)
|
||||
|
||||
typedef enum {
|
||||
B_MIX_GAIN = 1 << 0,
|
||||
@ -92,7 +92,7 @@ get_description(hda_audio_group* audioGroup, multi_description* data)
|
||||
data->input_bus_channel_count = inChannels;
|
||||
data->aux_bus_channel_count = 0;
|
||||
|
||||
dprintf("%s: request_channel_count: %ld\n", __func__,
|
||||
TRACE("%s: request_channel_count: %ld\n", __func__,
|
||||
data->request_channel_count);
|
||||
|
||||
if (data->request_channel_count >= (int)(sizeof(sChannels)
|
||||
@ -1008,7 +1008,7 @@ buffer_exchange(hda_audio_group* audioGroup, multi_buffer_info* data)
|
||||
err = acquire_sem_etc(audioGroup->codec->controller->buffer_ready_sem,
|
||||
1, B_CAN_INTERRUPT, 0);
|
||||
if (err != B_OK) {
|
||||
dprintf("%s: Error waiting for playback buffer to finish (%s)!\n", __func__,
|
||||
ERROR("%s: Error waiting for playback buffer to finish (%s)!\n", __func__,
|
||||
strerror(err));
|
||||
return err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user