From patchwork Mon Jan 9 16:06:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 90509 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp152034qgi; Mon, 9 Jan 2017 08:08:13 -0800 (PST) X-Received: by 10.84.216.24 with SMTP id m24mr189064676pli.22.1483978093407; Mon, 09 Jan 2017 08:08:13 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7si12575342pll.247.2017.01.09.08.08.13; Mon, 09 Jan 2017 08:08:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762284AbdAIQIK (ORCPT + 4 others); Mon, 9 Jan 2017 11:08:10 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:36276 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970225AbdAIQHX (ORCPT ); Mon, 9 Jan 2017 11:07:23 -0500 Received: by mail-wm0-f42.google.com with SMTP id c85so102514628wmi.1 for ; Mon, 09 Jan 2017 08:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tk9aRpNUC867Cr7u/I0BnTK4ASHH4WMGnWCYQCWQaDQ=; b=IHht3YvCJqY0zM+DHctawX0KDwfr/3LXIeKq02eeyQS5s/00UJx21E2aKeDNg45k2F tHFjd3M6dMgJ5PUa1mj2qPAciTfj2RwXlaGCYd70SJwh+PKZi7RYvo3UTFP1DAbQyghn XkGtzA04BHMhy0U+wLrH5TGuSITCAhvJAnpF+GQnK5NwamoKc4wXGbqVF1RFGDTT83lS 9OQcUX1g+BO3cqcjCkuz6vTFaNlVRB3KU0xtbH6nKyDIQcvUjh0en9huswG6ojrtUXLh 4Q3kRBf8llPTMf9M3SfcnkWfxgQe3GEl1pgTyyebcKaKJVt4/NV8A/s4R9LKbbRMsWug YuHw== 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; bh=tk9aRpNUC867Cr7u/I0BnTK4ASHH4WMGnWCYQCWQaDQ=; b=mQYZSj76VWVdNo6omH7+0gXV8awjTOwfNMqRCQx8E/8zHHus1+rS1YSgrSZNw5Gti6 Jb2jJR1XcgdlAc00GIY1JTYIC+YkXrAndGFCqyZZxtK96PXIZtTtYwni8uejqr051+JF xku4VT3GpAs3ke015EZS37vhd48fzZW2VJPsxQlM8jxbPlerpeeOv9cxc5RzqPG9N3HZ AUAegW2Fd2MXLTs4C/TsZI0OLuEdM88uTfmsKHfRhosX1A7lYC1EA8jgjZc7ZnYyDXZt Ir2wZWAW74cUMf1zuobXhKoBp2kDyaKXuS3BfYtQFEphaxNI6SblgEeXwtI+mIvet6Lt ENLA== X-Gm-Message-State: AIkVDXLTcP1wSWqw6DDC7kti8uJ4PgLS3iEz9IRScLymgSFFVCmgKQUs3Ok76HMacExIhToB X-Received: by 10.223.178.9 with SMTP id u9mr236550wra.125.1483978042349; Mon, 09 Jan 2017 08:07:22 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id w18sm19656244wme.9.2017.01.09.08.07.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Jan 2017 08:07:21 -0800 (PST) From: Alexandre Bailon To: vinod.koul@intel.com Cc: dmaengine@vger.kernel.org, linux-usb@vger.kernel.org, nsekhar@ti.com, khilman@baylibre.com, ptitiano@baylibre.com, tony@atomide.com, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, b-liu@ti.com, Alexandre Bailon Subject: [PATCH 05/11] dmaengine: cppi41: Add a way to test if the driver is running on am335x Date: Mon, 9 Jan 2017 17:06:50 +0100 Message-Id: <20170109160656.3470-6-abailon@baylibre.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170109160656.3470-1-abailon@baylibre.com> References: <20170109160656.3470-1-abailon@baylibre.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org As the cppi41 is present in different platform, the driver needs to determine on which platform it is running to execute instructions specific to this platform (such as configure IRQ on am335x). Add a way to test if we are running on am335x. Signed-off-by: Alexandre Bailon --- drivers/dma/cppi41.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index 8d7965d..58b27ef 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -89,6 +89,8 @@ /* Packet Descriptor */ #define PD2_ZERO_LENGTH (1 << 19) +#define AM335X_CPPI41 0 + struct cppi41_channel { struct dma_chan chan; struct dma_async_tx_descriptor txd; @@ -237,6 +239,7 @@ struct cppi_glue_infos { struct chan_queues td_queue; u16 first_completion_queue; u16 qmgr_num_pend; + u8 platform; }; static struct cppi41_channel *to_cpp41_chan(struct dma_chan *c) @@ -966,6 +969,7 @@ static const struct cppi_glue_infos am335x_usb_infos = { .td_queue = { .submit = 31, .complete = 0 }, .first_completion_queue = 93, .qmgr_num_pend = 5, + .platform = AM335X_CPPI41, }; static const struct of_device_id cppi41_dma_ids[] = { @@ -984,6 +988,13 @@ static const struct cppi_glue_infos *get_glue_info(struct device *dev) return of_id->data; } +static int is_am335x_cppi41(struct device *dev) +{ + struct cppi41_dd *cdd = dev_get_drvdata(dev); + + return cdd->platform == AM335X_CPPI41; +} + #define CPPI41_DMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \ BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ BIT(DMA_SLAVE_BUSWIDTH_3_BYTES) | \ @@ -1045,6 +1056,7 @@ static int cppi41_dma_probe(struct platform_device *pdev) cdd->td_queue = glue_info->td_queue; cdd->qmgr_num_pend = glue_info->qmgr_num_pend; cdd->first_completion_queue = glue_info->first_completion_queue; + cdd->platform = glue_info->platform; ret = of_property_read_u32(dev->of_node, "#dma-channels", &cdd->n_chans);