diff options
Diffstat (limited to 'drivers/gpu/drm/gma500/cdv_device.c')
-rw-r--r-- | drivers/gpu/drm/gma500/cdv_device.c | 72 |
1 files changed, 70 insertions, 2 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c index 7db0e3bf5a5b..1ceca3d13b65 100644 --- a/drivers/gpu/drm/gma500/cdv_device.c +++ b/drivers/gpu/drm/gma500/cdv_device.c | |||
@@ -58,10 +58,17 @@ static int cdv_output_init(struct drm_device *dev) | |||
58 | cdv_intel_lvds_init(dev, &dev_priv->mode_dev); | 58 | cdv_intel_lvds_init(dev, &dev_priv->mode_dev); |
59 | 59 | ||
60 | /* These bits indicate HDMI not SDVO on CDV */ | 60 | /* These bits indicate HDMI not SDVO on CDV */ |
61 | if (REG_READ(SDVOB) & SDVO_DETECTED) | 61 | if (REG_READ(SDVOB) & SDVO_DETECTED) { |
62 | cdv_hdmi_init(dev, &dev_priv->mode_dev, SDVOB); | 62 | cdv_hdmi_init(dev, &dev_priv->mode_dev, SDVOB); |
63 | if (REG_READ(SDVOC) & SDVO_DETECTED) | 63 | if (REG_READ(DP_B) & DP_DETECTED) |
64 | cdv_intel_dp_init(dev, &dev_priv->mode_dev, DP_B); | ||
65 | } | ||
66 | |||
67 | if (REG_READ(SDVOC) & SDVO_DETECTED) { | ||
64 | cdv_hdmi_init(dev, &dev_priv->mode_dev, SDVOC); | 68 | cdv_hdmi_init(dev, &dev_priv->mode_dev, SDVOC); |
69 | if (REG_READ(DP_C) & DP_DETECTED) | ||
70 | cdv_intel_dp_init(dev, &dev_priv->mode_dev, DP_C); | ||
71 | } | ||
65 | return 0; | 72 | return 0; |
66 | } | 73 | } |
67 | 74 | ||
@@ -163,6 +170,7 @@ static int cdv_backlight_init(struct drm_device *dev) | |||
163 | cdv_get_brightness(cdv_backlight_device); | 170 | cdv_get_brightness(cdv_backlight_device); |
164 | backlight_update_status(cdv_backlight_device); | 171 | backlight_update_status(cdv_backlight_device); |
165 | dev_priv->backlight_device = cdv_backlight_device; | 172 | dev_priv->backlight_device = cdv_backlight_device; |
173 | dev_priv->backlight_enabled = true; | ||
166 | return 0; | 174 | return 0; |
167 | } | 175 | } |
168 | 176 | ||
@@ -449,6 +457,7 @@ static void cdv_get_core_freq(struct drm_device *dev) | |||
449 | case 6: | 457 | case 6: |
450 | case 7: | 458 | case 7: |
451 | dev_priv->core_freq = 266; | 459 | dev_priv->core_freq = 266; |
460 | break; | ||
452 | default: | 461 | default: |
453 | dev_priv->core_freq = 0; | 462 | dev_priv->core_freq = 0; |
454 | } | 463 | } |
@@ -488,6 +497,65 @@ static void cdv_hotplug_enable(struct drm_device *dev, bool on) | |||
488 | } | 497 | } |
489 | } | 498 | } |
490 | 499 | ||
500 | static const char *force_audio_names[] = { | ||
501 | "off", | ||
502 | "auto", | ||
503 | "on", | ||
504 | }; | ||
505 | |||
506 | void cdv_intel_attach_force_audio_property(struct drm_connector *connector) | ||
507 | { | ||
508 | struct drm_device *dev = connector->dev; | ||
509 | struct drm_psb_private *dev_priv = dev->dev_private; | ||
510 | struct drm_property *prop; | ||
511 | int i; | ||
512 | |||
513 | prop = dev_priv->force_audio_property; | ||
514 | if (prop == NULL) { | ||
515 | prop = drm_property_create(dev, DRM_MODE_PROP_ENUM, | ||
516 | "audio", | ||
517 | ARRAY_SIZE(force_audio_names)); | ||
518 | if (prop == NULL) | ||
519 | return; | ||
520 | |||
521 | for (i = 0; i < ARRAY_SIZE(force_audio_names); i++) | ||
522 | drm_property_add_enum(prop, i, i-1, force_audio_names[i]); | ||
523 | |||
524 | dev_priv->force_audio_property = prop; | ||
525 | } | ||
526 | drm_connector_attach_property(connector, prop, 0); | ||
527 | } | ||
528 | |||
529 | |||
530 | static const char *broadcast_rgb_names[] = { | ||
531 | "Full", | ||
532 | "Limited 16:235", | ||
533 | }; | ||
534 | |||
535 | void cdv_intel_attach_broadcast_rgb_property(struct drm_connector *connector) | ||
536 | { | ||
537 | struct drm_device *dev = connector->dev; | ||
538 | struct drm_psb_private *dev_priv = dev->dev_private; | ||
539 | struct drm_property *prop; | ||
540 | int i; | ||
541 | |||
542 | prop = dev_priv->broadcast_rgb_property; | ||
543 | if (prop == NULL) { | ||
544 | prop = drm_property_create(dev, DRM_MODE_PROP_ENUM, | ||
545 | "Broadcast RGB", | ||
546 | ARRAY_SIZE(broadcast_rgb_names)); | ||
547 | if (prop == NULL) | ||
548 | return; | ||
549 | |||
550 | for (i = 0; i < ARRAY_SIZE(broadcast_rgb_names); i++) | ||
551 | drm_property_add_enum(prop, i, i, broadcast_rgb_names[i]); | ||
552 | |||
553 | dev_priv->broadcast_rgb_property = prop; | ||
554 | } | ||
555 | |||
556 | drm_connector_attach_property(connector, prop, 0); | ||
557 | } | ||
558 | |||
491 | /* Cedarview */ | 559 | /* Cedarview */ |
492 | static const struct psb_offset cdv_regmap[2] = { | 560 | static const struct psb_offset cdv_regmap[2] = { |
493 | { | 561 | { |