Lines Matching +full:codec +full:-
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
6 * Copyright (c) 2008-2012 Alexander Motin <mav@FreeBSD.org>
32 * Intel High Definition Audio (CODEC) driver for FreeBSD.
63 #define hdacc_lock(codec) snd_mtxlock((codec)->lock) argument
64 #define hdacc_unlock(codec) snd_mtxunlock((codec)->lock) argument
65 #define hdacc_lockassert(codec) snd_mtxassert((codec)->lock) argument
67 MALLOC_DEFINE(M_HDACC, "hdacc", "HDA CODEC");
123 { HDA_CODEC_ALC660, 0, "Realtek ALC660-VD" },
138 { HDA_CODEC_ALC861VD, 0, "Realtek ALC861-VD" },
173 { HDA_CODEC_CA0110, 0, "Creative CA0110-IBG" },
174 { HDA_CODEC_CA0110_2, 0, "Creative CA0110-IBG" },
176 { HDA_CODEC_SB0880, 0, "Creative SB0880 X-Fi" },
399 { HDA_CODEC_INTELTGLKH, 0, "Intel Tiger Lake-H" },
480 device_set_descf(dev, "%s HDA CODEC", buf); in hdacc_probe()
487 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_attach() local
495 codec->lock = HDAC_GET_MTX(device_get_parent(dev), dev); in hdacc_attach()
496 codec->dev = dev; in hdacc_attach()
497 codec->cad = cad; in hdacc_attach()
499 hdacc_lock(codec); in hdacc_attach()
502 hdacc_unlock(codec); in hdacc_attach()
505 codec->fgcnt = HDA_PARAM_SUB_NODE_COUNT_TOTAL(subnode); in hdacc_attach()
507 endnode = startnode + codec->fgcnt; in hdacc_attach()
511 "Root Node at nid=0: %d subnodes %d-%d\n", in hdacc_attach()
513 startnode, endnode - 1); in hdacc_attach()
516 codec->fgs = malloc(sizeof(struct hdacc_fg) * codec->fgcnt, in hdacc_attach()
519 codec->fgs[n].nid = i; in hdacc_attach()
520 hdacc_lock(codec); in hdacc_attach()
521 codec->fgs[n].type = in hdacc_attach()
524 codec->fgs[n].subsystem_id = hda_command(dev, in hdacc_attach()
526 hdacc_unlock(codec); in hdacc_attach()
527 codec->fgs[n].dev = child = device_add_child(dev, NULL, DEVICE_UNIT_ANY); in hdacc_attach()
532 device_set_ivars(child, &codec->fgs[n]); in hdacc_attach()
543 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_detach() local
548 free(codec->fgs, M_HDACC); in hdacc_detach()
557 sbuf_printf(sb, "nid=%d", fg->nid); in hdacc_child_location()
567 fg->type, fg->subsystem_id); in hdacc_child_pnpinfo_method()
578 retval += printf(" at nid %d", fg->nid); in hdacc_print_child()
587 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_probe_nomatch() local
593 fg->type == HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO ? "Audio" : in hdacc_probe_nomatch()
594 (fg->type == HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_MODEM ? "Modem" : in hdacc_probe_nomatch()
595 "Unknown"), fg->nid, device_get_nameunit(dev)); in hdacc_probe_nomatch()
602 fg->nid); in hdacc_probe_nomatch()
604 hdacc_lock(codec); in hdacc_probe_nomatch()
606 fg->nid, HDA_CMD_POWER_STATE_D3)); in hdacc_probe_nomatch()
607 hdacc_unlock(codec); in hdacc_probe_nomatch()
617 *result = fg->nid; in hdacc_read_ivar()
620 *result = fg->type; in hdacc_read_ivar()
623 *result = fg->subsystem_id; in hdacc_read_ivar()
635 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_get_mtx() local
637 return (codec->lock); in hdacc_get_mtx()
651 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_stream_alloc() local
657 codec->streams[dir][stream] = child; in hdacc_stream_alloc()
664 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_stream_free() local
666 codec->streams[dir][stream] = NULL; in hdacc_stream_free()
703 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_stream_intr() local
706 if ((child = codec->streams[dir][stream]) != NULL) in hdacc_stream_intr()
713 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_unsol_alloc() local
719 if (codec->tags[tag] == NULL) { in hdacc_unsol_alloc()
720 codec->tags[tag] = child; in hdacc_unsol_alloc()
727 return (-1); in hdacc_unsol_alloc()
733 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_unsol_free() local
736 codec->tags[tag] = NULL; in hdacc_unsol_free()
743 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_unsol_intr() local
748 if ((child = codec->tags[tag]) != NULL) in hdacc_unsol_intr()
751 device_printf(codec->dev, "Unexpected unsolicited " in hdacc_unsol_intr()