• Serge Semin's avatar
    dmaengine: dw: Simplify max-burst calculation procedure · d8fa0802
    Serge Semin authored
    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: default avatarSerge Semin <fancer.lancer@gmail.com>
    Acked-by: default avatarAndy Shevchenko <andy@kernel.org>
    Link: https://lore.kernel.org/r/20240802075100.6475-6-fancer.lancer@gmail.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    d8fa0802
idma32.c 7.44 KB