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