1
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
2
/*
3
- * HD audio interface patch for Senary HDA audio codec
3
+ * HD audio codec driver for Senary HDA audio codec
4
4
*
5
5
* Initially based on conexant.c
6
6
*/
@@ -129,7 +129,7 @@ static void senary_init_gpio_led(struct hda_codec *codec)
129
129
}
130
130
}
131
131
132
- static int senary_auto_init (struct hda_codec * codec )
132
+ static int senary_init (struct hda_codec * codec )
133
133
{
134
134
snd_hda_gen_init (codec );
135
135
senary_init_gpio_led (codec );
@@ -138,7 +138,7 @@ static int senary_auto_init(struct hda_codec *codec)
138
138
return 0 ;
139
139
}
140
140
141
- static void senary_auto_shutdown (struct hda_codec * codec )
141
+ static void senary_shutdown (struct hda_codec * codec )
142
142
{
143
143
struct senary_spec * spec = codec -> spec ;
144
144
@@ -148,29 +148,19 @@ static void senary_auto_shutdown(struct hda_codec *codec)
148
148
senary_auto_turn_eapd (codec , spec -> num_eapds , spec -> eapds , false);
149
149
}
150
150
151
- static void senary_auto_free (struct hda_codec * codec )
151
+ static void senary_remove (struct hda_codec * codec )
152
152
{
153
- senary_auto_shutdown (codec );
154
- snd_hda_gen_free (codec );
153
+ senary_shutdown (codec );
154
+ snd_hda_gen_remove (codec );
155
155
}
156
156
157
- static int senary_auto_suspend (struct hda_codec * codec )
157
+ static int senary_suspend (struct hda_codec * codec )
158
158
{
159
- senary_auto_shutdown (codec );
159
+ senary_shutdown (codec );
160
160
return 0 ;
161
161
}
162
162
163
- static const struct hda_codec_ops senary_auto_patch_ops = {
164
- .build_controls = snd_hda_gen_build_controls ,
165
- .build_pcms = snd_hda_gen_build_pcms ,
166
- .init = senary_auto_init ,
167
- .free = senary_auto_free ,
168
- .unsol_event = snd_hda_jack_unsol_event ,
169
- .suspend = senary_auto_suspend ,
170
- .check_power_status = snd_hda_gen_check_power_status ,
171
- };
172
-
173
- static int patch_senary_auto (struct hda_codec * codec )
163
+ static int senary_probe (struct hda_codec * codec , const struct hda_device_id * id )
174
164
{
175
165
struct senary_spec * spec ;
176
166
int err ;
@@ -182,7 +172,6 @@ static int patch_senary_auto(struct hda_codec *codec)
182
172
return - ENOMEM ;
183
173
snd_hda_gen_spec_init (& spec -> gen );
184
174
codec -> spec = spec ;
185
- codec -> patch_ops = senary_auto_patch_ops ;
186
175
187
176
senary_auto_parse_eapd (codec );
188
177
spec -> gen .own_eapd_ctl = 1 ;
@@ -221,15 +210,27 @@ static int patch_senary_auto(struct hda_codec *codec)
221
210
return 0 ;
222
211
223
212
error :
224
- senary_auto_free (codec );
213
+ senary_remove (codec );
225
214
return err ;
226
215
}
227
216
217
+ static const struct hda_codec_ops senary_codec_ops = {
218
+ .probe = senary_probe ,
219
+ .remove = senary_remove ,
220
+ .build_controls = snd_hda_gen_build_controls ,
221
+ .build_pcms = snd_hda_gen_build_pcms ,
222
+ .init = senary_init ,
223
+ .unsol_event = snd_hda_jack_unsol_event ,
224
+ .suspend = senary_suspend ,
225
+ .check_power_status = snd_hda_gen_check_power_status ,
226
+ .stream_pm = snd_hda_gen_stream_pm ,
227
+ };
228
+
228
229
/*
229
230
*/
230
231
231
232
static const struct hda_device_id snd_hda_id_senary [] = {
232
- HDA_CODEC_ENTRY (0x1fa86186 , "SN6186" , patch_senary_auto ),
233
+ HDA_CODEC_ID (0x1fa86186 , "SN6186" ),
233
234
{} /* terminator */
234
235
};
235
236
MODULE_DEVICE_TABLE (hdaudio , snd_hda_id_senary );
@@ -239,6 +240,7 @@ MODULE_DESCRIPTION("Senarytech HD-audio codec");
239
240
240
241
static struct hda_codec_driver senary_driver = {
241
242
.id = snd_hda_id_senary ,
243
+ .ops = & senary_codec_ops ,
242
244
};
243
245
244
246
module_hda_codec_driver (senary_driver );
0 commit comments