aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijendar Mukunda <Vijendar.Mukunda@amd.com>2017-06-23 12:35:00 -0400
committerMark Brown <broonie@kernel.org>2017-06-28 14:01:12 -0400
commit286345eef97ea8f4ea223410f025ed35f265e506 (patch)
treecac7c29004d48b900a14b3c49adaa8a7832fb39f
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff)
ASoC: dwc: Added a quirk DW_I2S_QUIRK_16BIT_IDX_OVERRIDE to dwc driver
Added quirk DW_I2S_QUIRK_16BIT_IDX_OVERRIDE to Designware driver. This quirk will set idx value to 1. By setting this quirk, it will override supported format as 16 bit resolution and bus width as 2 Bytes. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/designware_i2s.h1
-rw-r--r--sound/soc/dwc/dwc-i2s.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/sound/designware_i2s.h b/include/sound/designware_i2s.h
index 5681855396c4..830f5caa915c 100644
--- a/include/sound/designware_i2s.h
+++ b/include/sound/designware_i2s.h
@@ -47,6 +47,7 @@ struct i2s_platform_data {
47 47
48 #define DW_I2S_QUIRK_COMP_REG_OFFSET (1 << 0) 48 #define DW_I2S_QUIRK_COMP_REG_OFFSET (1 << 0)
49 #define DW_I2S_QUIRK_COMP_PARAM1 (1 << 1) 49 #define DW_I2S_QUIRK_COMP_PARAM1 (1 << 1)
50 #define DW_I2S_QUIRK_16BIT_IDX_OVERRIDE (1 << 2)
50 unsigned int quirks; 51 unsigned int quirks;
51 unsigned int i2s_reg_comp1; 52 unsigned int i2s_reg_comp1;
52 unsigned int i2s_reg_comp2; 53 unsigned int i2s_reg_comp2;
diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c
index 9c46e4112026..916067638180 100644
--- a/sound/soc/dwc/dwc-i2s.c
+++ b/sound/soc/dwc/dwc-i2s.c
@@ -496,6 +496,8 @@ static int dw_configure_dai(struct dw_i2s_dev *dev,
496 idx = COMP1_TX_WORDSIZE_0(comp1); 496 idx = COMP1_TX_WORDSIZE_0(comp1);
497 if (WARN_ON(idx >= ARRAY_SIZE(formats))) 497 if (WARN_ON(idx >= ARRAY_SIZE(formats)))
498 return -EINVAL; 498 return -EINVAL;
499 if (dev->quirks & DW_I2S_QUIRK_16BIT_IDX_OVERRIDE)
500 idx = 1;
499 dw_i2s_dai->playback.channels_min = MIN_CHANNEL_NUM; 501 dw_i2s_dai->playback.channels_min = MIN_CHANNEL_NUM;
500 dw_i2s_dai->playback.channels_max = 502 dw_i2s_dai->playback.channels_max =
501 1 << (COMP1_TX_CHANNELS(comp1) + 1); 503 1 << (COMP1_TX_CHANNELS(comp1) + 1);
@@ -508,6 +510,8 @@ static int dw_configure_dai(struct dw_i2s_dev *dev,
508 idx = COMP2_RX_WORDSIZE_0(comp2); 510 idx = COMP2_RX_WORDSIZE_0(comp2);
509 if (WARN_ON(idx >= ARRAY_SIZE(formats))) 511 if (WARN_ON(idx >= ARRAY_SIZE(formats)))
510 return -EINVAL; 512 return -EINVAL;
513 if (dev->quirks & DW_I2S_QUIRK_16BIT_IDX_OVERRIDE)
514 idx = 1;
511 dw_i2s_dai->capture.channels_min = MIN_CHANNEL_NUM; 515 dw_i2s_dai->capture.channels_min = MIN_CHANNEL_NUM;
512 dw_i2s_dai->capture.channels_max = 516 dw_i2s_dai->capture.channels_max =
513 1 << (COMP1_RX_CHANNELS(comp1) + 1); 517 1 << (COMP1_RX_CHANNELS(comp1) + 1);
@@ -543,6 +547,8 @@ static int dw_configure_dai_by_pd(struct dw_i2s_dev *dev,
543 if (ret < 0) 547 if (ret < 0)
544 return ret; 548 return ret;
545 549
550 if (dev->quirks & DW_I2S_QUIRK_16BIT_IDX_OVERRIDE)
551 idx = 1;
546 /* Set DMA slaves info */ 552 /* Set DMA slaves info */
547 dev->play_dma_data.pd.data = pdata->play_dma_data; 553 dev->play_dma_data.pd.data = pdata->play_dma_data;
548 dev->capture_dma_data.pd.data = pdata->capture_dma_data; 554 dev->capture_dma_data.pd.data = pdata->capture_dma_data;