From patchwork Mon Jan 9 16:06:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 90507 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp151992qgi; Mon, 9 Jan 2017 08:08:08 -0800 (PST) X-Received: by 10.98.252.203 with SMTP id e194mr13228293pfh.8.1483978088235; Mon, 09 Jan 2017 08:08:08 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si89205282plp.216.2017.01.09.08.08.07; Mon, 09 Jan 2017 08:08:08 -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 S1762365AbdAIQIG (ORCPT + 4 others); Mon, 9 Jan 2017 11:08:06 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:35449 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970210AbdAIQHU (ORCPT ); Mon, 9 Jan 2017 11:07:20 -0500 Received: by mail-wm0-f41.google.com with SMTP id a197so102718069wmd.0 for ; Mon, 09 Jan 2017 08:07:20 -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=qUQ2Tqh7thtq55bN1UfE1q7wQhcigyThRtg+Rpjwiy0=; b=yRLmdlvJge3Mboju/RTkYKHswq1JZh4PYMkw2Szf3alB8ajRJmfidgH71zSOm+FP1c F1KwYWCz+NdVOXgu4uQ2UL744Dbv4RQygPz4DvY5GVGUSlXD+Yr+WdI8tPW1lmEIPeua KJsF/1QdRwu/lnV1IaEPJp+lJJfubgPw8A7QJDu1Il2UMNJstOaMS+2OFQYBeFUNGYxe 7C5kydxAWMIVjdHazVzCZ9xDYKHWMboVAASaM0oOVdVHDxIeppT5JwiisYOJTzPO/+1M cbZyxH9E6kkpEeb6DudnOmU5hfJINDu0TjDSsYrq5i3YjCoPWEi6M+xFmb0oa3ml5Q/w 3ENA== 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=qUQ2Tqh7thtq55bN1UfE1q7wQhcigyThRtg+Rpjwiy0=; b=bFkDtUVYdGsvYEINk/ItS+fz+Af9VSEtQcSugwdyC5BbsEN1vvs0SFJSZBIr377zyg A95YVweGTAW2dAKVOtGNsgmBpNJYz8wRjISH9szyZe3DI/42suDnFMnLrsP8vn21d9+Q fLiRqT2WYCf382wfgfRp7OJcWlXp7goW4rl7BcfW7OcphMz9lqBqBBFvXSj1aE5J7CVB rrqqMoGIFHOctfC/8dxTrxKVEZqieCERAz4qizj23mOBnoYTDkb0zMwjpJIRj3kpfwOk Ao908hecL0kJ3A14mz39A4nwSK9We7jNX8iwljQTQrLPm2LNANzC59tkvKttmAfqonJE gbYA== X-Gm-Message-State: AIkVDXI33nzMUNjGxsfHavKdtaI0bwguzkxu4OUHpG5zMWN07rHnMQvhQWk+qYRx7U2QXvcK X-Received: by 10.223.176.142 with SMTP id i14mr279164wra.4.1483978039568; Mon, 09 Jan 2017 08:07:19 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id w18sm19656244wme.9.2017.01.09.08.07.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Jan 2017 08:07:19 -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 02/11] dmaengine: cppi41: Split out the interrupt handler Date: Mon, 9 Jan 2017 17:06:47 +0100 Message-Id: <20170109160656.3470-3-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 The current interrupt handler do some actions specifics to am335x. These actions should be made by the platform interrupt handler. Split out the interrupt handler in two: one for the am335x platform and a generic one. Signed-off-by: Alexandre Bailon --- drivers/dma/cppi41.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) -- 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 25ee71d..42744ed 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -284,18 +284,11 @@ static u32 cppi41_pop_desc(struct cppi41_dd *cdd, unsigned queue_num) return desc; } -static irqreturn_t cppi41_irq(int irq, void *data) +static irqreturn_t cppi41_irq(struct cppi41_dd *cdd) { - struct cppi41_dd *cdd = data; struct cppi41_channel *c; - u32 status; int i; - status = cppi_readl(cdd->usbss_mem + USBSS_IRQ_STATUS); - if (!(status & USBSS_IRQ_PD_COMP)) - return IRQ_NONE; - cppi_writel(status, cdd->usbss_mem + USBSS_IRQ_STATUS); - for (i = QMGR_PENDING_SLOT_Q(FIST_COMPLETION_QUEUE); i < QMGR_NUM_PEND; i++) { u32 val; @@ -351,6 +344,19 @@ static irqreturn_t cppi41_irq(int irq, void *data) return IRQ_HANDLED; } +static irqreturn_t am335x_cppi41_irq(int irq, void *data) +{ + struct cppi41_dd *cdd = data; + u32 status; + + status = cppi_readl(cdd->usbss_mem + USBSS_IRQ_STATUS); + if (!(status & USBSS_IRQ_PD_COMP)) + return IRQ_NONE; + cppi_writel(status, cdd->usbss_mem + USBSS_IRQ_STATUS); + + return cppi41_irq(cdd); +} + static dma_cookie_t cppi41_tx_submit(struct dma_async_tx_descriptor *tx) { dma_cookie_t cookie; @@ -949,7 +955,7 @@ static struct dma_chan *cppi41_dma_xlate(struct of_phandle_args *dma_spec, } static const struct cppi_glue_infos am335x_usb_infos = { - .isr = cppi41_irq, + .isr = am335x_cppi41_irq, .queues_rx = am335x_usb_queues_rx, .queues_tx = am335x_usb_queues_tx, .td_queue = { .submit = 31, .complete = 0 },