2014-03-01 07:41:22 +08:00
|
|
|
/*
|
|
|
|
* Common functionality for the alsa driver code base for HD Audio.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the Free
|
|
|
|
* Software Foundation; either version 2 of the License, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SOUND_HDA_CONTROLLER_H
|
|
|
|
#define __SOUND_HDA_CONTROLLER_H
|
|
|
|
|
|
|
|
#include <sound/core.h>
|
|
|
|
#include <sound/initval.h>
|
|
|
|
#include "hda_codec.h"
|
|
|
|
#include "hda_priv.h"
|
|
|
|
|
|
|
|
/* PCM setup */
|
|
|
|
static inline struct azx_dev *get_azx_dev(struct snd_pcm_substream *substream)
|
|
|
|
{
|
|
|
|
return substream->runtime->private_data;
|
|
|
|
}
|
2014-06-26 22:50:16 +08:00
|
|
|
unsigned int azx_get_position(struct azx *chip, struct azx_dev *azx_dev);
|
|
|
|
unsigned int azx_get_pos_lpib(struct azx *chip, struct azx_dev *azx_dev);
|
|
|
|
unsigned int azx_get_pos_posbuf(struct azx *chip, struct azx_dev *azx_dev);
|
2014-03-01 07:41:22 +08:00
|
|
|
|
|
|
|
/* Stream control. */
|
|
|
|
void azx_stream_stop(struct azx *chip, struct azx_dev *azx_dev);
|
|
|
|
|
2014-03-01 07:41:23 +08:00
|
|
|
/* Allocation functions. */
|
|
|
|
int azx_alloc_stream_pages(struct azx *chip);
|
|
|
|
void azx_free_stream_pages(struct azx *chip);
|
|
|
|
|
2014-03-01 07:41:27 +08:00
|
|
|
/* Low level azx interface */
|
2014-04-09 18:30:57 +08:00
|
|
|
void azx_init_chip(struct azx *chip, bool full_reset);
|
2014-03-01 07:41:27 +08:00
|
|
|
void azx_stop_chip(struct azx *chip);
|
|
|
|
void azx_enter_link_reset(struct azx *chip);
|
2014-03-01 07:41:29 +08:00
|
|
|
irqreturn_t azx_interrupt(int irq, void *dev_id);
|
2014-03-01 07:41:27 +08:00
|
|
|
|
2014-03-01 07:41:30 +08:00
|
|
|
/* Codec interface */
|
|
|
|
int azx_codec_create(struct azx *chip, const char *model,
|
|
|
|
unsigned int max_slots,
|
|
|
|
int *power_save_to);
|
|
|
|
int azx_codec_configure(struct azx *chip);
|
|
|
|
int azx_mixer_create(struct azx *chip);
|
|
|
|
int azx_init_stream(struct azx *chip);
|
|
|
|
|
2014-06-26 23:24:45 +08:00
|
|
|
void azx_notifier_register(struct azx *chip);
|
|
|
|
void azx_notifier_unregister(struct azx *chip);
|
|
|
|
|
2014-03-01 07:41:22 +08:00
|
|
|
#endif /* __SOUND_HDA_CONTROLLER_H */
|