hda_auto_parser.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * BIOS auto-parser helper functions for HD-audio
  3. *
  4. * Copyright (c) 2012 Takashi Iwai <tiwai@suse.de>
  5. *
  6. * This driver is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. */
  11. #ifndef __SOUND_HDA_AUTO_PARSER_H
  12. #define __SOUND_HDA_AUTO_PARSER_H
  13. struct hda_gen_spec {
  14. /* fix-up list */
  15. int fixup_id;
  16. const struct hda_fixup *fixup_list;
  17. const char *fixup_name;
  18. /* additional init verbs */
  19. struct snd_array verbs;
  20. };
  21. /*
  22. * Fix-up pin default configurations and add default verbs
  23. */
  24. struct hda_pintbl {
  25. hda_nid_t nid;
  26. u32 val;
  27. };
  28. struct hda_model_fixup {
  29. const int id;
  30. const char *name;
  31. };
  32. struct hda_fixup {
  33. int type;
  34. bool chained;
  35. int chain_id;
  36. union {
  37. const struct hda_pintbl *pins;
  38. const struct hda_verb *verbs;
  39. void (*func)(struct hda_codec *codec,
  40. const struct hda_fixup *fix,
  41. int action);
  42. } v;
  43. };
  44. /* fixup types */
  45. enum {
  46. HDA_FIXUP_INVALID,
  47. HDA_FIXUP_PINS,
  48. HDA_FIXUP_VERBS,
  49. HDA_FIXUP_FUNC,
  50. };
  51. /* fixup action definitions */
  52. enum {
  53. HDA_FIXUP_ACT_PRE_PROBE,
  54. HDA_FIXUP_ACT_PROBE,
  55. HDA_FIXUP_ACT_INIT,
  56. HDA_FIXUP_ACT_BUILD,
  57. };
  58. int snd_hda_gen_add_verbs(struct hda_gen_spec *spec,
  59. const struct hda_verb *list);
  60. void snd_hda_gen_apply_verbs(struct hda_codec *codec);
  61. void snd_hda_apply_pincfgs(struct hda_codec *codec,
  62. const struct hda_pintbl *cfg);
  63. void snd_hda_apply_fixup(struct hda_codec *codec, int action);
  64. void snd_hda_pick_fixup(struct hda_codec *codec,
  65. const struct hda_model_fixup *models,
  66. const struct snd_pci_quirk *quirk,
  67. const struct hda_fixup *fixlist);
  68. #endif /* __SOUND_HDA_AUTO_PARSER_H */