@@ -980,7 +980,8 @@ static void glk_force_audio_cdclk(struct drm_i915_private *i915,
980980
981981static unsigned long i915_audio_component_get_power (struct device * kdev )
982982{
983- struct drm_i915_private * i915 = kdev_to_i915 (kdev );
983+ struct intel_display * display = to_intel_display (kdev );
984+ struct drm_i915_private * i915 = to_i915 (display -> drm );
984985 intel_wakeref_t ret ;
985986
986987 /* Catch potential impedance mismatches before they occur! */
@@ -1012,7 +1013,8 @@ static unsigned long i915_audio_component_get_power(struct device *kdev)
10121013static void i915_audio_component_put_power (struct device * kdev ,
10131014 unsigned long cookie )
10141015{
1015- struct drm_i915_private * i915 = kdev_to_i915 (kdev );
1016+ struct intel_display * display = to_intel_display (kdev );
1017+ struct drm_i915_private * i915 = to_i915 (display -> drm );
10161018
10171019 /* Stop forcing CDCLK to 2*BCLK if no need for audio to be powered. */
10181020 if (-- i915 -> display .audio .power_refcount == 0 )
@@ -1025,7 +1027,8 @@ static void i915_audio_component_put_power(struct device *kdev,
10251027static void i915_audio_component_codec_wake_override (struct device * kdev ,
10261028 bool enable )
10271029{
1028- struct drm_i915_private * i915 = kdev_to_i915 (kdev );
1030+ struct intel_display * display = to_intel_display (kdev );
1031+ struct drm_i915_private * i915 = to_i915 (display -> drm );
10291032 unsigned long cookie ;
10301033
10311034 if (DISPLAY_VER (i915 ) < 9 )
@@ -1053,7 +1056,8 @@ static void i915_audio_component_codec_wake_override(struct device *kdev,
10531056/* Get CDCLK in kHz */
10541057static int i915_audio_component_get_cdclk_freq (struct device * kdev )
10551058{
1056- struct drm_i915_private * i915 = kdev_to_i915 (kdev );
1059+ struct intel_display * display = to_intel_display (kdev );
1060+ struct drm_i915_private * i915 = to_i915 (display -> drm );
10571061
10581062 if (drm_WARN_ON_ONCE (& i915 -> drm , !HAS_DDI (i915 )))
10591063 return - ENODEV ;
@@ -1112,7 +1116,8 @@ static struct intel_audio_state *find_audio_state(struct drm_i915_private *i915,
11121116static int i915_audio_component_sync_audio_rate (struct device * kdev , int port ,
11131117 int cpu_transcoder , int rate )
11141118{
1115- struct drm_i915_private * i915 = kdev_to_i915 (kdev );
1119+ struct intel_display * display = to_intel_display (kdev );
1120+ struct drm_i915_private * i915 = to_i915 (display -> drm );
11161121 struct i915_audio_component * acomp = i915 -> display .audio .component ;
11171122 const struct intel_audio_state * audio_state ;
11181123 struct intel_encoder * encoder ;
@@ -1154,7 +1159,8 @@ static int i915_audio_component_get_eld(struct device *kdev, int port,
11541159 int cpu_transcoder , bool * enabled ,
11551160 unsigned char * buf , int max_bytes )
11561161{
1157- struct drm_i915_private * i915 = kdev_to_i915 (kdev );
1162+ struct intel_display * display = to_intel_display (kdev );
1163+ struct drm_i915_private * i915 = to_i915 (display -> drm );
11581164 const struct intel_audio_state * audio_state ;
11591165 int ret = 0 ;
11601166
@@ -1189,24 +1195,25 @@ static const struct drm_audio_component_ops i915_audio_component_ops = {
11891195 .get_eld = i915_audio_component_get_eld ,
11901196};
11911197
1192- static int i915_audio_component_bind (struct device * i915_kdev ,
1198+ static int i915_audio_component_bind (struct device * drv_kdev ,
11931199 struct device * hda_kdev , void * data )
11941200{
1201+ struct intel_display * display = to_intel_display (drv_kdev );
1202+ struct drm_i915_private * i915 = to_i915 (display -> drm );
11951203 struct i915_audio_component * acomp = data ;
1196- struct drm_i915_private * i915 = kdev_to_i915 (i915_kdev );
11971204 int i ;
11981205
11991206 if (drm_WARN_ON (& i915 -> drm , acomp -> base .ops || acomp -> base .dev ))
12001207 return - EEXIST ;
12011208
12021209 if (drm_WARN_ON (& i915 -> drm ,
1203- !device_link_add (hda_kdev , i915_kdev ,
1210+ !device_link_add (hda_kdev , drv_kdev ,
12041211 DL_FLAG_STATELESS )))
12051212 return - ENOMEM ;
12061213
12071214 drm_modeset_lock_all (& i915 -> drm );
12081215 acomp -> base .ops = & i915_audio_component_ops ;
1209- acomp -> base .dev = i915_kdev ;
1216+ acomp -> base .dev = drv_kdev ;
12101217 BUILD_BUG_ON (MAX_PORTS != I915_MAX_PORTS );
12111218 for (i = 0 ; i < ARRAY_SIZE (acomp -> aud_sample_rate ); i ++ )
12121219 acomp -> aud_sample_rate [i ] = 0 ;
@@ -1216,19 +1223,20 @@ static int i915_audio_component_bind(struct device *i915_kdev,
12161223 return 0 ;
12171224}
12181225
1219- static void i915_audio_component_unbind (struct device * i915_kdev ,
1226+ static void i915_audio_component_unbind (struct device * drv_kdev ,
12201227 struct device * hda_kdev , void * data )
12211228{
1229+ struct intel_display * display = to_intel_display (drv_kdev );
1230+ struct drm_i915_private * i915 = to_i915 (display -> drm );
12221231 struct i915_audio_component * acomp = data ;
1223- struct drm_i915_private * i915 = kdev_to_i915 (i915_kdev );
12241232
12251233 drm_modeset_lock_all (& i915 -> drm );
12261234 acomp -> base .ops = NULL ;
12271235 acomp -> base .dev = NULL ;
12281236 i915 -> display .audio .component = NULL ;
12291237 drm_modeset_unlock_all (& i915 -> drm );
12301238
1231- device_link_remove (hda_kdev , i915_kdev );
1239+ device_link_remove (hda_kdev , drv_kdev );
12321240
12331241 if (i915 -> display .audio .power_refcount )
12341242 drm_err (& i915 -> drm , "audio power refcount %d after unbind\n" ,
0 commit comments