xref: /netbsd-src/sys/external/bsd/drm2/dist/include/drm/intel_lpe_audio.h (revision 20b3eca72a814c21590ad0dff56efb261ebd9323)
1 /*	$NetBSD: intel_lpe_audio.h,v 1.3 2021/12/20 12:56:07 riastradh Exp $	*/
2 
3 /*
4  * Copyright © 2016 Intel Corporation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the next
14  * paragraph) shall be included in all copies or substantial portions of the
15  * Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23  * IN THE SOFTWARE.
24  */
25 
26 #ifndef _INTEL_LPE_AUDIO_H_
27 #define _INTEL_LPE_AUDIO_H_
28 
29 #ifdef __NetBSD__
30 #include <sys/types.h>
31 #include <sys/file.h>
32 #define	pipe	pipe_drmhack	/* see intel_display.h */
33 #endif
34 
35 #include <linux/types.h>
36 #include <linux/spinlock_types.h>
37 
38 struct platform_device;
39 
40 #define HDMI_MAX_ELD_BYTES	128
41 
42 struct intel_hdmi_lpe_audio_port_pdata {
43 	u8 eld[HDMI_MAX_ELD_BYTES];
44 	int port;
45 	int pipe;
46 	int ls_clock;
47 	bool dp_output;
48 };
49 
50 struct intel_hdmi_lpe_audio_pdata {
51 	struct intel_hdmi_lpe_audio_port_pdata port[3]; /* for ports B,C,D */
52 	int num_ports;
53 	int num_pipes;
54 
55 	void (*notify_audio_lpe)(struct platform_device *pdev, int port); /* port: 0==B,1==C,2==D */
56 	spinlock_t lpe_audio_slock;
57 };
58 
59 #endif /* _I915_LPE_AUDIO_H_ */
60