Skip to content

Commit

Permalink
ALSA: hdac_ext: add extended stream capabilities
Browse files Browse the repository at this point in the history
Now we have the bus and controller code added to find and initialize
the extended capabilities. Now we need to use them in stream code to
decouple stream, manage links etc

So this patch adds the stream handling code for extended capabilities
introduced in preceding patches

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
kpjeeja authored and tiwai committed Jun 11, 2015
1 parent 0b00a56 commit df203a4
Show file tree
Hide file tree
Showing 3 changed files with 451 additions and 1 deletion.
48 changes: 48 additions & 0 deletions include/sound/hdaudio_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,50 @@ enum hdac_ext_stream_type {
HDAC_EXT_STREAM_TYPE_LINK
};

/**
* hdac_ext_stream: HDAC extended stream for extended HDA caps
*
* @hstream: hdac_stream
* @pphc_addr: processing pipe host stream pointer
* @pplc_addr: processing pipe link stream pointer
* @decoupled: stream host and link is decoupled
* @link_locked: link is locked
* @link_prepared: link is prepared
* link_substream: link substream
*/
struct hdac_ext_stream {
struct hdac_stream hstream;

void __iomem *pphc_addr;
void __iomem *pplc_addr;

bool decoupled:1;
bool link_locked:1;
bool link_prepared;

struct snd_pcm_substream *link_substream;
};

#define hdac_stream(s) (&(s)->hstream)
#define stream_to_hdac_ext_stream(s) \
container_of(s, struct hdac_ext_stream, hstream)

void snd_hdac_ext_stream_init(struct hdac_ext_bus *bus,
struct hdac_ext_stream *stream, int idx,
int direction, int tag);
struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_ext_bus *bus,
struct snd_pcm_substream *substream,
int type);
void snd_hdac_ext_stream_release(struct hdac_ext_stream *azx_dev, int type);
void snd_hdac_ext_stream_decouple(struct hdac_ext_bus *bus,
struct hdac_ext_stream *azx_dev, bool decouple);
void snd_hdac_ext_stop_streams(struct hdac_ext_bus *sbus);

void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *hstream);
void snd_hdac_ext_link_stream_clear(struct hdac_ext_stream *hstream);
void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *hstream);
int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *stream, int fmt);

struct hdac_ext_link {
struct hdac_bus *bus;
int index;
Expand All @@ -78,4 +122,8 @@ void snd_hdac_ext_link_clear_stream_id(struct hdac_ext_link *link,
writel(((readl(addr + reg) & ~(mask)) | (val)), \
addr + reg)

#define snd_hdac_updatew(addr, reg, mask, val) \
writew(((readw(addr + reg) & ~(mask)) | (val)), \
addr + reg)

#endif /* __SOUND_HDAUDIO_EXT_H */
2 changes: 1 addition & 1 deletion sound/hda/ext/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
snd-hda-ext-core-objs := hdac_ext_bus.o hdac_ext_controller.o
snd-hda-ext-core-objs := hdac_ext_bus.o hdac_ext_controller.o hdac_ext_stream.o

obj-$(CONFIG_SND_HDA_EXT_CORE) += snd-hda-ext-core.o
Loading

0 comments on commit df203a4

Please sign in to comment.