ALSA: hda - Add hda_controller.c and move pcm ops from hda_intel
Pull the pcm_ops and the functions they use into a new hda_controller file. This is done to allow for other hda implementations besides PCI to use the same ops. The hda_controller file will house functionality related to HDA but independent of the bus used to talk to the controller. This currently shares dsp locking across the two files. This will be remedied in a following commit. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Родитель
8769b27861
Коммит
05e848788e
|
@ -1,4 +1,4 @@
|
|||
snd-hda-intel-objs := hda_intel.o
|
||||
snd-hda-intel-objs := hda_controller.o hda_intel.o
|
||||
# for haswell power well
|
||||
snd-hda-intel-$(CONFIG_SND_HDA_I915) += hda_i915.o
|
||||
|
||||
|
@ -9,7 +9,7 @@ snd-hda-codec-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o
|
|||
|
||||
# for trace-points
|
||||
CFLAGS_hda_codec.o := -I$(src)
|
||||
CFLAGS_hda_intel.o := -I$(src)
|
||||
CFLAGS_hda_controller.o := -I$(src)
|
||||
|
||||
snd-hda-codec-generic-objs := hda_generic.o
|
||||
snd-hda-codec-realtek-objs := patch_realtek.o
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* 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 */
|
||||
int azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
|
||||
struct hda_pcm *cpcm);
|
||||
static inline struct azx_dev *get_azx_dev(struct snd_pcm_substream *substream)
|
||||
{
|
||||
return substream->runtime->private_data;
|
||||
}
|
||||
unsigned int azx_get_position(struct azx *chip,
|
||||
struct azx_dev *azx_dev,
|
||||
bool with_check);
|
||||
|
||||
/* Stream control. */
|
||||
void azx_stream_start(struct azx *chip, struct azx_dev *azx_dev);
|
||||
void azx_stream_stop(struct azx *chip, struct azx_dev *azx_dev);
|
||||
void azx_stream_reset(struct azx *chip, struct azx_dev *azx_dev);
|
||||
int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev);
|
||||
int setup_bdle(struct azx *chip,
|
||||
struct snd_dma_buffer *dmab,
|
||||
struct azx_dev *azx_dev, u32 **bdlp,
|
||||
int ofs, int size, int with_ioc);
|
||||
|
||||
/* DSP lock helpers */
|
||||
#ifdef CONFIG_SND_HDA_DSP_LOADER
|
||||
#define dsp_lock_init(dev) mutex_init(&(dev)->dsp_mutex)
|
||||
#define dsp_lock(dev) mutex_lock(&(dev)->dsp_mutex)
|
||||
#define dsp_unlock(dev) mutex_unlock(&(dev)->dsp_mutex)
|
||||
#define dsp_is_locked(dev) ((dev)->locked)
|
||||
#else
|
||||
#define dsp_lock_init(dev) do {} while (0)
|
||||
#define dsp_lock(dev) do {} while (0)
|
||||
#define dsp_unlock(dev) do {} while (0)
|
||||
#define dsp_is_locked(dev) 0
|
||||
#endif
|
||||
|
||||
#endif /* __SOUND_HDA_CONTROLLER_H */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче