diff mbox

[RFC,08/14] ASoC: qcom: add dma channel control offset to variant data

Message ID 1430414252-11210-1-git-send-email-srinivas.kandagatla@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Srinivas Kandagatla April 30, 2015, 5:17 p.m. UTC
This patch adds ability to pass dma channel control bits start offset, which
differ in differnet qcom SOCs. On apq8016 dma channel control bits start
after an offset of 1.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/qcom/lpass-platform.c | 2 +-
 sound/soc/qcom/lpass.h          | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Kenneth Westfield May 2, 2015, 11:59 p.m. UTC | #1
On Thu, Apr 30, 2015 at 06:17:32PM +0100, Srinivas Kandagatla wrote:
> This patch adds ability to pass dma channel control bits start offset, which
> differ in differnet qcom SOCs. On apq8016 dma channel control bits start
> after an offset of 1.

Alot of the SOCs have similar small differences in the LPASS register
map.  For now, this is fine, but we will probably want to add some
system of quirks to handle these differences; as more SOCs drivers
are implemented.

>  sound/soc/qcom/lpass-platform.c | 2 +-
>  sound/soc/qcom/lpass.h          | 6 ++++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
Srinivas Kandagatla May 5, 2015, 7:16 a.m. UTC | #2
On 03/05/15 00:59, Kenneth Westfield wrote:
> On Thu, Apr 30, 2015 at 06:17:32PM +0100, Srinivas Kandagatla wrote:
>> This patch adds ability to pass dma channel control bits start offset, which
>> differ in differnet qcom SOCs. On apq8016 dma channel control bits start
>> after an offset of 1.
>
> Alot of the SOCs have similar small differences in the LPASS register
> map.  For now, this is fine, but we will probably want to add some
> system of quirks to handle these differences; as more SOCs drivers
> are implemented.
>
Yes, I agree, only reason for adding it in to variant data could be that 
I was looking at drivers/mmc/host/mmmci.c file a lot :-)

--srini
diff mbox

Patch

diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index fc08891..8ab0ac1 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -91,7 +91,7 @@  static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream,
 	unsigned int channels = params_channels(params);
 	unsigned int regval;
 	int bitwidth;
-	int ret, rdma_port = pcm_data->i2s_port;
+	int ret, rdma_port = pcm_data->i2s_port + v->rdmactl_audif_start;
 
 	bitwidth = snd_pcm_format_width(format);
 	if (bitwidth < 0) {
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 301f784..e07ed52 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -61,6 +61,12 @@  struct lpass_variant {
 	u32	rdma_reg_stride;
 	u32	rdma_channels;
 
+	/**
+	 * on SOCs like APQ8016 the channel control bits start
+	 * at different offset to ipq806x
+	 **/
+	u32	rdmactl_audif_start;
+
 	/* OCR clock is not present in SOCs like APQ8016 */
 	bool	no_osr_clk;
 	/* SOC specific intialization like clocks */