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


Ignore:
Timestamp:
2019-12-15T11:57:25Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9e45a41
Parents:
894afff
Message:

Fix logging level of HD Audio driver messages

File:
1 edited

Legend:

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

    r894afff rcf78637  
    7070#if 0
    7171        if (resp != NULL) {
    72                 ddf_msg(LVL_NOTE, "verb 0x%" PRIx32 " -> 0x%" PRIx32, verb,
     72                ddf_msg(LVL_DEBUG, "verb 0x%" PRIx32 " -> 0x%" PRIx32, verb,
    7373                    *resp);
    7474        } else {
    75                 ddf_msg(LVL_NOTE, "verb 0x%" PRIx32, verb);
     75                ddf_msg(LVL_DEBUG, "verb 0x%" PRIx32, verb);
    7676        }
    7777#endif
     
    273273
    274274        offset = ampcaps & 0x7f;
    275         ddf_msg(LVL_NOTE, "out amp caps 0x%x (offset=0x%x)",
     275        ddf_msg(LVL_DEBUG, "out amp caps 0x%x (offset=0x%x)",
    276276            ampcaps, offset);
    277277
     
    288288                goto error;
    289289
    290         ddf_msg(LVL_NOTE, "gain/mute: L:0x%x R:0x%x", gmleft, gmright);
     290        ddf_msg(LVL_DEBUG, "gain/mute: L:0x%x R:0x%x", gmleft, gmright);
    291291
    292292        return EOK;
     
    309309
    310310        offset = ampcaps & 0x7f;
    311         ddf_msg(LVL_NOTE, "in amp caps 0x%x (offset=0x%x)", ampcaps, offset);
     311        ddf_msg(LVL_DEBUG, "in amp caps 0x%x (offset=0x%x)", ampcaps, offset);
    312312
    313313        for (i = 0; i < 15; i++) {
     
    324324                        goto error;
    325325
    326                 ddf_msg(LVL_NOTE, "in:%d gain/mute: L:0x%x R:0x%x",
     326                ddf_msg(LVL_DEBUG, "in:%d gain/mute: L:0x%x R:0x%x",
    327327                    i, gmleft, gmright);
    328328        }
     
    345345        int i, j;
    346346
    347         ddf_msg(LVL_NOTE, "Connections for widget %d:", aw);
     347        ddf_msg(LVL_DEBUG, "Connections for widget %d:", aw);
    348348
    349349        rc = hda_get_clist_len(codec, aw, &longform, &len);
     
    384384
    385385                for (j = 0; j < epresp && i < len; j++) {
    386                         ddf_msg(LVL_NOTE, "<- %d%s", resp & mask,
     386                        ddf_msg(LVL_DEBUG, "<- %d%s", resp & mask,
    387387                            (int)cidx == i ? " *** current *** " : "");
    388388                        resp = resp >> shift;
     
    406406        if (rc != EOK)
    407407                goto error;
    408         ddf_msg(LVL_NOTE, "aw %d: PIN cdfgef=0x%x",
     408        ddf_msg(LVL_DEBUG, "aw %d: PIN cdfgef=0x%x",
    409409            aw, cfgdef);
    410410
     
    412412        if (rc != EOK)
    413413                goto error;
    414         ddf_msg(LVL_NOTE, "aw %d : PIN caps=0x%x",
     414        ddf_msg(LVL_DEBUG, "aw %d : PIN caps=0x%x",
    415415            aw, pcaps);
    416416
     
    420420                        goto error;
    421421
    422                 ddf_msg(LVL_NOTE, "PIN %d had EAPD value=0x%x", aw, eapd);
     422                ddf_msg(LVL_DEBUG, "PIN %d had EAPD value=0x%x", aw, eapd);
    423423
    424424                rc = hda_set_eapd_btl_enable(codec, aw, eapd | 2);
     
    430430                        goto error;
    431431
    432                 ddf_msg(LVL_NOTE, "PIN %d now has EAPD value=0x%x", aw, eapd);
     432                ddf_msg(LVL_DEBUG, "PIN %d now has EAPD value=0x%x", aw, eapd);
    433433        }
    434434
    435435        pctl = 0;
    436436        if ((pcaps & BIT_V(uint32_t, pwc_output)) != 0) {
    437                 ddf_msg(LVL_NOTE, "PIN %d will enable output", aw);
     437                ddf_msg(LVL_DEBUG, "PIN %d will enable output", aw);
    438438                pctl = pctl | BIT_V(uint8_t, pctl_out_enable);
    439439        }
    440440
    441441        if ((pcaps & BIT_V(uint32_t, pwc_input)) != 0) {
    442                 ddf_msg(LVL_NOTE, "PIN %d will enable input", aw);
     442                ddf_msg(LVL_DEBUG, "PIN %d will enable input", aw);
    443443                pctl = pctl | BIT_V(uint8_t, pctl_in_enable);
    444444        }
    445445
    446446        if ((pcaps & BIT_V(uint32_t, pwc_hpd)) != 0) {
    447                 ddf_msg(LVL_NOTE, "PIN %d will enable headphone drive", aw);
     447                ddf_msg(LVL_DEBUG, "PIN %d will enable headphone drive", aw);
    448448                pctl = pctl | BIT_V(uint8_t, pctl_hpd_enable);
    449449        }
     
    451451#if 0
    452452        if ((pcaps & BIT_V(uint32_t, pwc_input)) != 0) {
    453                 ddf_msg(LVL_NOTE, "PIN %d will enable input");
     453                ddf_msg(LVL_DEBUG, "PIN %d will enable input");
    454454                pctl = pctl | BIT_V(uint8_t, pctl_input_enable);
    455455        }
    456456#endif
    457         ddf_msg(LVL_NOTE, "Setting PIN %d ctl to 0x%x", aw, pctl);
     457        ddf_msg(LVL_DEBUG, "Setting PIN %d ctl to 0x%x", aw, pctl);
    458458        rc = hda_set_pin_ctl(codec, aw, pctl);
    459459        if (rc != EOK)
     
    465465                goto error;
    466466
    467         ddf_msg(LVL_NOTE, "PIN %d ctl reads as 0x%x", aw, pctl);
     467        ddf_msg(LVL_DEBUG, "PIN %d ctl reads as 0x%x", aw, pctl);
    468468
    469469        return EOK;
     
    478478        uint32_t pwrstate;
    479479
    480         ddf_msg(LVL_NOTE, "aw %d is power control-capable", aw);
     480        ddf_msg(LVL_DEBUG, "aw %d is power control-capable", aw);
    481481
    482482        rc = hda_get_power_state(codec, aw, &pwrstate);
    483483        if (rc != EOK)
    484484                goto error;
    485         ddf_msg(LVL_NOTE, "aw %d: power state = 0x%x", aw, pwrstate);
     485        ddf_msg(LVL_DEBUG, "aw %d: power state = 0x%x", aw, pwrstate);
    486486
    487487        return EOK;
     
    517517                goto error;
    518518
    519         ddf_msg(LVL_NOTE, "hda_get_subnc -> %s", str_error_name(rc));
    520         ddf_msg(LVL_NOTE, "sfg=%d nfg=%d", sfg, nfg);
     519        ddf_msg(LVL_DEBUG, "hda_get_subnc -> %s", str_error_name(rc));
     520        ddf_msg(LVL_DEBUG, "sfg=%d nfg=%d", sfg, nfg);
    521521
    522522        for (fg = sfg; fg < sfg + nfg; fg++) {
    523                 ddf_msg(LVL_NOTE, "Enumerate FG %d", fg);
     523                ddf_msg(LVL_DEBUG, "Enumerate FG %d", fg);
    524524
    525525                rc = hda_get_fgrp_type(codec, fg, &unsol, &grptype);
     
    527527                        goto error;
    528528
    529                 ddf_msg(LVL_NOTE, "hda_get_fgrp_type -> %s", str_error_name(rc));
    530                 ddf_msg(LVL_NOTE, "unsol: %d, grptype: %d", unsol, grptype);
     529                ddf_msg(LVL_DEBUG, "hda_get_fgrp_type -> %s", str_error_name(rc));
     530                ddf_msg(LVL_DEBUG, "unsol: %d, grptype: %d", unsol, grptype);
    531531
    532532                rc = hda_get_gpio_cnt(codec, fg, &gpio);
     
    534534                        goto error;
    535535
    536                 ddf_msg(LVL_NOTE, "GPIO: wake=%d unsol=%d gpis=%d gpos=%d gpios=%d",
     536                ddf_msg(LVL_DEBUG, "GPIO: wake=%d unsol=%d gpis=%d gpos=%d gpios=%d",
    537537                    (gpio & BIT_V(uint32_t, 31)) != 0,
    538538                    (gpio & BIT_V(uint32_t, 30)) != 0,
     
    549549                        goto error;
    550550
    551                 ddf_msg(LVL_NOTE, "hda_get_subnc -> %s", str_error_name(rc));
    552                 ddf_msg(LVL_NOTE, "saw=%d baw=%d", saw, naw);
     551                ddf_msg(LVL_DEBUG, "hda_get_subnc -> %s", str_error_name(rc));
     552                ddf_msg(LVL_DEBUG, "saw=%d baw=%d", saw, naw);
    553553
    554554                for (aw = saw; aw < saw + naw; aw++) {
     
    556556                        if (rc != EOK)
    557557                                goto error;
    558                         ddf_msg(LVL_NOTE, "aw %d: type=0x%x caps=0x%x",
     558                        ddf_msg(LVL_DEBUG, "aw %d: type=0x%x caps=0x%x",
    559559                            aw, awtype, awcaps);
    560560
     
    594594                                        goto error;
    595595
    596                                 ddf_msg(LVL_NOTE, "Output widget %d: rates=0x%x formats=0x%x",
     596                                ddf_msg(LVL_DEBUG, "Output widget %d: rates=0x%x formats=0x%x",
    597597                                    aw, rates, formats);
    598598                        } else if (awtype == awt_audio_input) {
    599599                                if (codec->in_aw < 0) {
    600                                         ddf_msg(LVL_NOTE, "Selected input "
     600                                        ddf_msg(LVL_DEBUG, "Selected input "
    601601                                            "widget %d\n", aw);
    602602                                        codec->in_aw = aw;
    603603                                } else {
    604                                         ddf_msg(LVL_NOTE, "Ignoring input "
     604                                        ddf_msg(LVL_DEBUG, "Ignoring input "
    605605                                            "widget %d\n", aw);
    606606                                }
     
    614614                                        goto error;
    615615
    616                                 ddf_msg(LVL_NOTE, "Input widget %d: rates=0x%x formats=0x%x",
     616                                ddf_msg(LVL_DEBUG, "Input widget %d: rates=0x%x formats=0x%x",
    617617                                    aw, rates, formats);
    618618                        }
     
    628628        hda_ctl_dump_info(hda->ctl);
    629629
    630         ddf_msg(LVL_NOTE, "Codec OK");
     630        ddf_msg(LVL_DEBUG, "Codec OK");
    631631        return codec;
    632632error:
     
    637637void hda_codec_fini(hda_codec_t *codec)
    638638{
    639         ddf_msg(LVL_NOTE, "hda_codec_fini()");
     639        ddf_msg(LVL_DEBUG, "hda_codec_fini()");
    640640        free(codec);
    641641}
     
    652652                /* Configure converter */
    653653
    654                 ddf_msg(LVL_NOTE, "Configure output converter format");
     654                ddf_msg(LVL_DEBUG, "Configure output converter format");
    655655                rc = hda_set_converter_fmt(codec, out_aw, stream->fmt);
    656656                if (rc != EOK)
    657657                        goto error;
    658658
    659                 ddf_msg(LVL_NOTE, "Configure output converter stream, channel");
     659                ddf_msg(LVL_DEBUG, "Configure output converter stream, channel");
    660660                rc = hda_set_converter_ctl(codec, out_aw, stream->sid, 0);
    661661                if (rc != EOK)
     
    674674        /* Configure converter */
    675675
    676         ddf_msg(LVL_NOTE, "Configure input converter format");
     676        ddf_msg(LVL_DEBUG, "Configure input converter format");
    677677        rc = hda_set_converter_fmt(codec, codec->in_aw, stream->fmt);
    678678        if (rc != EOK)
    679679                goto error;
    680680
    681         ddf_msg(LVL_NOTE, "Configure input converter stream, channel");
     681        ddf_msg(LVL_DEBUG, "Configure input converter stream, channel");
    682682        rc = hda_set_converter_ctl(codec, codec->in_aw, stream->sid, 0);
    683683        if (rc != EOK)
Note: See TracChangeset for help on using the changeset viewer.