Commit d2f916aa authored by Jon Medhurst (Tixy)'s avatar Jon Medhurst (Tixy) Committed by Mark Brown

ASoC: dwc: Ensure i2s_reg_comp{1,2} is always initialised

In the case that the driver is configured from device-tree
i2s_reg_comp1 and i2s_reg_comp2 aren't initialised, breaking the driver.
Fix this by unconditionally setting these values before checking for quirks.

Fixes: a242cac1 ("ASoC: dwc: add quirk to override COMP_PARAM_1 register")
Signed-off-by: default avatarJon Medhurst <tixy@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 92e963f5
...@@ -645,6 +645,8 @@ static int dw_i2s_probe(struct platform_device *pdev) ...@@ -645,6 +645,8 @@ static int dw_i2s_probe(struct platform_device *pdev)
dev->dev = &pdev->dev; dev->dev = &pdev->dev;
dev->i2s_reg_comp1 = I2S_COMP_PARAM_1;
dev->i2s_reg_comp2 = I2S_COMP_PARAM_2;
if (pdata) { if (pdata) {
dev->capability = pdata->cap; dev->capability = pdata->cap;
clk_id = NULL; clk_id = NULL;
...@@ -652,9 +654,6 @@ static int dw_i2s_probe(struct platform_device *pdev) ...@@ -652,9 +654,6 @@ static int dw_i2s_probe(struct platform_device *pdev)
if (dev->quirks & DW_I2S_QUIRK_COMP_REG_OFFSET) { if (dev->quirks & DW_I2S_QUIRK_COMP_REG_OFFSET) {
dev->i2s_reg_comp1 = pdata->i2s_reg_comp1; dev->i2s_reg_comp1 = pdata->i2s_reg_comp1;
dev->i2s_reg_comp2 = pdata->i2s_reg_comp2; dev->i2s_reg_comp2 = pdata->i2s_reg_comp2;
} else {
dev->i2s_reg_comp1 = I2S_COMP_PARAM_1;
dev->i2s_reg_comp2 = I2S_COMP_PARAM_2;
} }
ret = dw_configure_dai_by_pd(dev, dw_i2s_dai, res, pdata); ret = dw_configure_dai_by_pd(dev, dw_i2s_dai, res, pdata);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment