Skip to content

Commit 57ada38

Browse files
ujfalusiplbossart
authored andcommitted
fixup! ASoC: SOF: Intel: hda: Add support for DSPless mode
The rate and bits only used in DSP mode for the format_val calculation only By moving them locally under the if() branch the size stands out as not needed variable, remove it as well. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent e65a142 commit 57ada38

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

sound/soc/sof/intel/hda-pcm.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ int hda_dsp_pcm_hw_params(struct snd_sof_dev *sdev,
101101
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
102102
struct snd_dma_buffer *dmab;
103103
int ret;
104-
u32 size, rate, bits;
105-
106-
size = params_buffer_bytes(params);
107-
rate = hda_dsp_get_mult_div(sdev, params_rate(params));
108-
bits = hda_dsp_get_bits(sdev, params_width(params));
109104

110105
hstream->substream = substream;
111106

@@ -115,10 +110,14 @@ int hda_dsp_pcm_hw_params(struct snd_sof_dev *sdev,
115110
* Use the codec required format val (which is link_bps adjusted) when
116111
* the DSP is not in use
117112
*/
118-
if (!sdev->dspless_mode_selected)
113+
if (!sdev->dspless_mode_selected) {
114+
u32 rate = hda_dsp_get_mult_div(sdev, params_rate(params));
115+
u32 bits = hda_dsp_get_bits(sdev, params_width(params));
116+
119117
hstream->format_val = rate | bits | (params_channels(params) - 1);
118+
}
120119

121-
hstream->bufsize = size;
120+
hstream->bufsize = params_buffer_bytes(params);
122121
hstream->period_bytes = params_period_bytes(params);
123122
hstream->no_period_wakeup =
124123
(params->info & SNDRV_PCM_INFO_NO_PERIOD_WAKEUP) &&

0 commit comments

Comments
 (0)