]> www.infradead.org Git - users/willy/xarray.git/commit
dmaengine: dw: Simplify max-burst calculation procedure
authorSerge Semin <fancer.lancer@gmail.com>
Fri, 2 Aug 2024 07:50:50 +0000 (10:50 +0300)
committerVinod Koul <vkoul@kernel.org>
Mon, 5 Aug 2024 16:37:47 +0000 (22:07 +0530)
commitd8fa0802f63502c0409d02c6b701d51841a6f1bd
tree3756cf68fc493effdd218ccccdb45e3e197eb846
parent3acb301d33749a8974e61ecda16a5f5441fc9628
dmaengine: dw: Simplify max-burst calculation procedure

In order to have a more coherent DW AHB DMA slave configuration method -
dwc_config() - let's simplify the source and destination channel max-burst
calculation procedure:

1. Create the max-burst verification method as it has been just done for
the memory and peripheral address widths. Thus the dwc_config() method
will turn to a set of the verification methods execution.

2. Since both the generic DW AHB DMA and Intel iDMA 32-bit engines support
the power-of-2 bursts only, then the specified by the client driver
max-burst values can be converted to being power-of-2 right in the
max-burst verification method.

3. Since max-burst encoded value is required on the CTL_LO fields
calculation stage, the encode_maxburst() callback can be easily dropped
from the dw_dma structure meanwhile the encoding procedure will be
executed right in the CTL_LO register value calculation.

Thus the update will provide the next positive effects: the internal
DMA-slave config structure will contain only the real DMA-transfer config
values, which will be encoded to the DMA-controller register fields only
when it's required on the buffer mapping; the redundant encode_maxburst()
callback will be dropped simplifying the internal HW-abstraction API;
dwc_config() will look more readable executing the verification functions
one-by-one.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Acked-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240802075100.6475-6-fancer.lancer@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dw/core.c
drivers/dma/dw/dw.c
drivers/dma/dw/idma32.c
drivers/dma/dw/regs.h