1aeeb85f2STakashi Iwai // SPDX-License-Identifier: GPL-2.0-or-later
2aeeb85f2STakashi Iwai //
3aeeb85f2STakashi Iwai // Realtek ALC680 codec
4aeeb85f2STakashi Iwai //
5aeeb85f2STakashi Iwai
6aeeb85f2STakashi Iwai #include <linux/init.h>
7aeeb85f2STakashi Iwai #include <linux/module.h>
8aeeb85f2STakashi Iwai #include "realtek.h"
9aeeb85f2STakashi Iwai
alc680_parse_auto_config(struct hda_codec * codec)10aeeb85f2STakashi Iwai static int alc680_parse_auto_config(struct hda_codec *codec)
11aeeb85f2STakashi Iwai {
12aeeb85f2STakashi Iwai return alc_parse_auto_config(codec, NULL, NULL);
13aeeb85f2STakashi Iwai }
14aeeb85f2STakashi Iwai
15aeeb85f2STakashi Iwai /*
16aeeb85f2STakashi Iwai */
alc680_probe(struct hda_codec * codec,const struct hda_device_id * id)17*e1d695b4STakashi Iwai static int alc680_probe(struct hda_codec *codec, const struct hda_device_id *id)
18aeeb85f2STakashi Iwai {
19aeeb85f2STakashi Iwai int err;
20aeeb85f2STakashi Iwai
21aeeb85f2STakashi Iwai /* ALC680 has no aa-loopback mixer */
22aeeb85f2STakashi Iwai err = alc_alloc_spec(codec, 0);
23aeeb85f2STakashi Iwai if (err < 0)
24aeeb85f2STakashi Iwai return err;
25aeeb85f2STakashi Iwai
26aeeb85f2STakashi Iwai /* automatic parse from the BIOS config */
27aeeb85f2STakashi Iwai err = alc680_parse_auto_config(codec);
28aeeb85f2STakashi Iwai if (err < 0) {
29*e1d695b4STakashi Iwai snd_hda_gen_remove(codec);
30aeeb85f2STakashi Iwai return err;
31aeeb85f2STakashi Iwai }
32aeeb85f2STakashi Iwai
33aeeb85f2STakashi Iwai return 0;
34aeeb85f2STakashi Iwai }
35aeeb85f2STakashi Iwai
36*e1d695b4STakashi Iwai static const struct hda_codec_ops alc680_codec_ops = {
37*e1d695b4STakashi Iwai .probe = alc680_probe,
38*e1d695b4STakashi Iwai .remove = snd_hda_gen_remove,
39*e1d695b4STakashi Iwai .build_controls = alc_build_controls,
40*e1d695b4STakashi Iwai .build_pcms = snd_hda_gen_build_pcms,
41*e1d695b4STakashi Iwai .init = alc_init,
42*e1d695b4STakashi Iwai .unsol_event = snd_hda_jack_unsol_event,
43*e1d695b4STakashi Iwai .resume = alc_resume,
44*e1d695b4STakashi Iwai .suspend = alc_suspend,
45*e1d695b4STakashi Iwai .check_power_status = snd_hda_gen_check_power_status,
46*e1d695b4STakashi Iwai .stream_pm = snd_hda_gen_stream_pm,
47*e1d695b4STakashi Iwai };
48*e1d695b4STakashi Iwai
49aeeb85f2STakashi Iwai /*
50aeeb85f2STakashi Iwai * driver entries
51aeeb85f2STakashi Iwai */
52aeeb85f2STakashi Iwai static const struct hda_device_id snd_hda_id_alc680[] = {
53*e1d695b4STakashi Iwai HDA_CODEC_ID(0x10ec0680, "ALC680"),
54aeeb85f2STakashi Iwai {} /* terminator */
55aeeb85f2STakashi Iwai };
56aeeb85f2STakashi Iwai MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_alc680);
57aeeb85f2STakashi Iwai
58aeeb85f2STakashi Iwai MODULE_LICENSE("GPL");
59aeeb85f2STakashi Iwai MODULE_DESCRIPTION("Realtek ALC680 HD-audio codec");
60aeeb85f2STakashi Iwai MODULE_IMPORT_NS("SND_HDA_CODEC_REALTEK");
61aeeb85f2STakashi Iwai
62aeeb85f2STakashi Iwai static struct hda_codec_driver alc680_driver = {
63aeeb85f2STakashi Iwai .id = snd_hda_id_alc680,
64*e1d695b4STakashi Iwai .ops = &alc680_codec_ops,
65aeeb85f2STakashi Iwai };
66aeeb85f2STakashi Iwai
67aeeb85f2STakashi Iwai module_hda_codec_driver(alc680_driver);
68