Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756030AbbLAJ7b (ORCPT ); Tue, 1 Dec 2015 04:59:31 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:41855 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755990AbbLAJ70 (ORCPT ); Tue, 1 Dec 2015 04:59:26 -0500 Subject: Re: [RFC v02 04/15] dmaengine: edma: Add support for DMA filter mapping to slave devices To: Arnd Bergmann References: <1448891145-10766-1-git-send-email-peter.ujfalusi@ti.com> <1448891145-10766-5-git-send-email-peter.ujfalusi@ti.com> <7490116.jHcmUxB3Rf@wuerfel> CC: , , , , , , , , From: Peter Ujfalusi Message-ID: <565D6F5D.3060603@ti.com> Date: Tue, 1 Dec 2015 11:58:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <7490116.jHcmUxB3Rf@wuerfel> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1510 Lines: 46 On 11/30/2015 04:11 PM, Arnd Bergmann wrote: > On Monday 30 November 2015 15:45:34 Peter Ujfalusi wrote: >> @@ -2428,6 +2436,22 @@ bool edma_filter_fn(struct dma_chan *chan, void *param) >> } >> EXPORT_SYMBOL(edma_filter_fn); >> >> +static bool edma_filter_for_map(struct dma_chan *chan, void *param) >> +{ >> + bool match = false; >> + >> + if (chan->device->dev->driver == &edma_driver.driver) { >> + struct edma_chan *echan = to_edma_chan(chan); >> + unsigned ch_req = (unsigned)param; >> + if (ch_req == echan->ch_num) { >> + /* The channel is going to be used as HW synchronized */ >> + echan->hw_triggered = true; >> + match = true; >> + } >> + } >> + return match; >> +} >> + >> static int edma_init(void) >> > > I don't see the difference between edma_filter_fn and edma_filter_for_map. > Why do you need both? edma_filter_fn: unsigned ch_req = *(unsigned *)param; edma_filter_for_map: unsigned ch_req = (unsigned)param; If I want to reuse the edma_filter_fn, I would need an unsigned array for the eDMA event numbers in the board files to be able to provide the pointer to each of them. -- P?ter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/