Skip to content

Commit 309e985

Browse files
zhichao.liubroonie
authored andcommitted
spi: mt65xx: Add dma max segment size declaration
Add spi dma max segment size declaration according to spi hardware capability, instead of 64KB by system default setting, to improve bus bandwidth for mass data transmission. Signed-off-by: zhichao.liu <zhichao.liu@mediatek.com> Link: https://lore.kernel.org/r/20220927083248.25404-1-zhichao.liu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 048f71f commit 309e985

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/spi/spi-mt65xx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,11 @@ static int mtk_spi_probe(struct platform_device *pdev)
11841184
if (!dev->dma_mask)
11851185
dev->dma_mask = &dev->coherent_dma_mask;
11861186

1187+
if (mdata->dev_comp->ipm_design)
1188+
dma_set_max_seg_size(dev, SZ_16M);
1189+
else
1190+
dma_set_max_seg_size(dev, SZ_256K);
1191+
11871192
ret = devm_request_irq(dev, irq, mtk_spi_interrupt,
11881193
IRQF_TRIGGER_NONE, dev_name(dev), master);
11891194
if (ret)

0 commit comments

Comments
 (0)