aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_audio.c')
-rw-r--r--drivers/gpu/drm/i915/intel_audio.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 769f3f586661..ae55a6865d5c 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -144,26 +144,43 @@ static const struct {
144/* HDMI N/CTS table */ 144/* HDMI N/CTS table */
145#define TMDS_297M 297000 145#define TMDS_297M 297000
146#define TMDS_296M 296703 146#define TMDS_296M 296703
147#define TMDS_594M 594000
148#define TMDS_593M 593407
149
147static const struct { 150static const struct {
148 int sample_rate; 151 int sample_rate;
149 int clock; 152 int clock;
150 int n; 153 int n;
151 int cts; 154 int cts;
152} hdmi_aud_ncts[] = { 155} hdmi_aud_ncts[] = {
153 { 44100, TMDS_296M, 4459, 234375 },
154 { 44100, TMDS_297M, 4704, 247500 },
155 { 48000, TMDS_296M, 5824, 281250 },
156 { 48000, TMDS_297M, 5120, 247500 },
157 { 32000, TMDS_296M, 5824, 421875 }, 156 { 32000, TMDS_296M, 5824, 421875 },
158 { 32000, TMDS_297M, 3072, 222750 }, 157 { 32000, TMDS_297M, 3072, 222750 },
158 { 32000, TMDS_593M, 5824, 843750 },
159 { 32000, TMDS_594M, 3072, 445500 },
160 { 44100, TMDS_296M, 4459, 234375 },
161 { 44100, TMDS_297M, 4704, 247500 },
162 { 44100, TMDS_593M, 8918, 937500 },
163 { 44100, TMDS_594M, 9408, 990000 },
159 { 88200, TMDS_296M, 8918, 234375 }, 164 { 88200, TMDS_296M, 8918, 234375 },
160 { 88200, TMDS_297M, 9408, 247500 }, 165 { 88200, TMDS_297M, 9408, 247500 },
161 { 96000, TMDS_296M, 11648, 281250 }, 166 { 88200, TMDS_593M, 17836, 937500 },
162 { 96000, TMDS_297M, 10240, 247500 }, 167 { 88200, TMDS_594M, 18816, 990000 },
163 { 176400, TMDS_296M, 17836, 234375 }, 168 { 176400, TMDS_296M, 17836, 234375 },
164 { 176400, TMDS_297M, 18816, 247500 }, 169 { 176400, TMDS_297M, 18816, 247500 },
170 { 176400, TMDS_593M, 35672, 937500 },
171 { 176400, TMDS_594M, 37632, 990000 },
172 { 48000, TMDS_296M, 5824, 281250 },
173 { 48000, TMDS_297M, 5120, 247500 },
174 { 48000, TMDS_593M, 5824, 562500 },
175 { 48000, TMDS_594M, 6144, 594000 },
176 { 96000, TMDS_296M, 11648, 281250 },
177 { 96000, TMDS_297M, 10240, 247500 },
178 { 96000, TMDS_593M, 11648, 562500 },
179 { 96000, TMDS_594M, 12288, 594000 },
165 { 192000, TMDS_296M, 23296, 281250 }, 180 { 192000, TMDS_296M, 23296, 281250 },
166 { 192000, TMDS_297M, 20480, 247500 }, 181 { 192000, TMDS_297M, 20480, 247500 },
182 { 192000, TMDS_593M, 23296, 562500 },
183 { 192000, TMDS_594M, 24576, 594000 },
167}; 184};
168 185
169/* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */ 186/* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */
@@ -912,6 +929,9 @@ static int i915_audio_component_bind(struct device *i915_kdev,
912 if (WARN_ON(acomp->base.ops || acomp->base.dev)) 929 if (WARN_ON(acomp->base.ops || acomp->base.dev))
913 return -EEXIST; 930 return -EEXIST;
914 931
932 if (WARN_ON(!device_link_add(hda_kdev, i915_kdev, DL_FLAG_STATELESS)))
933 return -ENOMEM;
934
915 drm_modeset_lock_all(&dev_priv->drm); 935 drm_modeset_lock_all(&dev_priv->drm);
916 acomp->base.ops = &i915_audio_component_ops; 936 acomp->base.ops = &i915_audio_component_ops;
917 acomp->base.dev = i915_kdev; 937 acomp->base.dev = i915_kdev;
@@ -935,6 +955,8 @@ static void i915_audio_component_unbind(struct device *i915_kdev,
935 acomp->base.dev = NULL; 955 acomp->base.dev = NULL;
936 dev_priv->audio_component = NULL; 956 dev_priv->audio_component = NULL;
937 drm_modeset_unlock_all(&dev_priv->drm); 957 drm_modeset_unlock_all(&dev_priv->drm);
958
959 device_link_remove(hda_kdev, i915_kdev);
938} 960}
939 961
940static const struct component_ops i915_audio_component_bind_ops = { 962static const struct component_ops i915_audio_component_bind_ops = {