alc680.c 1.4 KB

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