Lines Matching +full:tegra124 +full:- +full:hda
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
6 * Copyright (c) 2008-2012 Alexander Motin <mav@FreeBSD.org>
43 #include <dev/sound/pci/hda/hda_reg.h>
44 #include <dev/sound/pci/hda/hdac.h>
63 #define hdacc_lock(codec) snd_mtxlock((codec)->lock)
64 #define hdacc_unlock(codec) snd_mtxunlock((codec)->lock)
65 #define hdacc_lockassert(codec) snd_mtxassert((codec)->lock)
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" },
374 { HDA_CODEC_NVIDIATEGRA124, 0, "NVIDIA Tegra124" },
399 { HDA_CODEC_INTELTGLKH, 0, "Intel Tiger Lake-H" },
480 device_set_descf(dev, "%s HDA CODEC", buf); in hdacc_probe()
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()
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()
521 codec->fgs[n].type = in hdacc_attach()
524 codec->fgs[n].subsystem_id = hda_command(dev, 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()
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()
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()
606 fg->nid, HDA_CMD_POWER_STATE_D3)); 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()
637 return (codec->lock); in hdacc_get_mtx()
657 codec->streams[dir][stream] = child; in hdacc_stream_alloc()
666 codec->streams[dir][stream] = NULL; in hdacc_stream_free()
706 if ((child = codec->streams[dir][stream]) != NULL) in hdacc_stream_intr()
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()
736 codec->tags[tag] = NULL; in hdacc_unsol_free()
748 if ((child = codec->tags[tag]) != NULL) in hdacc_unsol_intr()
751 device_printf(codec->dev, "Unexpected unsolicited " in hdacc_unsol_intr()