Dylan Reid | 05e8487 | 2014-02-28 15:41:22 -0800 | [diff] [blame] | 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 | |
| 15 | #ifndef __SOUND_HDA_CONTROLLER_H |
| 16 | #define __SOUND_HDA_CONTROLLER_H |
| 17 | |
| 18 | #include <sound/core.h> |
| 19 | #include <sound/initval.h> |
| 20 | #include "hda_codec.h" |
| 21 | #include "hda_priv.h" |
| 22 | |
| 23 | /* PCM setup */ |
Dylan Reid | 05e8487 | 2014-02-28 15:41:22 -0800 | [diff] [blame] | 24 | static inline struct azx_dev *get_azx_dev(struct snd_pcm_substream *substream) |
| 25 | { |
| 26 | return substream->runtime->private_data; |
| 27 | } |
| 28 | unsigned int azx_get_position(struct azx *chip, |
| 29 | struct azx_dev *azx_dev, |
| 30 | bool with_check); |
| 31 | |
| 32 | /* Stream control. */ |
Dylan Reid | 05e8487 | 2014-02-28 15:41:22 -0800 | [diff] [blame] | 33 | void azx_stream_stop(struct azx *chip, struct azx_dev *azx_dev); |
Dylan Reid | 05e8487 | 2014-02-28 15:41:22 -0800 | [diff] [blame] | 34 | |
Dylan Reid | 6790899 | 2014-02-28 15:41:23 -0800 | [diff] [blame] | 35 | /* Allocation functions. */ |
| 36 | int azx_alloc_stream_pages(struct azx *chip); |
| 37 | void azx_free_stream_pages(struct azx *chip); |
| 38 | |
Dylan Reid | f43923f | 2014-02-28 15:41:27 -0800 | [diff] [blame] | 39 | /* Low level azx interface */ |
Thierry Reding | 17c3ad0 | 2014-04-09 12:30:57 +0200 | [diff] [blame^] | 40 | void azx_init_chip(struct azx *chip, bool full_reset); |
Dylan Reid | f43923f | 2014-02-28 15:41:27 -0800 | [diff] [blame] | 41 | void azx_stop_chip(struct azx *chip); |
| 42 | void azx_enter_link_reset(struct azx *chip); |
Dylan Reid | f0b1df8 | 2014-02-28 15:41:29 -0800 | [diff] [blame] | 43 | irqreturn_t azx_interrupt(int irq, void *dev_id); |
Dylan Reid | f43923f | 2014-02-28 15:41:27 -0800 | [diff] [blame] | 44 | |
Dylan Reid | 154867c | 2014-02-28 15:41:30 -0800 | [diff] [blame] | 45 | /* Codec interface */ |
| 46 | int azx_codec_create(struct azx *chip, const char *model, |
| 47 | unsigned int max_slots, |
| 48 | int *power_save_to); |
| 49 | int azx_codec_configure(struct azx *chip); |
| 50 | int azx_mixer_create(struct azx *chip); |
| 51 | int azx_init_stream(struct azx *chip); |
| 52 | |
Dylan Reid | 05e8487 | 2014-02-28 15:41:22 -0800 | [diff] [blame] | 53 | #endif /* __SOUND_HDA_CONTROLLER_H */ |