1
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
2
/*
3
- * HD audio interface patch for Creative X-Fi CA0110-IBG chip
3
+ * HD audio codec driver for Creative X-Fi CA0110-IBG chip
4
4
*
5
5
* Copyright (c) 2008 Takashi Iwai <[email protected] >
6
6
*/
15
15
#include "hda_jack.h"
16
16
#include "generic.h"
17
17
18
-
19
- static const struct hda_codec_ops ca0110_patch_ops = {
20
- .build_controls = snd_hda_gen_build_controls ,
21
- .build_pcms = snd_hda_gen_build_pcms ,
22
- .init = snd_hda_gen_init ,
23
- .free = snd_hda_gen_free ,
24
- .unsol_event = snd_hda_jack_unsol_event ,
25
- };
26
-
27
18
static int ca0110_parse_auto_config (struct hda_codec * codec )
28
19
{
29
20
struct hda_gen_spec * spec = codec -> spec ;
@@ -39,8 +30,7 @@ static int ca0110_parse_auto_config(struct hda_codec *codec)
39
30
return 0 ;
40
31
}
41
32
42
-
43
- static int patch_ca0110 (struct hda_codec * codec )
33
+ static int ca0110_probe (struct hda_codec * codec , const struct hda_device_id * id )
44
34
{
45
35
struct hda_gen_spec * spec ;
46
36
int err ;
@@ -50,7 +40,6 @@ static int patch_ca0110(struct hda_codec *codec)
50
40
return - ENOMEM ;
51
41
snd_hda_gen_spec_init (spec );
52
42
codec -> spec = spec ;
53
- codec -> patch_ops = ca0110_patch_ops ;
54
43
55
44
spec -> multi_cap_vol = 1 ;
56
45
codec -> bus -> core .needs_damn_long_delay = 1 ;
@@ -62,18 +51,27 @@ static int patch_ca0110(struct hda_codec *codec)
62
51
return 0 ;
63
52
64
53
error :
65
- snd_hda_gen_free (codec );
54
+ snd_hda_gen_remove (codec );
66
55
return err ;
67
56
}
68
57
69
58
59
+ static const struct hda_codec_ops ca0110_codec_ops = {
60
+ .probe = ca0110_probe ,
61
+ .remove = snd_hda_gen_remove ,
62
+ .build_controls = snd_hda_gen_build_controls ,
63
+ .build_pcms = snd_hda_gen_build_pcms ,
64
+ .init = snd_hda_gen_init ,
65
+ .unsol_event = snd_hda_jack_unsol_event ,
66
+ };
67
+
70
68
/*
71
- * patch entries
69
+ * driver entries
72
70
*/
73
71
static const struct hda_device_id snd_hda_id_ca0110 [] = {
74
- HDA_CODEC_ENTRY (0x1102000a , "CA0110-IBG" , patch_ca0110 ),
75
- HDA_CODEC_ENTRY (0x1102000b , "CA0110-IBG" , patch_ca0110 ),
76
- HDA_CODEC_ENTRY (0x1102000d , "SB0880 X-Fi" , patch_ca0110 ),
72
+ HDA_CODEC_ID (0x1102000a , "CA0110-IBG" ),
73
+ HDA_CODEC_ID (0x1102000b , "CA0110-IBG" ),
74
+ HDA_CODEC_ID (0x1102000d , "SB0880 X-Fi" ),
77
75
{} /* terminator */
78
76
};
79
77
MODULE_DEVICE_TABLE (hdaudio , snd_hda_id_ca0110 );
@@ -83,6 +81,7 @@ MODULE_DESCRIPTION("Creative CA0110-IBG HD-audio codec");
83
81
84
82
static struct hda_codec_driver ca0110_driver = {
85
83
.id = snd_hda_id_ca0110 ,
84
+ .ops = & ca0110_codec_ops ,
86
85
};
87
86
88
87
module_hda_codec_driver (ca0110_driver );
0 commit comments