aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500/cdv_device.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-08-08 09:54:41 -0400
committerDave Airlie <airlied@redhat.com>2012-08-23 19:29:12 -0400
commit220801bdb53ceeac01d021ac459d112acc7deb0b (patch)
tree87c64cbd330b26754922caca5c94c67082e8de0d /drivers/gpu/drm/gma500/cdv_device.c
parent8695b612943561478fd22f28f45e5692e5d078db (diff)
gma500/cdv: add the bits that don't need the new code
Based on bits from Yakui <yakui.zhao@intel.com> We can import various little bits of code before we plumb it all in and hopefully this way catch any regressions more easily. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/gma500/cdv_device.c')
-rw-r--r--drivers/gpu/drm/gma500/cdv_device.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c
index b7e7b49d8f62..e2fff244a599 100644
--- a/drivers/gpu/drm/gma500/cdv_device.c
+++ b/drivers/gpu/drm/gma500/cdv_device.c
@@ -488,6 +488,65 @@ static void cdv_hotplug_enable(struct drm_device *dev, bool on)
488 } 488 }
489} 489}
490 490
491static const char *force_audio_names[] = {
492 "off",
493 "auto",
494 "on",
495};
496
497void cdv_intel_attach_force_audio_property(struct drm_connector *connector)
498{
499 struct drm_device *dev = connector->dev;
500 struct drm_psb_private *dev_priv = dev->dev_private;
501 struct drm_property *prop;
502 int i;
503
504 prop = dev_priv->force_audio_property;
505 if (prop == NULL) {
506 prop = drm_property_create(dev, DRM_MODE_PROP_ENUM,
507 "audio",
508 ARRAY_SIZE(force_audio_names));
509 if (prop == NULL)
510 return;
511
512 for (i = 0; i < ARRAY_SIZE(force_audio_names); i++)
513 drm_property_add_enum(prop, i, i-1, force_audio_names[i]);
514
515 dev_priv->force_audio_property = prop;
516 }
517 drm_connector_attach_property(connector, prop, 0);
518}
519
520
521static const char *broadcast_rgb_names[] = {
522 "Full",
523 "Limited 16:235",
524};
525
526void cdv_intel_attach_broadcast_rgb_property(struct drm_connector *connector)
527{
528 struct drm_device *dev = connector->dev;
529 struct drm_psb_private *dev_priv = dev->dev_private;
530 struct drm_property *prop;
531 int i;
532
533 prop = dev_priv->broadcast_rgb_property;
534 if (prop == NULL) {
535 prop = drm_property_create(dev, DRM_MODE_PROP_ENUM,
536 "Broadcast RGB",
537 ARRAY_SIZE(broadcast_rgb_names));
538 if (prop == NULL)
539 return;
540
541 for (i = 0; i < ARRAY_SIZE(broadcast_rgb_names); i++)
542 drm_property_add_enum(prop, i, i, broadcast_rgb_names[i]);
543
544 dev_priv->broadcast_rgb_property = prop;
545 }
546
547 drm_connector_attach_property(connector, prop, 0);
548}
549
491/* Cedarview */ 550/* Cedarview */
492static const struct psb_offset cdv_regmap[2] = { 551static const struct psb_offset cdv_regmap[2] = {
493 { 552 {