From patchwork Thu Dec 22 12:11:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9484721 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 BC530601D2 for ; Thu, 22 Dec 2016 12:12:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EB1D28113 for ; Thu, 22 Dec 2016 12:12:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93AAD2842C; Thu, 22 Dec 2016 12:12:06 +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 2D67028113 for ; Thu, 22 Dec 2016 12:12:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938800AbcLVMMC (ORCPT ); Thu, 22 Dec 2016 07:12:02 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:51457 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938739AbcLVML7 (ORCPT ); Thu, 22 Dec 2016 07:11:59 -0500 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OIL00V565VWXOD0@mailout1.samsung.com>; Thu, 22 Dec 2016 21:11:56 +0900 (KST) Received: from epsmges1p1.samsung.com (unknown [182.195.42.53]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20161222121156epcas1p476aac0f00e69067a45f3bf4aa464e10f~Skt_so3De1702417024epcas1p4p; Thu, 22 Dec 2016 12:11:56 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 9E.F1.05883.C03CB585; Thu, 22 Dec 2016 21:11:56 +0900 (KST) Received: from epcpsbgm1new.samsung.com (u26.gpu120.samsung.co.kr [203.254.230.26]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20161222121155epcas1p2021796c83d5c50fc287bdc7c37e50573~Skt9oitea1834818348epcas1p2B; Thu, 22 Dec 2016 12:11:55 +0000 (GMT) X-AuditID: b6c32a35-f799b6d0000016fb-42-585bc30ca6ed Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 58.A8.28252.B03CB585; Thu, 22 Dec 2016 21:11:55 +0900 (KST) Received: from AMDC2765.digital.local ([106.116.147.25]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OIL007QI5VFOVA0@mmp2.samsung.com>; Thu, 22 Dec 2016 21:11:55 +0900 (KST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Cc: Marek Szyprowski , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Vinod Koul , Ulf Hansson , "Rafael J. Wysocki" , Inki Dae Subject: [PATCH 2/3] dmaengine: Forward slave device pointer to of_xlate callback Date: Thu, 22 Dec 2016 13:11:28 +0100 Message-id: <1482408689-21971-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1482408689-21971-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOIsWRmVeSWpSXmKPExsWy7bCmvi7P4egIgxertSw2zljParF66l9W i0n3J7BYnD+/gd1i0+NrrBafe48wWsw4v4/JYu2Ru+wWZ05fYrU4vjbc4mXffhYHbo/Fe14y eWxa1cnmcefaHjaPzUvqPbZcbWfx6NuyitHj8ya5APYoLpuU1JzMstQifbsEroxbK/awFSy6 wljxZNEllgbGTWsZuxg5OSQETCQm/3nGBGGLSVy4t56ti5GLQ0hgB6PE845lzBBOO5PEh/mr 2WE6phx5zQpiCwnMYZT4vbMEougXo8T9x7fAEmwChhJdb7vARokINDFKvJ2/nBHEYRZYyiSx uf0l2ChhgWCJeadmgnWwCKhK3L79GKiIg4NXwEPi27cqiG1yEiePTWYFCXMKeEos+q4EEV7E LnHyBT9IWEJAVmLTAWaIsIvE75mroO4Ulnh1fAuULS2x6t8tqC/7GSWaWrUh7BmMEufe8kLY 1hKHj18EO4ZZgE/i3dceVojxvBIdbUIQJR4SV+bvhRrjKLHn6j5GiNeBwXD67SGmCYwyCxgZ VjGKpRYU56anFhsWGOoVJ+YWl+al6yXn525iBEe/lukOxinnfA4xCnAwKvHwOkyJihBiTSwr rsw9xCjBwawkwpt7IDpCiDclsbIqtSg/vqg0J7X4EKM0B4uSOO/iRusIIYH0xJLU7NTUgtQi mCwTB6dUA2M830c1Q24li5B7zyf5n7scMf3/Ab5CmQ/BX9tbz0275vc3zk4qfE3ly/wDWR+P 1Dk++Pnga/OOmOcHz4qLn15iwG+wx29v3iW+D33f/ucoHrj6ZPLmCRUSj/abmuV8iH6caMCY 1WHJIGBseuNsYF58nT9vl7bmIe5XDW1BizvFU9MqLtd91FdiKc5INNRiLipOBADGqEr6+gIA AA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkkeLIzCtJLcpLzFFi42I5/e+xoC734egIg3ULFS02zljParF66l9W i0n3J7BYnD+/gd1i0+NrrBafe48wWsw4v4/JYu2Ru+wWZ05fYrU4vjbc4mXffhYHbo/Fe14y eWxa1cnmcefaHjaPzUvqPbZcbWfx6NuyitHj8ya5APYoN5uM1MSU1CKF1Lzk/JTMvHRbpdAQ N10LJYW8xNxUW6UIXd+QICWFssScUiDPyAANODgHuAcr6dsluGXcWrGHrWDRFcaKJ4susTQw blrL2MXIySEhYCIx5chrVghbTOLCvfVsILaQwCxGiZbeii5GLiD7F6PE2fcHwBrYBAwlut52 gRWJCDQxShz85QFSxCywnEliy/QL7CAJYYFgiXmnZoJNZRFQlbh9+zFQMwcHr4CHxLdvVRDL 5CROHpvMChLmFPCUWPRdCWKvh8TSnXMYJzDyLmBkWMUokVqQXFCclJ5rmJdarlecmFtcmpeu l5yfu4kRHA3PpHYwHtzlfohRgINRiYf3x6uoCCHWxLLiytxDjBIczEoivLkHoiOEeFMSK6tS i/Lji0pzUosPMZoCnTWRWUo0OR8YqXkl8YYm5ibmxgYW5paWJkZK4ryNs5+FCwmkJ5akZqem FqQWwfQxcXBKNTA6WilVPFo05XjrlHTXD35S6UUJXU7N/q7X904rSmUTf3h+aaJEHYfbpaA1 Afn2HKciN/5JNJl5+TfvtppFbVYuoX92RB1ob4l7w/R7nsiswwHl2SWXj3la2Qf4WtsZTbB/ lfjAP2xnYkyX+Kpr4bdvzXNvdP+UOj1v9f1fDvwnFbMftr18EqbEUpyRaKjFXFScCAByMavO nAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161222121155epcas1p2021796c83d5c50fc287bdc7c37e50573 X-Msg-Generator: CA X-Sender-IP: 203.254.230.26 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 101P X-HopCount: 7 X-CMS-RootMailID: 20161222121155epcas1p2021796c83d5c50fc287bdc7c37e50573 X-RootMTR: 20161222121155epcas1p2021796c83d5c50fc287bdc7c37e50573 References: <1482408689-21971-1-git-send-email-m.szyprowski@samsung.com> 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 Add pointer to slave struct device to of_dma_xlate to let DMA engine driver to know which slave device is using given DMA channel. This will be later used to implement non-irqsafe runtime PM for DMA engine driver. Signed-off-by: Marek Szyprowski --- drivers/dma/amba-pl08x.c | 2 +- drivers/dma/at_hdmac.c | 4 ++-- drivers/dma/at_xdmac.c | 2 +- drivers/dma/bcm2835-dma.c | 2 +- drivers/dma/coh901318.c | 2 +- drivers/dma/cppi41.c | 2 +- drivers/dma/dma-jz4780.c | 2 +- drivers/dma/dmaengine.c | 2 +- drivers/dma/dw/platform.c | 2 +- drivers/dma/edma.c | 4 ++-- drivers/dma/fsl-edma.c | 2 +- drivers/dma/img-mdc-dma.c | 2 +- drivers/dma/imx-dma.c | 2 +- drivers/dma/imx-sdma.c | 2 +- drivers/dma/k3dma.c | 2 +- drivers/dma/mmp_pdma.c | 2 +- drivers/dma/mmp_tdma.c | 2 +- drivers/dma/moxart-dma.c | 2 +- drivers/dma/mxs-dma.c | 2 +- drivers/dma/nbpfaxi.c | 2 +- drivers/dma/of-dma.c | 20 ++++++++++++-------- drivers/dma/pl330.c | 3 ++- drivers/dma/pxa_dma.c | 2 +- drivers/dma/qcom/bam_dma.c | 2 +- drivers/dma/sh/rcar-dmac.c | 2 +- drivers/dma/sh/shdma-of.c | 2 +- drivers/dma/sh/usb-dmac.c | 2 +- drivers/dma/sirf-dma.c | 2 +- drivers/dma/st_fdma.c | 2 +- drivers/dma/ste_dma40.c | 2 +- drivers/dma/stm32-dma.c | 2 +- drivers/dma/sun4i-dma.c | 2 +- drivers/dma/sun6i-dma.c | 2 +- drivers/dma/tegra20-apb-dma.c | 2 +- drivers/dma/tegra210-adma.c | 2 +- drivers/dma/xilinx/xilinx_dma.c | 2 +- drivers/dma/xilinx/zynqmp_dma.c | 2 +- drivers/dma/zx296702_dma.c | 2 +- include/linux/of_dma.h | 17 +++++++++-------- 39 files changed, 61 insertions(+), 55 deletions(-) diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 0b7c6ce..194089c 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -2059,7 +2059,7 @@ static struct dma_chan *pl08x_find_chan_id(struct pl08x_driver_data *pl08x, } static struct dma_chan *pl08x_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct pl08x_driver_data *pl08x = ofdma->of_dma_data; struct dma_chan *dma_chan; diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 1baf340..b228b26 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1788,7 +1788,7 @@ static bool at_dma_filter(struct dma_chan *chan, void *slave) } static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *of_dma) + struct of_dma *of_dma, struct device *slave) { struct dma_chan *chan; struct at_dma_chan *atchan; @@ -1847,7 +1847,7 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec, } #else static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *of_dma) + struct of_dma *of_dma, struct device *slave) { return NULL; } diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index 7d4e0bc..9ddd868 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -508,7 +508,7 @@ static inline void at_xdmac_increment_block_count(struct dma_chan *chan, } static struct dma_chan *at_xdmac_xlate(struct of_phandle_args *dma_spec, - struct of_dma *of_dma) + struct of_dma *of_dma, struct device *slave) { struct at_xdmac *atxdmac = of_dma->of_dma_data; struct at_xdmac_chan *atchan; diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index e18dc596c..e9c417a 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -877,7 +877,7 @@ static void bcm2835_dma_free(struct bcm2835_dmadev *od) MODULE_DEVICE_TABLE(of, bcm2835_dma_of_match); static struct dma_chan *bcm2835_dma_xlate(struct of_phandle_args *spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct bcm2835_dmadev *d = ofdma->of_dma_data; struct dma_chan *chan; diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c index 74794c9..dbc4fb4 100644 --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c @@ -1779,7 +1779,7 @@ static bool coh901318_filter_base_and_id(struct dma_chan *chan, void *data) } static struct dma_chan *coh901318_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct coh901318_filter_args args = { .base = ofdma->of_dma_data, diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index d5ba43a..389a227 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -932,7 +932,7 @@ static bool cpp41_dma_filter_fn(struct dma_chan *chan, void *param) }; static struct dma_chan *cppi41_dma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { int count = dma_spec->args_count; struct of_dma_filter_info *info = ofdma->of_dma_data; diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index 7373b7a..f65f716 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -707,7 +707,7 @@ static bool jz4780_dma_filter_fn(struct dma_chan *chan, void *param) } static struct dma_chan *jz4780_of_dma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct jz4780_dma_dev *jzdma = ofdma->of_dma_data; dma_cap_mask_t mask = jzdma->dma_device.cap_mask; diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 6b53526..9204ae8 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -708,7 +708,7 @@ struct dma_chan *dma_request_chan(struct device *dev, const char *name) /* If device-tree is present get slave info from here */ if (dev->of_node) - chan = of_dma_request_slave_channel(dev->of_node, name); + chan = of_dma_request_slave_channel(dev, name); /* If device was enumerated by ACPI get slave info from here */ if (has_acpi_companion(dev) && !chan) diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index b1655e4..7567b19 100644 --- a/drivers/dma/dw/platform.c +++ b/drivers/dma/dw/platform.c @@ -29,7 +29,7 @@ #define DRV_NAME "dw_dmac" static struct dma_chan *dw_dma_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct dw_dma *dw = ofdma->of_dma_data; struct dw_dma_slave slave = { diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 3879f80..d2e7d89 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c @@ -2117,7 +2117,7 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev, } static struct dma_chan *of_edma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct edma_cc *ecc = ofdma->of_dma_data; struct dma_chan *chan = NULL; @@ -2161,7 +2161,7 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev, } static struct dma_chan *of_edma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { return NULL; } diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c index 6775f2c..915aa81 100644 --- a/drivers/dma/fsl-edma.c +++ b/drivers/dma/fsl-edma.c @@ -750,7 +750,7 @@ static void fsl_edma_issue_pending(struct dma_chan *chan) } static struct dma_chan *fsl_edma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct fsl_edma_engine *fsl_edma = ofdma->of_dma_data; struct dma_chan *chan, *_chan; diff --git a/drivers/dma/img-mdc-dma.c b/drivers/dma/img-mdc-dma.c index 54db141..9a969cb 100644 --- a/drivers/dma/img-mdc-dma.c +++ b/drivers/dma/img-mdc-dma.c @@ -793,7 +793,7 @@ static irqreturn_t mdc_chan_irq(int irq, void *dev_id) } static struct dma_chan *mdc_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct mdc_dma *mdma = ofdma->of_dma_data; struct dma_chan *chan; diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index ab0fb80..b145bab 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -1032,7 +1032,7 @@ static bool imxdma_filter_fn(struct dma_chan *chan, void *param) } static struct dma_chan *imxdma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { int count = dma_spec->args_count; struct imxdma_engine *imxdma = ofdma->of_dma_data; diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index d1651a5..7c3cdb3 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1659,7 +1659,7 @@ static bool sdma_filter_fn(struct dma_chan *chan, void *fn_param) } static struct dma_chan *sdma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct sdma_engine *sdma = ofdma->of_dma_data; dma_cap_mask_t mask = sdma->dma_device.cap_mask; diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c index 01e25c6..dd0e7fe 100644 --- a/drivers/dma/k3dma.c +++ b/drivers/dma/k3dma.c @@ -786,7 +786,7 @@ static int k3_dma_transfer_resume(struct dma_chan *chan) MODULE_DEVICE_TABLE(of, k3_pdma_dt_ids); static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct k3_dma_dev *d = ofdma->of_dma_data; unsigned int request = dma_spec->args[0]; diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index eb3a1f4..569ec8f 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -993,7 +993,7 @@ static int mmp_pdma_chan_init(struct mmp_pdma_device *pdev, int idx, int irq) MODULE_DEVICE_TABLE(of, mmp_pdma_dt_ids); static struct dma_chan *mmp_pdma_dma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct mmp_pdma_device *d = ofdma->of_dma_data; struct dma_chan *chan; diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c index 13c68b6..ca56e73 100644 --- a/drivers/dma/mmp_tdma.c +++ b/drivers/dma/mmp_tdma.c @@ -591,7 +591,7 @@ static bool mmp_tdma_filter_fn(struct dma_chan *chan, void *fn_param) } static struct dma_chan *mmp_tdma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct mmp_tdma_device *tdev = ofdma->of_dma_data; dma_cap_mask_t mask = tdev->device.cap_mask; diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c index e1a5c22..d7c32a3 100644 --- a/drivers/dma/moxart-dma.c +++ b/drivers/dma/moxart-dma.c @@ -330,7 +330,7 @@ static struct dma_async_tx_descriptor *moxart_prep_slave_sg( } static struct dma_chan *moxart_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct moxart_dmadev *mdc = ofdma->of_dma_data; struct dma_chan *chan; diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index e217268..3cc0e6b 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -747,7 +747,7 @@ static bool mxs_dma_filter_fn(struct dma_chan *chan, void *fn_param) } static struct dma_chan *mxs_dma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct mxs_dma_engine *mxs_dma = ofdma->of_dma_data; dma_cap_mask_t mask = mxs_dma->dma_device.cap_mask; diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c index 3f45b9b..cb6a981 100644 --- a/drivers/dma/nbpfaxi.c +++ b/drivers/dma/nbpfaxi.c @@ -1096,7 +1096,7 @@ static void nbpf_free_chan_resources(struct dma_chan *dchan) } static struct dma_chan *nbpf_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct nbpf_device *nbpf = ofdma->of_dma_data; struct dma_chan *dchan; diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c index faae0bf..b6fd9e1 100644 --- a/drivers/dma/of-dma.c +++ b/drivers/dma/of-dma.c @@ -54,7 +54,8 @@ static struct of_dma *of_dma_find_controller(struct of_phandle_args *dma_spec) * to request channel from the real DMA controller. */ static struct dma_chan *of_dma_router_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, + struct device *slave) { struct dma_chan *chan; struct of_dma *ofdma_target; @@ -71,7 +72,8 @@ static struct dma_chan *of_dma_router_xlate(struct of_phandle_args *dma_spec, if (!ofdma_target) return NULL; - chan = ofdma_target->of_dma_xlate(&dma_spec_target, ofdma_target); + chan = ofdma_target->of_dma_xlate(&dma_spec_target, ofdma_target, + slave); if (chan) { chan->router = ofdma->dma_router; chan->route_data = route_data; @@ -103,7 +105,8 @@ static struct dma_chan *of_dma_router_xlate(struct of_phandle_args *dma_spec, */ int of_dma_controller_register(struct device_node *np, struct dma_chan *(*of_dma_xlate) - (struct of_phandle_args *, struct of_dma *), + (struct of_phandle_args *, struct of_dma *, + struct device *), void *data) { struct of_dma *ofdma; @@ -229,14 +232,15 @@ static int of_dma_match_channel(struct device_node *np, const char *name, /** * of_dma_request_slave_channel - Get the DMA slave channel - * @np: device node to get DMA request from + * @slave: device to get DMA request from * @name: name of desired channel * * Returns pointer to appropriate DMA channel on success or an error pointer. */ -struct dma_chan *of_dma_request_slave_channel(struct device_node *np, +struct dma_chan *of_dma_request_slave_channel(struct device *slave, const char *name) { + struct device_node *np = slave->of_node; struct of_phandle_args dma_spec; struct of_dma *ofdma; struct dma_chan *chan; @@ -275,7 +279,7 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np, ofdma = of_dma_find_controller(&dma_spec); if (ofdma) { - chan = ofdma->of_dma_xlate(&dma_spec, ofdma); + chan = ofdma->of_dma_xlate(&dma_spec, ofdma, slave); } else { ret_no_channel = -EPROBE_DEFER; chan = NULL; @@ -305,7 +309,7 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np, * pointer to appropriate dma channel on success or NULL on error. */ struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { int count = dma_spec->args_count; struct of_dma_filter_info *info = ofdma->of_dma_data; @@ -335,7 +339,7 @@ struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, * Returns pointer to appropriate dma channel on success or NULL on error. */ struct dma_chan *of_dma_xlate_by_chan_id(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct dma_device *dev = ofdma->of_dma_data; struct dma_chan *chan, *candidate = NULL; diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 27cc5d2..3c80e71 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2096,7 +2096,8 @@ bool pl330_filter(struct dma_chan *chan, void *param) EXPORT_SYMBOL(pl330_filter); static struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, + struct device *slave) { int count = dma_spec->args_count; struct pl330_dmac *pl330 = ofdma->of_dma_data; diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index b53fb61..434764b 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -1336,7 +1336,7 @@ static int pxad_init_phys(struct platform_device *op, MODULE_DEVICE_TABLE(of, pxad_dt_ids); static struct dma_chan *pxad_dma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct pxad_device *d = ofdma->of_dma_data; struct dma_chan *chan; diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 03c4eb3..7ff3075 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -1049,7 +1049,7 @@ static void bam_dma_free_desc(struct virt_dma_desc *vd) } static struct dma_chan *bam_dma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *of) + struct of_dma *of, struct device *slave) { struct bam_device *bdev = container_of(of->of_dma_data, struct bam_device, common); diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 2e441d0..7cecf03 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1552,7 +1552,7 @@ static bool rcar_dmac_chan_filter(struct dma_chan *chan, void *arg) } static struct dma_chan *rcar_dmac_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct rcar_dmac_chan *rchan; struct dma_chan *chan; diff --git a/drivers/dma/sh/shdma-of.c b/drivers/dma/sh/shdma-of.c index f999f9b..9953be9 100644 --- a/drivers/dma/sh/shdma-of.c +++ b/drivers/dma/sh/shdma-of.c @@ -20,7 +20,7 @@ #define to_shdma_chan(c) container_of(c, struct shdma_chan, dma_chan) static struct dma_chan *shdma_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { u32 id = dma_spec->args[0]; dma_cap_mask_t mask; diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c index 72c6497..0f06a94 100644 --- a/drivers/dma/sh/usb-dmac.c +++ b/drivers/dma/sh/usb-dmac.c @@ -650,7 +650,7 @@ static bool usb_dmac_chan_filter(struct dma_chan *chan, void *arg) } static struct dma_chan *usb_dmac_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct dma_chan *chan; dma_cap_mask_t mask; diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c index a0733ac3e..ed6f07b 100644 --- a/drivers/dma/sirf-dma.c +++ b/drivers/dma/sirf-dma.c @@ -826,7 +826,7 @@ bool sirfsoc_dma_filter_id(struct dma_chan *chan, void *chan_id) BIT(DMA_SLAVE_BUSWIDTH_8_BYTES)) static struct dma_chan *of_dma_sirfsoc_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct sirfsoc_dma *sdma = ofdma->of_dma_data; unsigned int request = dma_spec->args[0]; diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c index bfb79bd..6a92a65 100644 --- a/drivers/dma/st_fdma.c +++ b/drivers/dma/st_fdma.c @@ -167,7 +167,7 @@ static irqreturn_t st_fdma_irq_handler(int irq, void *dev_id) } static struct dma_chan *st_fdma_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct st_fdma_dev *fdev = ofdma->of_dma_data; struct dma_chan *chan; diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 8684d11..d7b0662 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2334,7 +2334,7 @@ static void d40_set_prio_realtime(struct d40_chan *d40c) #define D40_DT_FLAGS_HIGH_PRIO(flags) ((flags >> 4) & 0x1) static struct dma_chan *d40_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct stedma40_chan_cfg cfg; dma_cap_mask_t cap; diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index 3688d08..8e8e592 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -965,7 +965,7 @@ static void stm32_dma_set_config(struct stm32_dma_chan *chan, } static struct dma_chan *stm32_dma_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct stm32_dma_device *dmadev = ofdma->of_dma_data; struct stm32_dma_cfg cfg; diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c index 57aa227..c1a0763 100644 --- a/drivers/dma/sun4i-dma.c +++ b/drivers/dma/sun4i-dma.c @@ -909,7 +909,7 @@ static int sun4i_dma_config(struct dma_chan *chan, } static struct dma_chan *sun4i_dma_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct sun4i_dma_dev *priv = ofdma->of_dma_data; struct sun4i_dma_vchan *vchan; diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c index a235878..240e4a9 100644 --- a/drivers/dma/sun6i-dma.c +++ b/drivers/dma/sun6i-dma.c @@ -930,7 +930,7 @@ static void sun6i_dma_free_chan_resources(struct dma_chan *chan) } static struct dma_chan *sun6i_dma_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct sun6i_dma_dev *sdev = ofdma->of_dma_data; struct sun6i_vchan *vchan; diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 3722b9d..e0eb581 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -1239,7 +1239,7 @@ static void tegra_dma_free_chan_resources(struct dma_chan *dc) } static struct dma_chan *tegra_dma_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct tegra_dma *tdma = ofdma->of_dma_data; struct dma_chan *chan; diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c index b10cbaa..525af32 100644 --- a/drivers/dma/tegra210-adma.c +++ b/drivers/dma/tegra210-adma.c @@ -605,7 +605,7 @@ static void tegra_adma_free_chan_resources(struct dma_chan *dc) } static struct dma_chan *tegra_dma_of_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct tegra_adma *tdma = ofdma->of_dma_data; struct tegra_adma_chan *tdc; diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 8288fe4..69cdfc3 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2461,7 +2461,7 @@ static int xilinx_dma_child_probe(struct xilinx_dma_device *xdev, * Return: DMA channel pointer on success and NULL on error */ static struct dma_chan *of_dma_xilinx_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct xilinx_dma_device *xdev = ofdma->of_dma_data; int chan_id = dma_spec->args[0]; diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c index 6d221e5..6aa133c 100644 --- a/drivers/dma/xilinx/zynqmp_dma.c +++ b/drivers/dma/xilinx/zynqmp_dma.c @@ -1040,7 +1040,7 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev, * Return: DMA channel pointer on success and NULL on error */ static struct dma_chan *of_zynqmp_dma_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct zynqmp_dma_device *zdev = ofdma->of_dma_data; diff --git a/drivers/dma/zx296702_dma.c b/drivers/dma/zx296702_dma.c index 380276d..a07f1c1 100644 --- a/drivers/dma/zx296702_dma.c +++ b/drivers/dma/zx296702_dma.c @@ -731,7 +731,7 @@ static void zx_dma_free_desc(struct virt_dma_desc *vd) MODULE_DEVICE_TABLE(of, zx6702_dma_dt_ids); static struct dma_chan *zx_of_dma_simple_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { struct zx_dma_dev *d = ofdma->of_dma_data; unsigned int request = dma_spec->args[0]; diff --git a/include/linux/of_dma.h b/include/linux/of_dma.h index b90d8ec..a0a6c8c 100644 --- a/include/linux/of_dma.h +++ b/include/linux/of_dma.h @@ -22,7 +22,8 @@ struct of_dma { struct list_head of_dma_controllers; struct device_node *of_node; struct dma_chan *(*of_dma_xlate) - (struct of_phandle_args *, struct of_dma *); + (struct of_phandle_args *, struct of_dma *, + struct device *); void *(*of_dma_route_allocate) (struct of_phandle_args *, struct of_dma *); struct dma_router *dma_router; @@ -37,7 +38,7 @@ struct of_dma_filter_info { #ifdef CONFIG_DMA_OF extern int of_dma_controller_register(struct device_node *np, struct dma_chan *(*of_dma_xlate) - (struct of_phandle_args *, struct of_dma *), + (struct of_phandle_args *, struct of_dma *, struct device *), void *data); extern void of_dma_controller_free(struct device_node *np); @@ -47,17 +48,17 @@ extern int of_dma_router_register(struct device_node *np, struct dma_router *dma_router); #define of_dma_router_free of_dma_controller_free -extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np, +extern struct dma_chan *of_dma_request_slave_channel(struct device *slave, const char *name); extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma); + struct of_dma *ofdma, struct device *slave); extern struct dma_chan *of_dma_xlate_by_chan_id(struct of_phandle_args *dma_spec, - struct of_dma *ofdma); + struct of_dma *ofdma, struct device *slave); #else static inline int of_dma_controller_register(struct device_node *np, struct dma_chan *(*of_dma_xlate) - (struct of_phandle_args *, struct of_dma *), + (struct of_phandle_args *, struct of_dma *, struct device *), void *data) { return -ENODEV; @@ -77,14 +78,14 @@ static inline int of_dma_router_register(struct device_node *np, #define of_dma_router_free of_dma_controller_free -static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np, +static inline struct dma_chan *of_dma_request_slave_channel(struct device *slave, const char *name) { return ERR_PTR(-ENODEV); } static inline struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, - struct of_dma *ofdma) + struct of_dma *ofdma, struct device *slave) { return NULL; }