From patchwork Thu Nov 10 15:17:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 9421195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 032B760512 for ; Thu, 10 Nov 2016 15:18:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE52B29685 for ; Thu, 10 Nov 2016 15:18:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E330D2976C; Thu, 10 Nov 2016 15:18:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DB7B2976B for ; Thu, 10 Nov 2016 15:18:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934001AbcKJPSf (ORCPT ); Thu, 10 Nov 2016 10:18:35 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:58852 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933884AbcKJPSf (ORCPT ); Thu, 10 Nov 2016 10:18:35 -0500 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGF030Y3MIT4GA0@mailout1.samsung.com>; Fri, 11 Nov 2016 00:18:32 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-26-58248fc802f5 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 59.CC.25310.8CF84285; Fri, 11 Nov 2016 00:18:32 +0900 (KST) Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OGF00HZZMI40A50@mmp2.samsung.com>; Fri, 11 Nov 2016 00:18:32 +0900 (KST) From: Sylwester Nawrocki To: krzk@kernel.org, vinod.koul@intel.com, kgene@kernel.org Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, broonie@kernel.org, ckeepax@opensource.wolfsonmicro.com, ym0914@gmail.com, arnd@arndb.de, javier@osg.samsung.com, andi.shyti@samsung.com, sbkim73@samsung.com, Sylwester Nawrocki Subject: [PATCH 1/8] dma: pl08x: Add support for the DMA slave map Date: Thu, 10 Nov 2016 16:17:49 +0100 Message-id: <1478791076-19528-2-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1478791076-19528-1-git-send-email-s.nawrocki@samsung.com> References: <1478791076-19528-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsVy+t9jQd0T/SoRBltuG1tsP/KM1eLvpGPs FlMfPmGz+DflBrvF6ql/WS3evF3DZNH/+DWzxfnzG9gtNj2+xmox4/w+JovDb9pZLS6u+MJk 8bJvP4tFz4b/rA58Hr9/TWL02DnrLrvH4j0vmTw2repk89i8pN7j5cTfbB5b+oHifVtWMXp8 3iQXwBnlZpORmpiSWqSQmpecn5KZl26rFBripmuhpJCXmJtqqxSh6xsSpKRQlphTCuQZGaAB B+cA92AlfbsEt4y25+vZCu4JVdxdfJmtgfEgfxcjJ4eEgInE8fc/2SBsMYkL99YD2VwcQgKz GCWWr53LDOH8YpSY/novI0gVm4ChRO/RPjBbRMBaoufWHSaQImaBXUwS2zb3M4EkhAWcJL40 r2IHsVkEVCW+bljFCmLzCrhJrH/wBmqdnMTJY5PB4pwC7hJ7d2wBs4WAan4vW8kygZF3ASPD KkaJ1ILkguKk9FzDvNRyveLE3OLSvHS95PzcTYzgGHomtYPx4C73Q4wCHIxKPLwSnSoRQqyJ ZcWVuYcYJTiYlUR4D/QChXhTEiurUovy44tKc1KLDzGaAh02kVlKNDkfGN95JfGGJuYm5sYG FuaWliZGSuK8jbOfhQsJpCeWpGanphakFsH0MXFwSjUwOlg95QxhXF7wSVW5Y1Xf8u+mSta7 Ux8emiCiuLYmd3bg3Xdtoctmz3Gtv3sv80hDDudJt3WsdpPuSk36seaSmdxKi2TuK0n7rFar M6QEnG3gb8hZebvk3FzZ5Pr73YpbytffKzuzoi4+99icmfwc83gcb4SGBd5U2P5p4vKkNn7T Y9NaZh1jU2Ipzkg01GIuKk4EAFBe8aW3AgAA X-MTR: 20000000000000000@CPGS Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support for the new channel request API introduced in commit a8135d0d79e9d0ad3a4ff494fceeaae83 "dmaengine: core: Introduce new, universal API to request a channel". param field of struct dma_slave_map type entries in the platform data structure should be pointing to struct pl08x_channel_data of related DMA channel. Signed-off-by: Sylwester Nawrocki --- drivers/dma/amba-pl08x.c | 11 +++++++++++ include/linux/amba/pl08x.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 939a7c3..0b7c6ce 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -1793,6 +1793,13 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id) } EXPORT_SYMBOL_GPL(pl08x_filter_id); +static bool pl08x_filter_fn(struct dma_chan *chan, void *chan_id) +{ + struct pl08x_dma_chan *plchan = to_pl08x_chan(chan); + + return plchan->cd == chan_id; +} + /* * Just check that the device is there and active * TODO: turn this bit on/off depending on the number of physical channels @@ -2307,6 +2314,10 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id) ret = -EINVAL; goto out_no_platdata; } + } else { + pl08x->slave.filter.map = pl08x->pd->slave_map; + pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len; + pl08x->slave.filter.fn = pl08x_filter_fn; } /* By default, AHB1 only. If dualmaster, from platform */ diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 27e9ec8..5308eae 100644 --- a/include/linux/amba/pl08x.h +++ b/include/linux/amba/pl08x.h @@ -84,6 +84,8 @@ struct pl08x_channel_data { * running any DMA transfer and multiplexing can be recycled * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2 * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 + * @slave_map: DMA slave matching table + * @slave_map_len: number of elements in @slave_map */ struct pl08x_platform_data { struct pl08x_channel_data *slave_channels; @@ -93,6 +95,8 @@ struct pl08x_platform_data { void (*put_xfer_signal)(const struct pl08x_channel_data *, int); u8 lli_buses; u8 mem_buses; + const struct dma_slave_map *slave_map; + int slave_map_len; }; #ifdef CONFIG_AMBA_PL08X