dmaengine: hsu: set maximum allowed segment size for DMA
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 18 Mar 2016 12:26:36 +0000 (14:26 +0200)
committerVinod Koul <vinod.koul@intel.com>
Mon, 4 Apr 2016 16:42:00 +0000 (09:42 -0700)
This tells, for example, IOMMU what the maximum size of a segment
the DMA controller can send.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/hsu/hsu.c
drivers/dma/hsu/hsu.h

index 1817b7bc9576ed85b26b0b796d28c4adf53b1c35..59d1e7c6fd0f131547b8a87dd6212042e47c04e0 100644 (file)
@@ -417,6 +417,8 @@ int hsu_dma_probe(struct hsu_dma_chip *chip)
 
        hsu->dma.dev = chip->dev;
 
+       dma_set_max_seg_size(hsu->dma.dev, HSU_CH_DxTSR_MASK);
+
        ret = dma_async_device_register(&hsu->dma);
        if (ret)
                return ret;
index 578a8ee8cd054429b3e3fd6da2341b49020721cc..50a9d1bda2534355fdae33cafe6a290d432aff7c 100644 (file)
 #define HSU_CH_DCR_CHEI                BIT(23)
 #define HSU_CH_DCR_CHTOI(x)    BIT(24 + (x))
 
+/* Bits in HSU_CH_DxTSR */
+#define HSU_CH_DxTSR_MASK      GENMASK(15, 0)
+#define HSU_CH_DxTSR_TSR(x)    ((x) & HSU_CH_DxTSR_MASK)
+
 struct hsu_dma_sg {
        dma_addr_t addr;
        unsigned int len;