Skip to content

Commit 49d7948

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: SOF: Intel: Expose SDnFMT helpers
Hda stream is setup in similar fashion for compress as it is for pcm operations. To reuse existing code in compress path, expose SDnFMT helper routines. Signed-off-by: Cezary Rojewski <[email protected]> Acked-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e145e9a commit 49d7948

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define SDnFMT_BITS(x) ((x) << 4)
2828
#define SDnFMT_CHAN(x) ((x) << 0)
2929

30-
static inline u32 get_mult_div(struct snd_sof_dev *sdev, int rate)
30+
u32 hda_dsp_get_mult_div(struct snd_sof_dev *sdev, int rate)
3131
{
3232
switch (rate) {
3333
case 8000:
@@ -61,7 +61,7 @@ static inline u32 get_mult_div(struct snd_sof_dev *sdev, int rate)
6161
}
6262
};
6363

64-
static inline u32 get_bits(struct snd_sof_dev *sdev, int sample_bits)
64+
u32 hda_dsp_get_bits(struct snd_sof_dev *sdev, int sample_bits)
6565
{
6666
switch (sample_bits) {
6767
case 8:
@@ -95,8 +95,8 @@ int hda_dsp_pcm_hw_params(struct snd_sof_dev *sdev,
9595
u32 size, rate, bits;
9696

9797
size = params_buffer_bytes(params);
98-
rate = get_mult_div(sdev, params_rate(params));
99-
bits = get_bits(sdev, params_width(params));
98+
rate = hda_dsp_get_mult_div(sdev, params_rate(params));
99+
bits = hda_dsp_get_bits(sdev, params_width(params));
100100

101101
hstream->substream = substream;
102102

sound/soc/sof/intel/hda.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@ void hda_dsp_d0i3_work(struct work_struct *work);
502502
/*
503503
* DSP PCM Operations.
504504
*/
505+
u32 hda_dsp_get_mult_div(struct snd_sof_dev *sdev, int rate);
506+
u32 hda_dsp_get_bits(struct snd_sof_dev *sdev, int sample_bits);
505507
int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
506508
struct snd_pcm_substream *substream);
507509
int hda_dsp_pcm_close(struct snd_sof_dev *sdev,

0 commit comments

Comments
 (0)