xref: /dflybsd-src/sys/dev/sound/pci/hda/hdac_if.m (revision 67931cc46b2c63adf26460fc9f0e333e55b5ccbe)
12a1ad637SFrançois Tigeot# Copyright (c) 2012 Alexander Motin <mav@FreeBSD.org>
22a1ad637SFrançois Tigeot# All rights reserved.
32a1ad637SFrançois Tigeot#
42a1ad637SFrançois Tigeot# Redistribution and use in source and binary forms, with or without
52a1ad637SFrançois Tigeot# modification, are permitted provided that the following conditions
62a1ad637SFrançois Tigeot# are met:
72a1ad637SFrançois Tigeot# 1. Redistributions of source code must retain the above copyright
82a1ad637SFrançois Tigeot#    notice, this list of conditions and the following disclaimer,
92a1ad637SFrançois Tigeot#    without modification, immediately at the beginning of the file.
102a1ad637SFrançois Tigeot# 2. Redistributions in binary form must reproduce the above copyright
112a1ad637SFrançois Tigeot#    notice, this list of conditions and the following disclaimer in the
122a1ad637SFrançois Tigeot#    documentation and/or other materials provided with the distribution.
132a1ad637SFrançois Tigeot#
142a1ad637SFrançois Tigeot# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
152a1ad637SFrançois Tigeot# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
162a1ad637SFrançois Tigeot# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
172a1ad637SFrançois Tigeot# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
182a1ad637SFrançois Tigeot# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
192a1ad637SFrançois Tigeot# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
202a1ad637SFrançois Tigeot# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
212a1ad637SFrançois Tigeot# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
222a1ad637SFrançois Tigeot# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
232a1ad637SFrançois Tigeot# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
242a1ad637SFrançois Tigeot#
252a1ad637SFrançois Tigeot# $FreeBSD: head/sys/dev/sound/pci/hda/hdac_if.m 230326 2012-01-19 01:55:48Z mav $
262a1ad637SFrançois Tigeot
272a1ad637SFrançois Tigeot#include <sys/rman.h>
282a1ad637SFrançois Tigeot
292a1ad637SFrançois TigeotINTERFACE hdac;
302a1ad637SFrançois Tigeot
31*67931cc4SFrançois TigeotMETHOD struct lock * get_mtx {
322a1ad637SFrançois Tigeot    device_t    dev;
332a1ad637SFrançois Tigeot    device_t    child;
342a1ad637SFrançois Tigeot};
352a1ad637SFrançois Tigeot
362a1ad637SFrançois TigeotMETHOD uint32_t codec_command {
372a1ad637SFrançois Tigeot    device_t    dev;
382a1ad637SFrançois Tigeot    device_t    child;
392a1ad637SFrançois Tigeot    uint32_t    verb;
402a1ad637SFrançois Tigeot};
412a1ad637SFrançois Tigeot
422a1ad637SFrançois TigeotMETHOD int stream_alloc {
432a1ad637SFrançois Tigeot    device_t    dev;
442a1ad637SFrançois Tigeot    device_t    child;
452a1ad637SFrançois Tigeot    int         dir;
462a1ad637SFrançois Tigeot    int         format;
472a1ad637SFrançois Tigeot    int         stripe;
482a1ad637SFrançois Tigeot    uint32_t    **dmapos;
492a1ad637SFrançois Tigeot};
502a1ad637SFrançois Tigeot
512a1ad637SFrançois TigeotMETHOD void stream_free {
522a1ad637SFrançois Tigeot    device_t    dev;
532a1ad637SFrançois Tigeot    device_t    child;
542a1ad637SFrançois Tigeot    int         dir;
552a1ad637SFrançois Tigeot    int         stream;
562a1ad637SFrançois Tigeot};
572a1ad637SFrançois Tigeot
582a1ad637SFrançois TigeotMETHOD int stream_start {
592a1ad637SFrançois Tigeot    device_t    dev;
602a1ad637SFrançois Tigeot    device_t    child;
612a1ad637SFrançois Tigeot    int         dir;
622a1ad637SFrançois Tigeot    int         stream;
632a1ad637SFrançois Tigeot    bus_addr_t  buf;
642a1ad637SFrançois Tigeot    int         blksz;
652a1ad637SFrançois Tigeot    int         blkcnt;
662a1ad637SFrançois Tigeot};
672a1ad637SFrançois Tigeot
682a1ad637SFrançois TigeotMETHOD void stream_stop {
692a1ad637SFrançois Tigeot    device_t    dev;
702a1ad637SFrançois Tigeot    device_t    child;
712a1ad637SFrançois Tigeot    int         dir;
722a1ad637SFrançois Tigeot    int         stream;
732a1ad637SFrançois Tigeot};
742a1ad637SFrançois Tigeot
752a1ad637SFrançois TigeotMETHOD void stream_reset {
762a1ad637SFrançois Tigeot    device_t    dev;
772a1ad637SFrançois Tigeot    device_t    child;
782a1ad637SFrançois Tigeot    int         dir;
792a1ad637SFrançois Tigeot    int         stream;
802a1ad637SFrançois Tigeot};
812a1ad637SFrançois Tigeot
822a1ad637SFrançois TigeotMETHOD uint32_t stream_getptr {
832a1ad637SFrançois Tigeot    device_t    dev;
842a1ad637SFrançois Tigeot    device_t    child;
852a1ad637SFrançois Tigeot    int         dir;
862a1ad637SFrançois Tigeot    int         stream;
872a1ad637SFrançois Tigeot};
882a1ad637SFrançois Tigeot
892a1ad637SFrançois TigeotMETHOD void stream_intr {
902a1ad637SFrançois Tigeot    device_t    dev;
912a1ad637SFrançois Tigeot    int         dir;
922a1ad637SFrançois Tigeot    int         stream;
932a1ad637SFrançois Tigeot};
942a1ad637SFrançois Tigeot
952a1ad637SFrançois TigeotMETHOD int unsol_alloc {
962a1ad637SFrançois Tigeot    device_t    dev;
972a1ad637SFrançois Tigeot    device_t    child;
982a1ad637SFrançois Tigeot    int         wanted;
992a1ad637SFrançois Tigeot};
1002a1ad637SFrançois Tigeot
1012a1ad637SFrançois TigeotMETHOD void unsol_free {
1022a1ad637SFrançois Tigeot    device_t    dev;
1032a1ad637SFrançois Tigeot    device_t    child;
1042a1ad637SFrançois Tigeot    int         tag;
1052a1ad637SFrançois Tigeot};
1062a1ad637SFrançois Tigeot
1072a1ad637SFrançois TigeotMETHOD void unsol_intr {
1082a1ad637SFrançois Tigeot    device_t    dev;
1092a1ad637SFrançois Tigeot    uint32_t    resp;
1102a1ad637SFrançois Tigeot};
1112a1ad637SFrançois Tigeot
1122a1ad637SFrançois TigeotMETHOD void pindump {
1132a1ad637SFrançois Tigeot    device_t    dev;
1142a1ad637SFrançois Tigeot};
1152a1ad637SFrançois Tigeot
116