Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20cadcb4 authored by Ludovic Desroches's avatar Ludovic Desroches Committed by Vinod Koul
Browse files

dmaengine: at_xdmac: fix bug about channel configuration



When using descriptor view 2 or higher, we don't write the configuration
into AT_XDMAC_CC register because this configuration will be fetch from
the descriptor. Unfortunately, the PROT bit is not updated with this
method, we have to do it manually before enabling the channel.

Signed-off-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 5dd90e5b
Loading
Loading
Loading
Loading
+10 −9
Original line number Original line Diff line number Diff line
@@ -359,18 +359,19 @@ static void at_xdmac_start_xfer(struct at_xdmac_chan *atchan,
	 * descriptor view 2 since some fields of the configuration register
	 * descriptor view 2 since some fields of the configuration register
	 * depend on transfer size and src/dest addresses.
	 * depend on transfer size and src/dest addresses.
	 */
	 */
	if (at_xdmac_chan_is_cyclic(atchan)) {
	if (at_xdmac_chan_is_cyclic(atchan))
		reg = AT_XDMAC_CNDC_NDVIEW_NDV1;
		reg = AT_XDMAC_CNDC_NDVIEW_NDV1;
		at_xdmac_chan_write(atchan, AT_XDMAC_CC, first->lld.mbr_cfg);
	else if (first->lld.mbr_ubc & AT_XDMAC_MBR_UBC_NDV3)
	} else if (first->lld.mbr_ubc & AT_XDMAC_MBR_UBC_NDV3) {
		reg = AT_XDMAC_CNDC_NDVIEW_NDV3;
		reg = AT_XDMAC_CNDC_NDVIEW_NDV3;
	} else {
	else
		reg = AT_XDMAC_CNDC_NDVIEW_NDV2;
	/*
	/*
		 * No need to write AT_XDMAC_CC reg, it will be done when the
	 * Even if the register will be updated from the configuration in the
		 * descriptor is fecthed.
	 * descriptor when using view 2 or higher, the PROT bit won't be set
	 * properly. This bit can be modified only by using the channel
	 * configuration register.
	 */
	 */
		reg = AT_XDMAC_CNDC_NDVIEW_NDV2;
	at_xdmac_chan_write(atchan, AT_XDMAC_CC, first->lld.mbr_cfg);
	}


	reg |= AT_XDMAC_CNDC_NDDUP
	reg |= AT_XDMAC_CNDC_NDDUP
	       | AT_XDMAC_CNDC_NDSUP
	       | AT_XDMAC_CNDC_NDSUP