xref: /freebsd/sys/dev/sound/pci/hda/hdac_if.m (revision 7c6b05d2808bc66bcbe81196f5709c137be1d890)
1*7c6b05d2SAlexander Motin# Copyright (c) 2012 Alexander Motin <mav@FreeBSD.org>
2*7c6b05d2SAlexander Motin# All rights reserved.
3*7c6b05d2SAlexander Motin#
4*7c6b05d2SAlexander Motin# Redistribution and use in source and binary forms, with or without
5*7c6b05d2SAlexander Motin# modification, are permitted provided that the following conditions
6*7c6b05d2SAlexander Motin# are met:
7*7c6b05d2SAlexander Motin# 1. Redistributions of source code must retain the above copyright
8*7c6b05d2SAlexander Motin#    notice, this list of conditions and the following disclaimer,
9*7c6b05d2SAlexander Motin#    without modification, immediately at the beginning of the file.
10*7c6b05d2SAlexander Motin# 2. Redistributions in binary form must reproduce the above copyright
11*7c6b05d2SAlexander Motin#    notice, this list of conditions and the following disclaimer in the
12*7c6b05d2SAlexander Motin#    documentation and/or other materials provided with the distribution.
13*7c6b05d2SAlexander Motin#
14*7c6b05d2SAlexander Motin# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15*7c6b05d2SAlexander Motin# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16*7c6b05d2SAlexander Motin# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17*7c6b05d2SAlexander Motin# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18*7c6b05d2SAlexander Motin# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19*7c6b05d2SAlexander Motin# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20*7c6b05d2SAlexander Motin# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21*7c6b05d2SAlexander Motin# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22*7c6b05d2SAlexander Motin# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23*7c6b05d2SAlexander Motin# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24*7c6b05d2SAlexander Motin#
25*7c6b05d2SAlexander Motin# $FreeBSD$
26*7c6b05d2SAlexander Motin
27*7c6b05d2SAlexander Motin#include <sys/rman.h>
28*7c6b05d2SAlexander Motin
29*7c6b05d2SAlexander MotinINTERFACE hdac;
30*7c6b05d2SAlexander Motin
31*7c6b05d2SAlexander MotinMETHOD struct mtx * get_mtx {
32*7c6b05d2SAlexander Motin    device_t    dev;
33*7c6b05d2SAlexander Motin    device_t    child;
34*7c6b05d2SAlexander Motin};
35*7c6b05d2SAlexander Motin
36*7c6b05d2SAlexander MotinMETHOD uint32_t codec_command {
37*7c6b05d2SAlexander Motin    device_t    dev;
38*7c6b05d2SAlexander Motin    device_t    child;
39*7c6b05d2SAlexander Motin    uint32_t    verb;
40*7c6b05d2SAlexander Motin};
41*7c6b05d2SAlexander Motin
42*7c6b05d2SAlexander MotinMETHOD int stream_alloc {
43*7c6b05d2SAlexander Motin    device_t    dev;
44*7c6b05d2SAlexander Motin    device_t    child;
45*7c6b05d2SAlexander Motin    int         dir;
46*7c6b05d2SAlexander Motin    int         format;
47*7c6b05d2SAlexander Motin    uint32_t    **dmapos;
48*7c6b05d2SAlexander Motin};
49*7c6b05d2SAlexander Motin
50*7c6b05d2SAlexander MotinMETHOD void stream_free {
51*7c6b05d2SAlexander Motin    device_t    dev;
52*7c6b05d2SAlexander Motin    device_t    child;
53*7c6b05d2SAlexander Motin    int         dir;
54*7c6b05d2SAlexander Motin    int         stream;
55*7c6b05d2SAlexander Motin};
56*7c6b05d2SAlexander Motin
57*7c6b05d2SAlexander MotinMETHOD int stream_start {
58*7c6b05d2SAlexander Motin    device_t    dev;
59*7c6b05d2SAlexander Motin    device_t    child;
60*7c6b05d2SAlexander Motin    int         dir;
61*7c6b05d2SAlexander Motin    int         stream;
62*7c6b05d2SAlexander Motin    bus_addr_t  buf;
63*7c6b05d2SAlexander Motin    int         blksz;
64*7c6b05d2SAlexander Motin    int         blkcnt;
65*7c6b05d2SAlexander Motin};
66*7c6b05d2SAlexander Motin
67*7c6b05d2SAlexander MotinMETHOD void stream_stop {
68*7c6b05d2SAlexander Motin    device_t    dev;
69*7c6b05d2SAlexander Motin    device_t    child;
70*7c6b05d2SAlexander Motin    int         dir;
71*7c6b05d2SAlexander Motin    int         stream;
72*7c6b05d2SAlexander Motin};
73*7c6b05d2SAlexander Motin
74*7c6b05d2SAlexander MotinMETHOD void stream_reset {
75*7c6b05d2SAlexander Motin    device_t    dev;
76*7c6b05d2SAlexander Motin    device_t    child;
77*7c6b05d2SAlexander Motin    int         dir;
78*7c6b05d2SAlexander Motin    int         stream;
79*7c6b05d2SAlexander Motin};
80*7c6b05d2SAlexander Motin
81*7c6b05d2SAlexander MotinMETHOD uint32_t stream_getptr {
82*7c6b05d2SAlexander Motin    device_t    dev;
83*7c6b05d2SAlexander Motin    device_t    child;
84*7c6b05d2SAlexander Motin    int         dir;
85*7c6b05d2SAlexander Motin    int         stream;
86*7c6b05d2SAlexander Motin};
87*7c6b05d2SAlexander Motin
88*7c6b05d2SAlexander MotinMETHOD void stream_intr {
89*7c6b05d2SAlexander Motin    device_t    dev;
90*7c6b05d2SAlexander Motin    int         dir;
91*7c6b05d2SAlexander Motin    int         stream;
92*7c6b05d2SAlexander Motin};
93*7c6b05d2SAlexander Motin
94*7c6b05d2SAlexander MotinMETHOD int unsol_alloc {
95*7c6b05d2SAlexander Motin    device_t    dev;
96*7c6b05d2SAlexander Motin    device_t    child;
97*7c6b05d2SAlexander Motin    int         wanted;
98*7c6b05d2SAlexander Motin};
99*7c6b05d2SAlexander Motin
100*7c6b05d2SAlexander MotinMETHOD void unsol_free {
101*7c6b05d2SAlexander Motin    device_t    dev;
102*7c6b05d2SAlexander Motin    device_t    child;
103*7c6b05d2SAlexander Motin    int         tag;
104*7c6b05d2SAlexander Motin};
105*7c6b05d2SAlexander Motin
106*7c6b05d2SAlexander MotinMETHOD void unsol_intr {
107*7c6b05d2SAlexander Motin    device_t    dev;
108*7c6b05d2SAlexander Motin    uint32_t    resp;
109*7c6b05d2SAlexander Motin};
110*7c6b05d2SAlexander Motin
111*7c6b05d2SAlexander MotinMETHOD void pindump {
112*7c6b05d2SAlexander Motin    device_t    dev;
113*7c6b05d2SAlexander Motin};
114*7c6b05d2SAlexander Motin
115