hda_controller.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Common functionality for the alsa driver code base for HD Audio.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License as published by the Free
  6. * Software Foundation; either version 2 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. */
  14. #ifndef __SOUND_HDA_CONTROLLER_H
  15. #define __SOUND_HDA_CONTROLLER_H
  16. #include <sound/core.h>
  17. #include <sound/initval.h>
  18. #include "hda_codec.h"
  19. #include "hda_priv.h"
  20. /* PCM setup */
  21. static inline struct azx_dev *get_azx_dev(struct snd_pcm_substream *substream)
  22. {
  23. return substream->runtime->private_data;
  24. }
  25. unsigned int azx_get_position(struct azx *chip, struct azx_dev *azx_dev);
  26. unsigned int azx_get_pos_lpib(struct azx *chip, struct azx_dev *azx_dev);
  27. unsigned int azx_get_pos_posbuf(struct azx *chip, struct azx_dev *azx_dev);
  28. /* Stream control. */
  29. void azx_stream_stop(struct azx *chip, struct azx_dev *azx_dev);
  30. /* Allocation functions. */
  31. int azx_alloc_stream_pages(struct azx *chip);
  32. void azx_free_stream_pages(struct azx *chip);
  33. /* Low level azx interface */
  34. void azx_init_chip(struct azx *chip, bool full_reset);
  35. void azx_stop_chip(struct azx *chip);
  36. void azx_enter_link_reset(struct azx *chip);
  37. irqreturn_t azx_interrupt(int irq, void *dev_id);
  38. /* Codec interface */
  39. int azx_codec_create(struct azx *chip, const char *model,
  40. unsigned int max_slots,
  41. int *power_save_to);
  42. int azx_codec_configure(struct azx *chip);
  43. int azx_mixer_create(struct azx *chip);
  44. int azx_init_stream(struct azx *chip);
  45. void azx_notifier_register(struct azx *chip);
  46. void azx_notifier_unregister(struct azx *chip);
  47. #endif /* __SOUND_HDA_CONTROLLER_H */