hda-pcm.c (4f797f56c3786e2c6bc542b3f80e9a599b073976) hda-pcm.c (ee1e79b72e3cf5eac42ba9de827536f91d4c04e2)
1// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2//
3// This file is provided under a dual BSD/GPLv2 license. When using or
4// redistributing this file, you may do so under either license.
5//
6// Copyright(c) 2018 Intel Corporation. All rights reserved.
7//
8// Authors: Liam Girdwood <liam.r.girdwood@linux.intel.com>
9// Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
10// Rander Wang <rander.wang@intel.com>
11// Keyon Jie <yang.jie@linux.intel.com>
12//
13
14/*
15 * Hardware interface for generic Intel audio DSP HDA IP
16 */
17
18#include <sound/hda_register.h>
19#include <sound/pcm_params.h>
1// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2//
3// This file is provided under a dual BSD/GPLv2 license. When using or
4// redistributing this file, you may do so under either license.
5//
6// Copyright(c) 2018 Intel Corporation. All rights reserved.
7//
8// Authors: Liam Girdwood <liam.r.girdwood@linux.intel.com>
9// Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
10// Rander Wang <rander.wang@intel.com>
11// Keyon Jie <yang.jie@linux.intel.com>
12//
13
14/*
15 * Hardware interface for generic Intel audio DSP HDA IP
16 */
17
18#include <sound/hda_register.h>
19#include <sound/pcm_params.h>
20#include "../sof-audio.h"
20#include "../ops.h"
21#include "hda.h"
22
23#define SDnFMT_BASE(x) ((x) << 14)
24#define SDnFMT_MULT(x) (((x) - 1) << 11)
25#define SDnFMT_DIV(x) (((x) - 1) << 8)
26#define SDnFMT_BITS(x) ((x) << 4)
27#define SDnFMT_CHAN(x) ((x) << 0)

--- 114 unchanged lines hidden (view full) ---

142
143 return hda_dsp_stream_trigger(sdev, stream, cmd);
144}
145
146snd_pcm_uframes_t hda_dsp_pcm_pointer(struct snd_sof_dev *sdev,
147 struct snd_pcm_substream *substream)
148{
149 struct snd_soc_pcm_runtime *rtd = substream->private_data;
21#include "../ops.h"
22#include "hda.h"
23
24#define SDnFMT_BASE(x) ((x) << 14)
25#define SDnFMT_MULT(x) (((x) - 1) << 11)
26#define SDnFMT_DIV(x) (((x) - 1) << 8)
27#define SDnFMT_BITS(x) ((x) << 4)
28#define SDnFMT_CHAN(x) ((x) << 0)

--- 114 unchanged lines hidden (view full) ---

143
144 return hda_dsp_stream_trigger(sdev, stream, cmd);
145}
146
147snd_pcm_uframes_t hda_dsp_pcm_pointer(struct snd_sof_dev *sdev,
148 struct snd_pcm_substream *substream)
149{
150 struct snd_soc_pcm_runtime *rtd = substream->private_data;
151 struct snd_soc_component *scomp = sdev->component;
150 struct hdac_stream *hstream = substream->runtime->private_data;
151 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
152 struct snd_sof_pcm *spcm;
153 snd_pcm_uframes_t pos;
154
152 struct hdac_stream *hstream = substream->runtime->private_data;
153 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
154 struct snd_sof_pcm *spcm;
155 snd_pcm_uframes_t pos;
156
155 spcm = snd_sof_find_spcm_dai(sdev, rtd);
157 spcm = snd_sof_find_spcm_dai(scomp, rtd);
156 if (!spcm) {
157 dev_warn_ratelimited(sdev->dev, "warn: can't find PCM with DAI ID %d\n",
158 rtd->dai_link->id);
159 return 0;
160 }
161
162 if (hda && !hda->no_ipc_position) {
163 /* read position from IPC position */

--- 85 unchanged lines hidden ---
158 if (!spcm) {
159 dev_warn_ratelimited(sdev->dev, "warn: can't find PCM with DAI ID %d\n",
160 rtd->dai_link->id);
161 return 0;
162 }
163
164 if (hda && !hda->no_ipc_position) {
165 /* read position from IPC position */

--- 85 unchanged lines hidden ---