@@ -23,6 +23,8 @@
#define DRV_NAME "rockchip-i2s"
+#define ROCKCHIP_I2S_BROKEN_BURST_LEN (1<<0) /* broken burst len */
+
struct rk_i2s_dev {
struct device *dev;
@@ -418,6 +420,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
struct rk_i2s_dev *i2s;
struct resource *res;
void __iomem *regs;
+ int dma_quirk;
int ret;
i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL);
@@ -489,6 +492,24 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
goto err_pcm_register;
}
+ dma_quirk = snd_dmaengine_pcm_get_quirks(&pdev->dev);
+ switch (dma_quirk) {
+ case ROCKCHIP_I2S_BROKEN_BURST_LEN:
+ /*
+ * Unfortunately, we find broken burst len here,
+ * just have to limit maxburst to ONE in order to avoid
+ * non-multiple burst len access fail the dmaengine if
+ * it can't support flush peripheral function.
+ */
+ i2s->playback_dma_data.maxburst = 1;
+ i2s->capture_dma_data.maxburst = 1;
+ break;
+ default:
+ dev_info(&pdev->dev, "Default no dma_quirk!\n");
+ break;
+ }
+
return 0;
err_pcm_register:
--
2.3.7