Skip to content

Commit dbe3e4a

Browse files
committed
ALSA: hda/ca0110: Rewrite to new probe method
Convert the CA0110 codec driver to use the new hda_codec_ops probe. No functional changes. Signed-off-by: Takashi Iwai <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent f025ef0 commit dbe3e4a

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

sound/hda/codecs/ca0110.c

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22
/*
3-
* HD audio interface patch for Creative X-Fi CA0110-IBG chip
3+
* HD audio codec driver for Creative X-Fi CA0110-IBG chip
44
*
55
* Copyright (c) 2008 Takashi Iwai <[email protected]>
66
*/
@@ -15,15 +15,6 @@
1515
#include "hda_jack.h"
1616
#include "generic.h"
1717

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-
2718
static int ca0110_parse_auto_config(struct hda_codec *codec)
2819
{
2920
struct hda_gen_spec *spec = codec->spec;
@@ -39,8 +30,7 @@ static int ca0110_parse_auto_config(struct hda_codec *codec)
3930
return 0;
4031
}
4132

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)
4434
{
4535
struct hda_gen_spec *spec;
4636
int err;
@@ -50,7 +40,6 @@ static int patch_ca0110(struct hda_codec *codec)
5040
return -ENOMEM;
5141
snd_hda_gen_spec_init(spec);
5242
codec->spec = spec;
53-
codec->patch_ops = ca0110_patch_ops;
5443

5544
spec->multi_cap_vol = 1;
5645
codec->bus->core.needs_damn_long_delay = 1;
@@ -62,18 +51,27 @@ static int patch_ca0110(struct hda_codec *codec)
6251
return 0;
6352

6453
error:
65-
snd_hda_gen_free(codec);
54+
snd_hda_gen_remove(codec);
6655
return err;
6756
}
6857

6958

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+
7068
/*
71-
* patch entries
69+
* driver entries
7270
*/
7371
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"),
7775
{} /* terminator */
7876
};
7977
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_ca0110);
@@ -83,6 +81,7 @@ MODULE_DESCRIPTION("Creative CA0110-IBG HD-audio codec");
8381

8482
static struct hda_codec_driver ca0110_driver = {
8583
.id = snd_hda_id_ca0110,
84+
.ops = &ca0110_codec_ops,
8685
};
8786

8887
module_hda_codec_driver(ca0110_driver);

0 commit comments

Comments
 (0)