2 * Copyright 2011-2015, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Michael Lotz, mmlr@mlotz.ch
7 * Alexander von Gluck IV, kallisti5@unixzen.com
15 #include "intel_extreme.h"
21 #define MAX_PORTS 20 // a generous upper bound
26 INTEL_PORT_TYPE_ANY
, // wildcard for lookup functions
27 INTEL_PORT_TYPE_ANALOG
,
36 INTEL_PORT_ANY
, // wildcard for lookup functions
47 Port(port_index index
,
48 const char* baseName
);
51 virtual uint32
Type() const = 0;
52 const char* PortName() const
55 port_index
PortIndex() const
56 { return fPortIndex
; }
58 virtual bool IsConnected() = 0;
60 status_t
SetPipe(Pipe
* pipe
);
64 virtual status_t
Power(bool enabled
);
67 virtual status_t
GetEDID(edid1_info
* edid
,
68 bool forceRead
= false);
70 virtual status_t
GetPLLLimits(pll_limits
& limits
);
72 virtual status_t
SetDisplayMode(display_mode
* mode
,
73 uint32 colorMode
) { return B_ERROR
; };
75 virtual pipe_index
PipePreference()
76 { return INTEL_PIPE_ANY
; };
79 void _SetName(const char* name
);
81 static status_t
_GetI2CSignals(void* cookie
, int* _clock
,
83 static status_t
_SetI2CSignals(void* cookie
, int clock
,
86 display_mode fCurrentMode
;
93 virtual addr_t
_DDCRegister() = 0;
94 virtual addr_t
_PortRegister() = 0;
96 port_index fPortIndex
;
101 class AnalogPort
: public Port
{
105 virtual uint32
Type() const
106 { return INTEL_PORT_TYPE_ANALOG
; }
108 virtual bool IsConnected();
110 virtual status_t
SetDisplayMode(display_mode
* mode
,
114 virtual addr_t
_DDCRegister();
115 virtual addr_t
_PortRegister();
119 class LVDSPort
: public Port
{
123 virtual uint32
Type() const
124 { return INTEL_PORT_TYPE_LVDS
; }
126 virtual bool IsConnected();
128 virtual status_t
SetDisplayMode(display_mode
* mode
,
131 virtual pipe_index
PipePreference();
134 virtual addr_t
_DDCRegister();
135 virtual addr_t
_PortRegister();
139 class DigitalPort
: public Port
{
142 port_index index
= INTEL_PORT_B
,
143 const char* baseName
= "DVI");
145 virtual uint32
Type() const
146 { return INTEL_PORT_TYPE_DVI
; }
148 virtual bool IsConnected();
150 virtual status_t
SetDisplayMode(display_mode
* mode
,
154 virtual addr_t
_DDCRegister();
155 virtual addr_t
_PortRegister();
159 class HDMIPort
: public DigitalPort
{
161 HDMIPort(port_index index
);
163 virtual uint32
Type() const
164 { return INTEL_PORT_TYPE_HDMI
; }
166 virtual bool IsConnected();
169 virtual addr_t
_PortRegister();
173 class DisplayPort
: public Port
{
175 DisplayPort(port_index index
,
176 const char* baseName
= "DisplayPort");
178 virtual uint32
Type() const
179 { return INTEL_PORT_TYPE_DP
; }
181 virtual bool IsConnected();
183 virtual status_t
SetDisplayMode(display_mode
* mode
,
187 virtual addr_t
_DDCRegister();
188 virtual addr_t
_PortRegister();
192 class EmbeddedDisplayPort
: public DisplayPort
{
194 EmbeddedDisplayPort();
196 virtual uint32
Type() const
197 { return INTEL_PORT_TYPE_eDP
; }
199 virtual bool IsConnected();
203 class DigitalDisplayInterface
: public Port
{
205 DigitalDisplayInterface(
206 port_index index
= INTEL_PORT_A
,
207 const char* baseName
= "Digital Display Interface");
209 virtual uint32
Type() const
210 { return INTEL_PORT_TYPE_DVI
; }
212 virtual status_t
Power(bool enabled
);
214 virtual bool IsConnected();
216 virtual status_t
SetDisplayMode(display_mode
* mode
,
220 virtual addr_t
_DDCRegister();
221 virtual addr_t
_PortRegister();
227 #endif // INTEL_PORTS_H