linux/sound/soc/sof/intel/hda-stream.c

// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
//
// This file is provided under a dual BSD/GPLv2 license.  When using or
// redistributing this file, you may do so under either license.
//
// Copyright(c) 2018 Intel Corporation
//
// Authors: Liam Girdwood <[email protected]>
//	    Ranjani Sridharan <[email protected]>
//	    Rander Wang <[email protected]>
//          Keyon Jie <[email protected]>
//

/*
 * Hardware interface for generic Intel audio DSP HDA IP
 */

#include <sound/hdaudio_ext.h>
#include <sound/hda_register.h>
#include <sound/sof.h>
#include <trace/events/sof_intel.h>
#include "../ops.h"
#include "../sof-audio.h"
#include "../ipc4-priv.h"
#include "hda.h"

int sof_hda_position_quirk =;
module_param_named(position_quirk, sof_hda_position_quirk, int, 0444);
MODULE_PARM_DESC();
EXPORT_SYMBOL_NS();

#define HDA_LTRP_GB_VALUE_US

static inline const char *hda_hstream_direction_str(struct hdac_stream *hstream)
{}

static char *hda_hstream_dbg_get_stream_info_str(struct hdac_stream *hstream)
{}

/*
 * set up one of BDL entries for a stream
 */
static int hda_setup_bdle(struct snd_sof_dev *sdev,
			  struct snd_dma_buffer *dmab,
			  struct hdac_stream *hstream,
			  struct sof_intel_dsp_bdl **bdlp,
			  int offset, int size, int ioc)
{}

/*
 * set up Buffer Descriptor List (BDL) for host memory transfer
 * BDL describes the location of the individual buffers and is little endian.
 */
int hda_dsp_stream_setup_bdl(struct snd_sof_dev *sdev,
			     struct snd_dma_buffer *dmab,
			     struct hdac_stream *hstream)
{}

int hda_dsp_stream_spib_config(struct snd_sof_dev *sdev,
			       struct hdac_ext_stream *hext_stream,
			       int enable, u32 size)
{}

/* get next unused stream */
struct hdac_ext_stream *
hda_dsp_stream_get(struct snd_sof_dev *sdev, int direction, u32 flags)
{}

/* free a stream */
int hda_dsp_stream_put(struct snd_sof_dev *sdev, int direction, int stream_tag)
{}

static int hda_dsp_stream_reset(struct snd_sof_dev *sdev, struct hdac_stream *hstream)
{}

int hda_dsp_stream_trigger(struct snd_sof_dev *sdev,
			   struct hdac_ext_stream *hext_stream, int cmd)
{}

/* minimal recommended programming for ICCMAX stream */
int hda_dsp_iccmax_stream_hw_params(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_stream,
				    struct snd_dma_buffer *dmab,
				    struct snd_pcm_hw_params *params)
{}

/*
 * prepare for common hdac registers settings, for both code loader
 * and normal stream.
 */
int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev,
			     struct hdac_ext_stream *hext_stream,
			     struct snd_dma_buffer *dmab,
			     struct snd_pcm_hw_params *params)
{}

int hda_dsp_stream_hw_free(struct snd_sof_dev *sdev,
			   struct snd_pcm_substream *substream)
{}
EXPORT_SYMBOL_NS();

bool hda_dsp_check_stream_irq(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

static void
hda_dsp_compr_bytes_transferred(struct hdac_stream *hstream, int direction)
{}

static bool hda_dsp_stream_check(struct hdac_bus *bus, u32 status)
{}

irqreturn_t hda_dsp_stream_threaded_handler(int irq, void *context)
{}
EXPORT_SYMBOL_NS();

int hda_dsp_stream_init(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

void hda_dsp_stream_free(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

snd_pcm_uframes_t hda_dsp_stream_get_position(struct hdac_stream *hstream,
					      int direction, bool can_sleep)
{}
EXPORT_SYMBOL_NS();

#define merge_u64(u32_u, u32_l)

/**
 * hda_dsp_get_stream_llp - Retrieve the LLP (Linear Link Position) of the stream
 * @sdev: SOF device
 * @component: ASoC component
 * @substream: PCM substream
 *
 * Returns the raw Linear Link Position value
 */
u64 hda_dsp_get_stream_llp(struct snd_sof_dev *sdev,
			   struct snd_soc_component *component,
			   struct snd_pcm_substream *substream)
{}
EXPORT_SYMBOL_NS();

/**
 * hda_dsp_get_stream_ldp - Retrieve the LDP (Linear DMA Position) of the stream
 * @sdev: SOF device
 * @component: ASoC component
 * @substream: PCM substream
 *
 * Returns the raw Linear Link Position value
 */
u64 hda_dsp_get_stream_ldp(struct snd_sof_dev *sdev,
			   struct snd_soc_component *component,
			   struct snd_pcm_substream *substream)
{}
EXPORT_SYMBOL_NS();