@@ -2087,7 +2087,7 @@ void snd_hda_hdmi_generic_spec_free(struct hda_codec *codec)
2087
2087
}
2088
2088
EXPORT_SYMBOL_NS_GPL (snd_hda_hdmi_generic_spec_free , "SND_HDA_CODEC_HDMI" );
2089
2089
2090
- void snd_hda_hdmi_generic_free (struct hda_codec * codec )
2090
+ void snd_hda_hdmi_generic_remove (struct hda_codec * codec )
2091
2091
{
2092
2092
struct hdmi_spec * spec = codec -> spec ;
2093
2093
int pin_idx , pcm_idx ;
@@ -2113,7 +2113,7 @@ void snd_hda_hdmi_generic_free(struct hda_codec *codec)
2113
2113
2114
2114
snd_hda_hdmi_generic_spec_free (codec );
2115
2115
}
2116
- EXPORT_SYMBOL_NS_GPL (snd_hda_hdmi_generic_free , "SND_HDA_CODEC_HDMI" );
2116
+ EXPORT_SYMBOL_NS_GPL (snd_hda_hdmi_generic_remove , "SND_HDA_CODEC_HDMI" );
2117
2117
2118
2118
int snd_hda_hdmi_generic_suspend (struct hda_codec * codec )
2119
2119
{
@@ -2133,7 +2133,7 @@ int snd_hda_hdmi_generic_resume(struct hda_codec *codec)
2133
2133
struct hdmi_spec * spec = codec -> spec ;
2134
2134
int pin_idx ;
2135
2135
2136
- codec -> patch_ops . init (codec );
2136
+ snd_hda_codec_init (codec );
2137
2137
snd_hda_regmap_sync (codec );
2138
2138
2139
2139
for (pin_idx = 0 ; pin_idx < spec -> num_pins ; pin_idx ++ ) {
@@ -2144,16 +2144,6 @@ int snd_hda_hdmi_generic_resume(struct hda_codec *codec)
2144
2144
}
2145
2145
EXPORT_SYMBOL_NS_GPL (snd_hda_hdmi_generic_resume , "SND_HDA_CODEC_HDMI" );
2146
2146
2147
- static const struct hda_codec_ops generic_hdmi_patch_ops = {
2148
- .init = snd_hda_hdmi_generic_init ,
2149
- .free = snd_hda_hdmi_generic_free ,
2150
- .build_pcms = snd_hda_hdmi_generic_build_pcms ,
2151
- .build_controls = snd_hda_hdmi_generic_build_controls ,
2152
- .unsol_event = snd_hda_hdmi_generic_unsol_event ,
2153
- .suspend = snd_hda_hdmi_generic_suspend ,
2154
- .resume = snd_hda_hdmi_generic_resume ,
2155
- };
2156
-
2157
2147
static const struct hdmi_ops generic_standard_hdmi_ops = {
2158
2148
.pin_get_eld = hdmi_pin_get_eld ,
2159
2149
.pin_setup_infoframe = hdmi_pin_setup_infoframe ,
@@ -2185,14 +2175,12 @@ int snd_hda_hdmi_generic_alloc(struct hda_codec *codec)
2185
2175
codec -> spec = spec ;
2186
2176
hdmi_array_init (spec , 4 );
2187
2177
2188
- codec -> patch_ops = generic_hdmi_patch_ops ;
2189
-
2190
2178
return 0 ;
2191
2179
}
2192
2180
EXPORT_SYMBOL_NS_GPL (snd_hda_hdmi_generic_alloc , "SND_HDA_CODEC_HDMI" );
2193
2181
2194
2182
/* generic HDMI parser */
2195
- int patch_generic_hdmi (struct hda_codec * codec )
2183
+ int snd_hda_hdmi_generic_probe (struct hda_codec * codec )
2196
2184
{
2197
2185
int err ;
2198
2186
@@ -2209,7 +2197,7 @@ int patch_generic_hdmi(struct hda_codec *codec)
2209
2197
snd_hda_hdmi_generic_init_per_pins (codec );
2210
2198
return 0 ;
2211
2199
}
2212
- EXPORT_SYMBOL_NS_GPL (patch_generic_hdmi , "SND_HDA_CODEC_HDMI" );
2200
+ EXPORT_SYMBOL_NS_GPL (snd_hda_hdmi_generic_probe , "SND_HDA_CODEC_HDMI" );
2213
2201
2214
2202
/*
2215
2203
* generic audio component binding
@@ -2346,65 +2334,83 @@ EXPORT_SYMBOL_NS_GPL(snd_hda_hdmi_acomp_init, "SND_HDA_CODEC_HDMI");
2346
2334
/*
2347
2335
*/
2348
2336
2349
- static int patch_gf_hdmi (struct hda_codec * codec )
2337
+ enum {
2338
+ MODEL_GENERIC ,
2339
+ MODEL_GF ,
2340
+ };
2341
+
2342
+ static int generichdmi_probe (struct hda_codec * codec ,
2343
+ const struct hda_device_id * id )
2350
2344
{
2351
2345
int err ;
2352
2346
2353
- err = patch_generic_hdmi (codec );
2354
- if (err )
2347
+ err = snd_hda_hdmi_generic_probe (codec );
2348
+ if (err < 0 )
2355
2349
return err ;
2356
-
2357
2350
/*
2358
2351
* Glenfly GPUs have two codecs, stream switches from one codec to
2359
2352
* another, need to do actual clean-ups in codec_cleanup_stream
2360
2353
*/
2361
- codec -> no_sticky_stream = 1 ;
2354
+ if (id -> driver_data == MODEL_GF )
2355
+ codec -> no_sticky_stream = 1 ;
2356
+
2362
2357
return 0 ;
2363
2358
}
2364
2359
2360
+ static const struct hda_codec_ops generichdmi_codec_ops = {
2361
+ .probe = generichdmi_probe ,
2362
+ .remove = snd_hda_hdmi_generic_remove ,
2363
+ .init = snd_hda_hdmi_generic_init ,
2364
+ .build_pcms = snd_hda_hdmi_generic_build_pcms ,
2365
+ .build_controls = snd_hda_hdmi_generic_build_controls ,
2366
+ .unsol_event = snd_hda_hdmi_generic_unsol_event ,
2367
+ .suspend = snd_hda_hdmi_generic_suspend ,
2368
+ .resume = snd_hda_hdmi_generic_resume ,
2369
+ };
2370
+
2365
2371
/*
2366
- * patch entries
2367
2372
*/
2368
- static const struct hda_device_id snd_hda_id_hdmi [] = {
2369
- HDA_CODEC_ENTRY (0x00147a47 , "Loongson HDMI" , patch_generic_hdmi ),
2370
- HDA_CODEC_ENTRY (0x10951390 , "SiI1390 HDMI" , patch_generic_hdmi ),
2371
- HDA_CODEC_ENTRY (0x10951392 , "SiI1392 HDMI" , patch_generic_hdmi ),
2372
- HDA_CODEC_ENTRY ( 0x17e80047 , "Chrontel HDMI" , patch_generic_hdmi ),
2373
- HDA_CODEC_ENTRY ( 0x67663d82 , "Arise 82 HDMI/DP" , patch_gf_hdmi ),
2374
- HDA_CODEC_ENTRY ( 0x67663d83 , "Arise 83 HDMI/DP " , patch_gf_hdmi ),
2375
- HDA_CODEC_ENTRY ( 0x67663d84 , "Arise 84 HDMI/DP" , patch_gf_hdmi ),
2376
- HDA_CODEC_ENTRY ( 0x67663d85 , "Arise 85 HDMI/DP" , patch_gf_hdmi ),
2377
- HDA_CODEC_ENTRY ( 0x67663d86 , "Arise 86 HDMI/DP" , patch_gf_hdmi ),
2378
- HDA_CODEC_ENTRY ( 0x67663d87 , "Arise 87 HDMI/DP" , patch_gf_hdmi ),
2379
- HDA_CODEC_ENTRY ( 0x11069f84 , "VX11 HDMI/DP" , patch_generic_hdmi ),
2380
- HDA_CODEC_ENTRY ( 0x11069f85 , "VX11 HDMI/DP" , patch_generic_hdmi ),
2381
- HDA_CODEC_ENTRY ( 0x1d179f86 , "ZX-100S HDMI/DP" , patch_gf_hdmi ),
2382
- HDA_CODEC_ENTRY ( 0x1d179f87 , "ZX-100S HDMI/DP" , patch_gf_hdmi ),
2383
- HDA_CODEC_ENTRY ( 0x1d179f88 , "KX-5000 HDMI/DP" , patch_gf_hdmi ),
2384
- HDA_CODEC_ENTRY ( 0x1d179f89 , "KX-5000 HDMI/DP" , patch_gf_hdmi ),
2385
- HDA_CODEC_ENTRY ( 0x1d179f8a , "KX-6000 HDMI/DP" , patch_gf_hdmi ),
2386
- HDA_CODEC_ENTRY ( 0x1d179f8b , "KX-6000 HDMI/DP" , patch_gf_hdmi ),
2387
- HDA_CODEC_ENTRY ( 0x1d179f8c , "KX-6000G HDMI/DP" , patch_gf_hdmi ),
2388
- HDA_CODEC_ENTRY ( 0x1d179f8d , "KX-6000G HDMI/DP" , patch_gf_hdmi ),
2389
- HDA_CODEC_ENTRY ( 0x1d179f8e , "KX-7000 HDMI/DP" , patch_gf_hdmi ),
2390
- HDA_CODEC_ENTRY ( 0x1d179f8f , "KX-7000 HDMI/DP" , patch_gf_hdmi ),
2391
- HDA_CODEC_ENTRY ( 0x1d179f90 , "KX-7000 HDMI/DP" , patch_gf_hdmi ),
2392
- HDA_CODEC_ENTRY (0x80862801 , "Bearlake HDMI" , patch_generic_hdmi ),
2393
- HDA_CODEC_ENTRY (0x80862802 , "Cantiga HDMI" , patch_generic_hdmi ),
2394
- HDA_CODEC_ENTRY (0x80862803 , "Eaglelake HDMI" , patch_generic_hdmi ),
2395
- HDA_CODEC_ENTRY (0x80862880 , "CedarTrail HDMI" , patch_generic_hdmi ),
2396
- HDA_CODEC_ENTRY (0x808629fb , "Crestline HDMI" , patch_generic_hdmi ),
2397
- /* special ID for generic HDMI */
2398
- HDA_CODEC_ENTRY (HDA_CODEC_ID_GENERIC_HDMI , "Generic HDMI" , patch_generic_hdmi ),
2399
- {} /* terminator */
2373
+ static const struct hda_device_id snd_hda_id_generichdmi [] = {
2374
+ HDA_CODEC_ID_MODEL (0x00147a47 , "Loongson HDMI" , MODEL_GENERIC ),
2375
+ HDA_CODEC_ID_MODEL (0x10951390 , "SiI1390 HDMI" , MODEL_GENERIC ),
2376
+ HDA_CODEC_ID_MODEL (0x10951392 , "SiI1392 HDMI" , MODEL_GENERIC ),
2377
+ HDA_CODEC_ID_MODEL ( 0x11069f84 , "VX11 HDMI/DP " , MODEL_GENERIC ),
2378
+ HDA_CODEC_ID_MODEL ( 0x11069f85 , "VX11 HDMI/DP" , MODEL_GENERIC ),
2379
+ HDA_CODEC_ID_MODEL ( 0x17e80047 , "Chrontel HDMI" , MODEL_GENERIC ),
2380
+ HDA_CODEC_ID_MODEL ( 0x1d179f86 , "ZX-100S HDMI/DP" , MODEL_GF ),
2381
+ HDA_CODEC_ID_MODEL ( 0x1d179f87 , "ZX-100S HDMI/DP" , MODEL_GF ),
2382
+ HDA_CODEC_ID_MODEL ( 0x1d179f88 , "KX-5000 HDMI/DP" , MODEL_GF ),
2383
+ HDA_CODEC_ID_MODEL ( 0x1d179f89 , "KX-5000 HDMI/DP" , MODEL_GF ),
2384
+ HDA_CODEC_ID_MODEL ( 0x1d179f8a , "KX-6000 HDMI/DP" , MODEL_GF ),
2385
+ HDA_CODEC_ID_MODEL ( 0x1d179f8b , "KX-6000 HDMI/DP" , MODEL_GF ),
2386
+ HDA_CODEC_ID_MODEL ( 0x1d179f8c , "KX-6000G HDMI/DP" , MODEL_GF ),
2387
+ HDA_CODEC_ID_MODEL ( 0x1d179f8d , "KX-6000G HDMI/DP" , MODEL_GF ),
2388
+ HDA_CODEC_ID_MODEL ( 0x1d179f8e , "KX-7000 HDMI/DP" , MODEL_GF ),
2389
+ HDA_CODEC_ID_MODEL ( 0x1d179f8f , "KX-7000 HDMI/DP" , MODEL_GF ),
2390
+ HDA_CODEC_ID_MODEL ( 0x1d179f90 , "KX-7000 HDMI/DP" , MODEL_GF ),
2391
+ HDA_CODEC_ID_MODEL ( 0x67663d82 , "Arise 82 HDMI/DP" , MODEL_GF ),
2392
+ HDA_CODEC_ID_MODEL ( 0x67663d83 , "Arise 83 HDMI/DP" , MODEL_GF ),
2393
+ HDA_CODEC_ID_MODEL ( 0x67663d84 , "Arise 84 HDMI/DP" , MODEL_GF ),
2394
+ HDA_CODEC_ID_MODEL ( 0x67663d85 , "Arise 85 HDMI/DP" , MODEL_GF ),
2395
+ HDA_CODEC_ID_MODEL ( 0x67663d86 , "Arise 86 HDMI/DP" , MODEL_GF ),
2396
+ HDA_CODEC_ID_MODEL ( 0x67663d87 , "Arise 87 HDMI/DP" , MODEL_GF ),
2397
+ HDA_CODEC_ID_MODEL (0x80862801 , "Bearlake HDMI" , MODEL_GENERIC ),
2398
+ HDA_CODEC_ID_MODEL (0x80862802 , "Cantiga HDMI" , MODEL_GENERIC ),
2399
+ HDA_CODEC_ID_MODEL (0x80862803 , "Eaglelake HDMI" , MODEL_GENERIC ),
2400
+ HDA_CODEC_ID_MODEL (0x80862880 , "CedarTrail HDMI" , MODEL_GENERIC ),
2401
+ HDA_CODEC_ID_MODEL (0x808629fb , "Crestline HDMI" , MODEL_GENERIC ),
2402
+ /* special ID for generic HDMI */
2403
+ HDA_CODEC_ID_MODEL (HDA_CODEC_ID_GENERIC_HDMI , "Generic HDMI" , MODEL_GENERIC ),
2404
+ {} /* terminator */
2400
2405
};
2401
- MODULE_DEVICE_TABLE (hdaudio , snd_hda_id_hdmi );
2406
+ MODULE_DEVICE_TABLE (hdaudio , snd_hda_id_generichdmi );
2402
2407
2403
2408
MODULE_LICENSE ("GPL" );
2404
- MODULE_DESCRIPTION ("HDMI HD-audio codec" );
2409
+ MODULE_DESCRIPTION ("Generic HDMI HD-audio codec" );
2405
2410
2406
- static struct hda_codec_driver hdmi_driver = {
2407
- .id = snd_hda_id_hdmi ,
2411
+ static struct hda_codec_driver generichdmi_driver = {
2412
+ .id = snd_hda_id_generichdmi ,
2413
+ .ops = & generichdmi_codec_ops ,
2408
2414
};
2409
2415
2410
- module_hda_codec_driver (hdmi_driver );
2416
+ module_hda_codec_driver (generichdmi_driver );
0 commit comments