41 #define HDMI_NULL_PACKETS_DURING_VSYNC (1 << 9)
42 #define HDMI_BORDER_ENABLE (1 << 7)
43 #define HDMI_AUDIO_ENABLE (1 << 6)
44 #define HDMI_VSYNC_ACTIVE_HIGH (1 << 4)
45 #define HDMI_HSYNC_ACTIVE_HIGH (1 << 3)
47 #define HDMIB_PIPE_B_SELECT (1 << 30)
62 static void cdv_hdmi_mode_set(
struct drm_encoder *encoder,
80 if (intel_crtc->
pipe == 1)
92 static bool cdv_hdmi_mode_fixup(
struct drm_encoder *encoder,
119 struct psb_intel_encoder *psb_intel_encoder =
120 psb_intel_attached_encoder(connector);
129 struct psb_intel_encoder *psb_intel_encoder =
130 psb_intel_attached_encoder(connector);
140 struct psb_intel_encoder *psb_intel_encoder =
141 psb_intel_attached_encoder(connector);
163 static int cdv_hdmi_set_property(
struct drm_connector *connector,
169 if (!
strcmp(property->
name,
"scaling mode") && encoder) {
189 property, &curValue))
192 if (curValue == value)
222 static int cdv_hdmi_get_modes(
struct drm_connector *connector)
224 struct psb_intel_encoder *psb_intel_encoder =
225 psb_intel_attached_encoder(connector);
226 struct edid *edid =
NULL;
238 static int cdv_hdmi_mode_valid(
struct drm_connector *connector,
241 if (mode->
clock > 165000)
243 if (mode->
clock < 20000)
257 static void cdv_hdmi_destroy(
struct drm_connector *connector)
259 struct psb_intel_encoder *psb_intel_encoder =
260 psb_intel_attached_encoder(connector);
262 if (psb_intel_encoder->
i2c_bus)
270 .dpms = cdv_hdmi_dpms,
271 .mode_fixup = cdv_hdmi_mode_fixup,
273 .mode_set = cdv_hdmi_mode_set,
278 cdv_hdmi_connector_helper_funcs = {
279 .get_modes = cdv_hdmi_get_modes,
280 .mode_valid = cdv_hdmi_mode_valid,
286 .save = cdv_hdmi_save,
287 .restore = cdv_hdmi_restore,
288 .detect = cdv_hdmi_detect,
290 .set_property = cdv_hdmi_set_property,
291 .destroy = cdv_hdmi_destroy,
297 struct psb_intel_encoder *psb_intel_encoder;
304 psb_intel_encoder = kzalloc(
sizeof(
struct psb_intel_encoder),
307 if (!psb_intel_encoder)
310 psb_intel_connector = kzalloc(
sizeof(
struct psb_intel_connector),
313 if (!psb_intel_connector)
321 connector = &psb_intel_connector->
base;
322 encoder = &psb_intel_encoder->
base;
324 &cdv_hdmi_connector_funcs,
335 psb_intel_encoder->
dev_priv = hdmi_priv;
337 drm_encoder_helper_add(encoder, &cdv_hdmi_helper_funcs);
338 drm_connector_helper_add(connector,
339 &cdv_hdmi_connector_helper_funcs);
345 dev->mode_config.scaling_mode_property,
358 DRM_ERROR(
"unknown reg 0x%x for HDMI\n", reg);
364 ddc_bus, (reg ==
SDVOB) ?
"HDMIB" :
"HDMIC");
366 if (!psb_intel_encoder->
i2c_bus) {
367 dev_err(dev->dev,
"No ddc adapter available!\n");
372 &(psb_intel_encoder->
i2c_bus->adapter);
381 kfree(psb_intel_connector);
383 kfree(psb_intel_encoder);