aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_modes.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_modes.c')
-rw-r--r--drivers/gpu/drm/i915/intel_modes.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c
index be2c6fe07d12..d1928e79d9b6 100644
--- a/drivers/gpu/drm/i915/intel_modes.c
+++ b/drivers/gpu/drm/i915/intel_modes.c
@@ -28,6 +28,7 @@
28#include <linux/fb.h> 28#include <linux/fb.h>
29#include <drm/drm_edid.h> 29#include <drm/drm_edid.h>
30#include "drmP.h" 30#include "drmP.h"
31#include "drm_edid.h"
31#include "intel_drv.h" 32#include "intel_drv.h"
32#include "i915_drv.h" 33#include "i915_drv.h"
33 34
@@ -42,13 +43,13 @@ bool intel_ddc_probe(struct intel_encoder *intel_encoder, int ddc_bus)
42 u8 buf[2]; 43 u8 buf[2];
43 struct i2c_msg msgs[] = { 44 struct i2c_msg msgs[] = {
44 { 45 {
45 .addr = 0x50, 46 .addr = DDC_ADDR,
46 .flags = 0, 47 .flags = 0,
47 .len = 1, 48 .len = 1,
48 .buf = out_buf, 49 .buf = out_buf,
49 }, 50 },
50 { 51 {
51 .addr = 0x50, 52 .addr = DDC_ADDR,
52 .flags = I2C_M_RD, 53 .flags = I2C_M_RD,
53 .len = 1, 54 .len = 1,
54 .buf = buf, 55 .buf = buf,
@@ -83,10 +84,11 @@ int intel_ddc_get_modes(struct drm_connector *connector,
83 return ret; 84 return ret;
84} 85}
85 86
86static const char *force_audio_names[] = { 87static const struct drm_prop_enum_list force_audio_names[] = {
87 "off", 88 { HDMI_AUDIO_OFF_DVI, "force-dvi" },
88 "auto", 89 { HDMI_AUDIO_OFF, "off" },
89 "on", 90 { HDMI_AUDIO_AUTO, "auto" },
91 { HDMI_AUDIO_ON, "on" },
90}; 92};
91 93
92void 94void
@@ -95,27 +97,24 @@ intel_attach_force_audio_property(struct drm_connector *connector)
95 struct drm_device *dev = connector->dev; 97 struct drm_device *dev = connector->dev;
96 struct drm_i915_private *dev_priv = dev->dev_private; 98 struct drm_i915_private *dev_priv = dev->dev_private;
97 struct drm_property *prop; 99 struct drm_property *prop;
98 int i;
99 100
100 prop = dev_priv->force_audio_property; 101 prop = dev_priv->force_audio_property;
101 if (prop == NULL) { 102 if (prop == NULL) {
102 prop = drm_property_create(dev, DRM_MODE_PROP_ENUM, 103 prop = drm_property_create_enum(dev, 0,
103 "audio", 104 "audio",
105 force_audio_names,
104 ARRAY_SIZE(force_audio_names)); 106 ARRAY_SIZE(force_audio_names));
105 if (prop == NULL) 107 if (prop == NULL)
106 return; 108 return;
107 109
108 for (i = 0; i < ARRAY_SIZE(force_audio_names); i++)
109 drm_property_add_enum(prop, i, i-1, force_audio_names[i]);
110
111 dev_priv->force_audio_property = prop; 110 dev_priv->force_audio_property = prop;
112 } 111 }
113 drm_connector_attach_property(connector, prop, 0); 112 drm_connector_attach_property(connector, prop, 0);
114} 113}
115 114
116static const char *broadcast_rgb_names[] = { 115static const struct drm_prop_enum_list broadcast_rgb_names[] = {
117 "Full", 116 { 0, "Full" },
118 "Limited 16:235", 117 { 1, "Limited 16:235" },
119}; 118};
120 119
121void 120void
@@ -124,19 +123,16 @@ intel_attach_broadcast_rgb_property(struct drm_connector *connector)
124 struct drm_device *dev = connector->dev; 123 struct drm_device *dev = connector->dev;
125 struct drm_i915_private *dev_priv = dev->dev_private; 124 struct drm_i915_private *dev_priv = dev->dev_private;
126 struct drm_property *prop; 125 struct drm_property *prop;
127 int i;
128 126
129 prop = dev_priv->broadcast_rgb_property; 127 prop = dev_priv->broadcast_rgb_property;
130 if (prop == NULL) { 128 if (prop == NULL) {
131 prop = drm_property_create(dev, DRM_MODE_PROP_ENUM, 129 prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM,
132 "Broadcast RGB", 130 "Broadcast RGB",
131 broadcast_rgb_names,
133 ARRAY_SIZE(broadcast_rgb_names)); 132 ARRAY_SIZE(broadcast_rgb_names));
134 if (prop == NULL) 133 if (prop == NULL)
135 return; 134 return;
136 135
137 for (i = 0; i < ARRAY_SIZE(broadcast_rgb_names); i++)
138 drm_property_add_enum(prop, i, i, broadcast_rgb_names[i]);
139
140 dev_priv->broadcast_rgb_property = prop; 136 dev_priv->broadcast_rgb_property = prop;
141 } 137 }
142 138