@@ -1134,7 +1134,6 @@ struct ca0132_spec {
1134
1134
1135
1135
struct hda_codec * codec ;
1136
1136
struct delayed_work unsol_hp_work ;
1137
- int quirk ;
1138
1137
1139
1138
#ifdef ENABLE_TUNING_CONTROLS
1140
1139
long cur_ctl_vals [TUNING_CTLS_COUNT ];
@@ -1166,7 +1165,6 @@ struct ca0132_spec {
1166
1165
* CA0132 quirks table
1167
1166
*/
1168
1167
enum {
1169
- QUIRK_NONE ,
1170
1168
QUIRK_ALIENWARE ,
1171
1169
QUIRK_ALIENWARE_M17XR4 ,
1172
1170
QUIRK_SBZ ,
@@ -1176,10 +1174,11 @@ enum {
1176
1174
QUIRK_R3D ,
1177
1175
QUIRK_AE5 ,
1178
1176
QUIRK_AE7 ,
1177
+ QUIRK_NONE = HDA_FIXUP_ID_NOT_SET ,
1179
1178
};
1180
1179
1181
1180
#ifdef CONFIG_PCI
1182
- #define ca0132_quirk (spec ) ((spec)->quirk )
1181
+ #define ca0132_quirk (spec ) ((spec)->codec->fixup_id )
1183
1182
#define ca0132_use_pci_mmio (spec ) ((spec)->use_pci_mmio)
1184
1183
#define ca0132_use_alt_functions (spec ) ((spec)->use_alt_functions)
1185
1184
#define ca0132_use_alt_controls (spec ) ((spec)->use_alt_controls)
@@ -1293,7 +1292,7 @@ static const struct hda_pintbl ae7_pincfgs[] = {
1293
1292
{}
1294
1293
};
1295
1294
1296
- static const struct snd_pci_quirk ca0132_quirks [] = {
1295
+ static const struct hda_quirk ca0132_quirks [] = {
1297
1296
SND_PCI_QUIRK (0x1028 , 0x057b , "Alienware M17x R4" , QUIRK_ALIENWARE_M17XR4 ),
1298
1297
SND_PCI_QUIRK (0x1028 , 0x0685 , "Alienware 15 2015" , QUIRK_ALIENWARE ),
1299
1298
SND_PCI_QUIRK (0x1028 , 0x0688 , "Alienware 17 2015" , QUIRK_ALIENWARE ),
@@ -1316,6 +1315,19 @@ static const struct snd_pci_quirk ca0132_quirks[] = {
1316
1315
{}
1317
1316
};
1318
1317
1318
+ static const struct hda_model_fixup ca0132_quirk_models [] = {
1319
+ { .id = QUIRK_ALIENWARE , .name = "alienware" },
1320
+ { .id = QUIRK_ALIENWARE_M17XR4 , .name = "alienware-m17xr4" },
1321
+ { .id = QUIRK_SBZ , .name = "sbz" },
1322
+ { .id = QUIRK_ZXR , .name = "zxr" },
1323
+ { .id = QUIRK_ZXR_DBPRO , .name = "zxr-dbpro" },
1324
+ { .id = QUIRK_R3DI , .name = "r3di" },
1325
+ { .id = QUIRK_R3D , .name = "r3d" },
1326
+ { .id = QUIRK_AE5 , .name = "ae5" },
1327
+ { .id = QUIRK_AE7 , .name = "ae7" },
1328
+ {}
1329
+ };
1330
+
1319
1331
/* Output selection quirk info structures. */
1320
1332
#define MAX_QUIRK_MMIO_GPIO_SET_VALS 3
1321
1333
#define MAX_QUIRK_SCP_SET_VALS 2
@@ -9957,17 +9969,15 @@ static int ca0132_prepare_verbs(struct hda_codec *codec)
9957
9969
*/
9958
9970
static void sbz_detect_quirk (struct hda_codec * codec )
9959
9971
{
9960
- struct ca0132_spec * spec = codec -> spec ;
9961
-
9962
9972
switch (codec -> core .subsystem_id ) {
9963
9973
case 0x11020033 :
9964
- spec -> quirk = QUIRK_ZXR ;
9974
+ codec -> fixup_id = QUIRK_ZXR ;
9965
9975
break ;
9966
9976
case 0x1102003f :
9967
- spec -> quirk = QUIRK_ZXR_DBPRO ;
9977
+ codec -> fixup_id = QUIRK_ZXR_DBPRO ;
9968
9978
break ;
9969
9979
default :
9970
- spec -> quirk = QUIRK_SBZ ;
9980
+ codec -> fixup_id = QUIRK_SBZ ;
9971
9981
break ;
9972
9982
}
9973
9983
}
@@ -9976,7 +9986,6 @@ static int patch_ca0132(struct hda_codec *codec)
9976
9986
{
9977
9987
struct ca0132_spec * spec ;
9978
9988
int err ;
9979
- const struct snd_pci_quirk * quirk ;
9980
9989
9981
9990
codec_dbg (codec , "patch_ca0132\n" );
9982
9991
@@ -9987,11 +9996,7 @@ static int patch_ca0132(struct hda_codec *codec)
9987
9996
spec -> codec = codec ;
9988
9997
9989
9998
/* Detect codec quirk */
9990
- quirk = snd_pci_quirk_lookup (codec -> bus -> pci , ca0132_quirks );
9991
- if (quirk )
9992
- spec -> quirk = quirk -> value ;
9993
- else
9994
- spec -> quirk = QUIRK_NONE ;
9999
+ snd_hda_pick_fixup (codec , ca0132_quirk_models , ca0132_quirks , NULL );
9995
10000
if (ca0132_quirk (spec ) == QUIRK_SBZ )
9996
10001
sbz_detect_quirk (codec );
9997
10002
@@ -10068,7 +10073,7 @@ static int patch_ca0132(struct hda_codec *codec)
10068
10073
spec -> mem_base = pci_iomap (codec -> bus -> pci , 2 , 0xC20 );
10069
10074
if (spec -> mem_base == NULL ) {
10070
10075
codec_warn (codec , "pci_iomap failed! Setting quirk to QUIRK_NONE." );
10071
- spec -> quirk = QUIRK_NONE ;
10076
+ codec -> fixup_id = QUIRK_NONE ;
10072
10077
}
10073
10078
}
10074
10079
#endif
0 commit comments