27 #include <linux/i2c.h>
74 if (mode->
clock < 20000)
78 if (mode->
clock > 355000)
84 static bool cdv_intel_crt_mode_fixup(
struct drm_encoder *encoder,
91 static void cdv_intel_crt_mode_set(
struct drm_encoder *encoder,
104 if (psb_intel_crtc->
pipe == 0)
127 if (psb_intel_crtc->
pipe == 0)
142 static bool cdv_intel_crt_detect_hotplug(
struct drm_connector *connector,
147 int i, tries = 0,
ret =
false;
163 for (i = 0; i < tries ; i++) {
192 if (cdv_intel_crt_detect_hotplug(connector, force))
198 static void cdv_intel_crt_destroy(
struct drm_connector *connector)
201 psb_intel_attached_encoder(connector);
209 static int cdv_intel_crt_get_modes(
struct drm_connector *connector)
212 psb_intel_attached_encoder(connector);
216 static int cdv_intel_crt_set_property(
struct drm_connector *connector,
228 .dpms = cdv_intel_crt_dpms,
229 .mode_fixup = cdv_intel_crt_mode_fixup,
232 .mode_set = cdv_intel_crt_mode_set,
237 .detect = cdv_intel_crt_detect,
239 .destroy = cdv_intel_crt_destroy,
240 .set_property = cdv_intel_crt_set_property,
244 cdv_intel_crt_connector_helper_funcs = {
245 .mode_valid = cdv_intel_crt_mode_valid,
246 .get_modes = cdv_intel_crt_get_modes,
250 static void cdv_intel_crt_enc_destroy(
struct drm_encoder *encoder)
256 .destroy = cdv_intel_crt_enc_destroy,
270 psb_intel_encoder = kzalloc(
sizeof(
struct psb_intel_encoder),
GFP_KERNEL);
271 if (!psb_intel_encoder)
274 psb_intel_connector = kzalloc(
sizeof(
struct psb_intel_connector),
GFP_KERNEL);
275 if (!psb_intel_connector)
276 goto failed_connector;
278 connector = &psb_intel_connector->
base;
282 encoder = &psb_intel_encoder->
base;
297 i2c_reg,
"CRTDDC_A");
298 if (!psb_intel_encoder->
ddc_bus) {
299 dev_printk(
KERN_ERR, &dev->pdev->dev,
"DDC bus registration "
312 drm_encoder_helper_add(encoder, &cdv_intel_crt_helper_funcs);
313 drm_connector_helper_add(connector,
314 &cdv_intel_crt_connector_helper_funcs);
322 kfree(psb_intel_connector);
324 kfree(psb_intel_encoder);