Lines Matching +full:codec +full:- +full:2

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
6 * Copyright (c) 2008-2012 Alexander Motin <mav@FreeBSD.org>
14 * 2. Redistributions in binary form must reproduce the above copyright
32 * Intel High Definition Audio (CODEC) driver for FreeBSD.
57 device_t streams[2][16];
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");
122 { HDA_CODEC_ALC660, 0, "Realtek ALC660-VD" },
137 { HDA_CODEC_ALC861VD, 0, "Realtek ALC861-VD" },
171 { HDA_CODEC_CA0110, 0, "Creative CA0110-IBG" },
172 { HDA_CODEC_CA0110_2, 0, "Creative CA0110-IBG" },
174 { HDA_CODEC_SB0880, 0, "Creative SB0880 X-Fi" },
295 { HDA_CODEC_CX20751, 0, "Conexant CX20751/2" },
296 { HDA_CODEC_CX20751_2, 0, "Conexant CX20751/2" },
397 { HDA_CODEC_INTELTGLKH, 0, "Intel Tiger Lake-H" },
478 device_set_descf(dev, "%s HDA CODEC", buf); in hdacc_probe()
485 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_attach() local
493 codec->lock = HDAC_GET_MTX(device_get_parent(dev), dev); in hdacc_attach()
494 codec->dev = dev; in hdacc_attach()
495 codec->cad = cad; in hdacc_attach()
497 hdacc_lock(codec); in hdacc_attach()
500 hdacc_unlock(codec); in hdacc_attach()
503 codec->fgcnt = HDA_PARAM_SUB_NODE_COUNT_TOTAL(subnode); in hdacc_attach()
505 endnode = startnode + codec->fgcnt; in hdacc_attach()
509 "Root Node at nid=0: %d subnodes %d-%d\n", in hdacc_attach()
511 startnode, endnode - 1); in hdacc_attach()
514 codec->fgs = malloc(sizeof(struct hdacc_fg) * codec->fgcnt, in hdacc_attach()
517 codec->fgs[n].nid = i; in hdacc_attach()
518 hdacc_lock(codec); in hdacc_attach()
519 codec->fgs[n].type = in hdacc_attach()
522 codec->fgs[n].subsystem_id = hda_command(dev, in hdacc_attach()
524 hdacc_unlock(codec); in hdacc_attach()
525 codec->fgs[n].dev = child = device_add_child(dev, NULL, DEVICE_UNIT_ANY); in hdacc_attach()
530 device_set_ivars(child, &codec->fgs[n]); in hdacc_attach()
541 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_detach() local
546 free(codec->fgs, M_HDACC); in hdacc_detach()
555 sbuf_printf(sb, "nid=%d", fg->nid); in hdacc_child_location()
565 fg->type, fg->subsystem_id); in hdacc_child_pnpinfo_method()
576 retval += printf(" at nid %d", fg->nid); in hdacc_print_child()
585 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_probe_nomatch() local
591 fg->type == HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO ? "Audio" : in hdacc_probe_nomatch()
592 (fg->type == HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_MODEM ? "Modem" : in hdacc_probe_nomatch()
593 "Unknown"), fg->nid, device_get_nameunit(dev)); in hdacc_probe_nomatch()
600 fg->nid); in hdacc_probe_nomatch()
602 hdacc_lock(codec); in hdacc_probe_nomatch()
604 fg->nid, HDA_CMD_POWER_STATE_D3)); in hdacc_probe_nomatch()
605 hdacc_unlock(codec); in hdacc_probe_nomatch()
615 *result = fg->nid; in hdacc_read_ivar()
618 *result = fg->type; in hdacc_read_ivar()
621 *result = fg->subsystem_id; in hdacc_read_ivar()
633 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_get_mtx() local
635 return (codec->lock); in hdacc_get_mtx()
649 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_stream_alloc() local
655 codec->streams[dir][stream] = child; in hdacc_stream_alloc()
662 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_stream_free() local
664 codec->streams[dir][stream] = NULL; in hdacc_stream_free()
701 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_stream_intr() local
704 if ((child = codec->streams[dir][stream]) != NULL) in hdacc_stream_intr()
711 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_unsol_alloc() local
717 if (codec->tags[tag] == NULL) { in hdacc_unsol_alloc()
718 codec->tags[tag] = child; in hdacc_unsol_alloc()
725 return (-1); in hdacc_unsol_alloc()
731 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_unsol_free() local
734 codec->tags[tag] = NULL; in hdacc_unsol_free()
741 struct hdacc_softc *codec = device_get_softc(dev); in hdacc_unsol_intr() local
746 if ((child = codec->tags[tag]) != NULL) in hdacc_unsol_intr()
749 device_printf(codec->dev, "Unexpected unsolicited " in hdacc_unsol_intr()