From patchwork Thu Feb 21 05:34:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10823169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7FE3A1399 for ; Thu, 21 Feb 2019 05:35:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CDDE2EF4F for ; Thu, 21 Feb 2019 05:35:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DEF92EDC1; Thu, 21 Feb 2019 05:35:19 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 052192EDC1 for ; Thu, 21 Feb 2019 05:35:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726577AbfBUFfO (ORCPT ); Thu, 21 Feb 2019 00:35:14 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34602 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726198AbfBUFfO (ORCPT ); Thu, 21 Feb 2019 00:35:14 -0500 Received: by mail-pf1-f194.google.com with SMTP id u9so5919386pfn.1 for ; Wed, 20 Feb 2019 21:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=I+lwgjMPx4qaNrrdmqhxKjqvoWmsUeMIRo3rHXe/pVU=; b=yWXXDDAu70UKxZqDRXkfkvj8zkHJjsSWLqih2dV2eqrb9t4B6Nfo6+4SmzO9yqX8gE ejGKc4UoajokSgrctdkTsydBargA/EXcYhOo1d6Cq/qr7neYJ9Ml3rfkgucHkMOSxAqn kcurzbVHgQNmRXY/LkmX+LKyEdWiHR7MqaO3FEPOWlnAUkG6VX4S8Tt853p2Wq8LckEF klDrJapFdcLfP35Ksoyv4N/wvQHSMiwxt1bKllkUe97xZGO/THEf5XlD3+3/sBeADxhx 3UCCdHfXVvuRN4fPBUkTfg8nskfBxPpN7Y7VzWKABHMdPJ9npekq7BBq6QRTDsS/dowy FMJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=I+lwgjMPx4qaNrrdmqhxKjqvoWmsUeMIRo3rHXe/pVU=; b=gxibdNn6Cf25y8a0rY4y5+QPDn/0SA339zzknLruvzo1qvdexYkdOlC7IRCkvrMcdi vByID/fccf55mR29HcLp1tingRmTizVuq403fQCRBA3NjkPIBlOtvHzNWKEAGVzyrDVs S9paw3Mso1sdK8p5IUFKMYUH93ApBDuu31asQBxYWPcQa9qTa19hMwhPllEmIWki1cNY vYYxOTsOOCV2O5g+ujWGjie53hoFf7dK+TC6kPNxy7xzM73RHSe6TCElK4fZfDwjodjL QJRcrMWQQi2EDXWlSPNXzOhl1I4xSK5OBnOSt/3hCfZ5aF7xQKsoUUgGYuyELFuf9GDV V/cQ== X-Gm-Message-State: AHQUAuZaKNk9N/mrvP6bVoXmyrmfJqObYxoBvkS1a2q+xrQMQwn7zpZQ 5vLKGiR12ROHpcBFAD5mUUoc+w== X-Google-Smtp-Source: AHgI3IYxTaTyO21PUP1m+aWr1/zyddwSRtgfr165WFwpvMwxC8pjOvYghKA4jtw4kitRZoG0N4HNaQ== X-Received: by 2002:a65:6553:: with SMTP id a19mr33145199pgw.267.1550727313507; Wed, 20 Feb 2019 21:35:13 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id l10sm35001421pfc.90.2019.02.20.21.35.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Feb 2019 21:35:12 -0800 (PST) From: Baolin Wang To: vkoul@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, dan.j.williams@intel.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, eric.long@unisoc.com, broonie@kernel.org, baolin.wang@linaro.org Subject: [PATCH v2 2/2] dmaengine: sprd: Change channel id to slave id for DMA cell specifier Date: Thu, 21 Feb 2019 13:34:41 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <652a8ef9554890c254823ec39858b8d7413fd561.1550719757.git.baolin.wang@linaro.org> References: <652a8ef9554890c254823ec39858b8d7413fd561.1550719757.git.baolin.wang@linaro.org> In-Reply-To: <652a8ef9554890c254823ec39858b8d7413fd561.1550719757.git.baolin.wang@linaro.org> References: <652a8ef9554890c254823ec39858b8d7413fd561.1550719757.git.baolin.wang@linaro.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We will describe the slave id in DMA cell specifier instead of DMA channel id, thus we should save the slave id from DMA engine translation function, and remove the channel id validation. Meanwhile we do not need set default slave id in sprd_dma_alloc_chan_resources(), remove it. Signed-off-by: Baolin Wang --- Changes from v1: - Remove channel id from DT. --- drivers/dma/sprd-dma.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index e2f0167..48431e2 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -580,15 +580,7 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id) static int sprd_dma_alloc_chan_resources(struct dma_chan *chan) { - struct sprd_dma_chn *schan = to_sprd_dma_chan(chan); - int ret; - - ret = pm_runtime_get_sync(chan->device->dev); - if (ret < 0) - return ret; - - schan->dev_id = SPRD_DMA_SOFTWARE_UID; - return 0; + return pm_runtime_get_sync(chan->device->dev); } static void sprd_dma_free_chan_resources(struct dma_chan *chan) @@ -1021,13 +1013,10 @@ static void sprd_dma_free_desc(struct virt_dma_desc *vd) static bool sprd_dma_filter_fn(struct dma_chan *chan, void *param) { struct sprd_dma_chn *schan = to_sprd_dma_chan(chan); - struct sprd_dma_dev *sdev = to_sprd_dma_dev(&schan->vc.chan); - u32 req = *(u32 *)param; + u32 slave_id = *(u32 *)param; - if (req < sdev->total_chns) - return req == schan->chn_num + 1; - else - return false; + schan->dev_id = slave_id; + return true; } static int sprd_dma_probe(struct platform_device *pdev)