1 /* evergreen_hdmi.h -- Private header for radeon driver -*- linux-c -*-
2  *
3  * Copyright 2008 Advanced Micro Devices, Inc.
4  * Copyright 2008 Red Hat Inc.
5  * Copyright 2009 Christian König.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a
8  * copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation
10  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11  * and/or sell copies of the Software, and to permit persons to whom the
12  * Software is furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice (including the next
15  * paragraph) shall be included in all copies or substantial portions of the
16  * Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
21  * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24  * DEALINGS IN THE SOFTWARE.
25  *
26  */
27 
28 #ifndef __EVERGREEN_HDMI_H__
29 #define __EVERGREEN_HDMI_H__
30 
31 struct cea_sa;
32 struct cea_sad;
33 struct drm_connector;
34 struct drm_display_mode;
35 struct drm_encoder;
36 struct r600_audio_pin;
37 struct radeon_crtc;
38 struct radeon_device;
39 struct radeon_hdmi_acr;
40 
41 void evergreen_hdmi_write_sad_regs(struct drm_encoder *encoder,
42 				   struct cea_sad *sads, int sad_count);
43 void evergreen_set_avi_packet(struct radeon_device *rdev, u32 offset,
44 			      unsigned char *buffer, size_t size);
45 void evergreen_hdmi_update_acr(struct drm_encoder *encoder, long offset,
46 			       const struct radeon_hdmi_acr *acr);
47 void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable);
48 void evergreen_dp_enable(struct drm_encoder *encoder, bool enable);
49 
50 void dce4_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin,
51 		       u8 enable_mask);
52 void dce4_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
53 					     u8 *sadb, int sad_count);
54 void dce4_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
55 					   u8 *sadb, int sad_count);
56 void dce4_afmt_write_latency_fields(struct drm_encoder *encoder,
57 				    struct drm_connector *connector,
58 				    struct drm_display_mode *mode);
59 void dce4_hdmi_audio_set_dto(struct radeon_device *rdev,
60 			     struct radeon_crtc *crtc, unsigned int clock);
61 void dce4_dp_audio_set_dto(struct radeon_device *rdev,
62 			   struct radeon_crtc *crtc, unsigned int clock);
63 void dce4_set_vbi_packet(struct drm_encoder *encoder, u32 offset);
64 void dce4_hdmi_set_color_depth(struct drm_encoder *encoder,
65 			       u32 offset, int bpc);
66 void dce4_set_audio_packet(struct drm_encoder *encoder, u32 offset);
67 void dce4_set_mute(struct drm_encoder *encoder, u32 offset, bool mute);
68 
69 #endif				/* __EVERGREEN_HDMI_H__ */
70