59 lines
2.1 KiB
Diff
59 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Hardik T Shah <hardik.t.shah@intel.com>
|
|
Date: Sat, 23 Apr 2016 18:15:06 +0530
|
|
Subject: [PATCH] Intel:ASoc: Handle SDW PCM hw_params for PDM.
|
|
|
|
Bus driver needs to be configured differently for
|
|
the PCM and PDM interface between master and slave.
|
|
Handle the PDM case.
|
|
|
|
Currently upscale factor and the BPS should come from
|
|
either NHLT or XML. Need to figure out from poland team
|
|
from where its coming.
|
|
|
|
Change-Id: Ic2e6080f0502f9212ab4256aecda18880248d16b
|
|
Signed-off-by: Hardik T Shah <hardik.t.shah@intel.com>
|
|
Reviewed-on:
|
|
---
|
|
sound/soc/intel/skylake/skl-sdw-pcm.c | 15 ++++++++++++++-
|
|
1 file changed, 14 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/sound/soc/intel/skylake/skl-sdw-pcm.c b/sound/soc/intel/skylake/skl-sdw-pcm.c
|
|
index 90a11f4..af8d117 100644
|
|
--- a/sound/soc/intel/skylake/skl-sdw-pcm.c
|
|
+++ b/sound/soc/intel/skylake/skl-sdw-pcm.c
|
|
@@ -113,6 +113,7 @@ int cnl_sdw_hw_params(struct snd_pcm_substream *substream,
|
|
int ret = 0;
|
|
struct skl_pipe_params p_params = {0};
|
|
struct skl_module_cfg *m_cfg;
|
|
+ int upscale_factor = 16;
|
|
|
|
p_params.s_fmt = snd_pcm_format_width(params_format(params));
|
|
p_params.ch = params_channels(params);
|
|
@@ -145,9 +146,21 @@ int cnl_sdw_hw_params(struct snd_pcm_substream *substream,
|
|
}
|
|
m_cfg->sdw_stream_num = dma->port->pdi_stream->sdw_pdi_num;
|
|
stream_config.frame_rate = params_rate(params);
|
|
+ /* TODO: Get the multiplication factor from NHLT or the XML
|
|
+ * to decide with Poland team from where to get it
|
|
+ */
|
|
+ if (dma->stream_type == CNL_SDW_PDI_TYPE_PDM)
|
|
+ stream_config.frame_rate *= upscale_factor;
|
|
stream_config.channel_count = channels;
|
|
- stream_config.bps =
|
|
+ /* TODO: Get the PDM BPS from NHLT or the XML
|
|
+ * to decide with Poland team from where to get it
|
|
+ */
|
|
+ if (dma->stream_type == CNL_SDW_PDI_TYPE_PDM)
|
|
+ stream_config.bps = 1;
|
|
+ else
|
|
+ stream_config.bps =
|
|
snd_pcm_format_width(params_format(params));
|
|
+
|
|
stream_config.direction = direction;
|
|
ret = sdw_config_stream(dma->mstr, NULL, &stream_config,
|
|
dma->stream_tag);
|
|
--
|
|
https://clearlinux.org
|
|
|