Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Vijendar Mukunda and committed by
Mark Brown
286345ee 2ea659a9

+7
+1
include/sound/designware_i2s.h
··· 47 47 48 48 #define DW_I2S_QUIRK_COMP_REG_OFFSET (1 << 0) 49 49 #define DW_I2S_QUIRK_COMP_PARAM1 (1 << 1) 50 + #define DW_I2S_QUIRK_16BIT_IDX_OVERRIDE (1 << 2) 50 51 unsigned int quirks; 51 52 unsigned int i2s_reg_comp1; 52 53 unsigned int i2s_reg_comp2;
+6
sound/soc/dwc/dwc-i2s.c
··· 496 496 idx = COMP1_TX_WORDSIZE_0(comp1); 497 497 if (WARN_ON(idx >= ARRAY_SIZE(formats))) 498 498 return -EINVAL; 499 + if (dev->quirks & DW_I2S_QUIRK_16BIT_IDX_OVERRIDE) 500 + idx = 1; 499 501 dw_i2s_dai->playback.channels_min = MIN_CHANNEL_NUM; 500 502 dw_i2s_dai->playback.channels_max = 501 503 1 << (COMP1_TX_CHANNELS(comp1) + 1); ··· 510 508 idx = COMP2_RX_WORDSIZE_0(comp2); 511 509 if (WARN_ON(idx >= ARRAY_SIZE(formats))) 512 510 return -EINVAL; 511 + if (dev->quirks & DW_I2S_QUIRK_16BIT_IDX_OVERRIDE) 512 + idx = 1; 513 513 dw_i2s_dai->capture.channels_min = MIN_CHANNEL_NUM; 514 514 dw_i2s_dai->capture.channels_max = 515 515 1 << (COMP1_RX_CHANNELS(comp1) + 1); ··· 547 543 if (ret < 0) 548 544 return ret; 549 545 546 + if (dev->quirks & DW_I2S_QUIRK_16BIT_IDX_OVERRIDE) 547 + idx = 1; 550 548 /* Set DMA slaves info */ 551 549 dev->play_dma_data.pd.data = pdata->play_dma_data; 552 550 dev->capture_dma_data.pd.data = pdata->capture_dma_data;