From patchwork Thu Apr 18 08:14:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16186 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1963923974 for ; Thu, 18 Apr 2013 08:15:01 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id b10sf4579118qen.10 for ; Thu, 18 Apr 2013 01:14:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=SRsCv9ncBcXIzYiRA185s2Yhe8VOaKfuhyHaej93des=; b=TTn+XU+735kpWFfz2Y1KqZFkt/QqquEhNUVgDXlXo+Pr04gWFkXZdiIXFYsRdywbps lcJCRhdr0J1omkXkgjZTSYjJ24/GGbKoc5cWInJBEN7D1rkCSOihnRoBoA4eZcSprGF0 yUM+7mzrsE6d79JNaB+dihlcwHDi3kKr04d/RrfcPHEmvl9sE48WhSd2RGBUCQDx8TFJ EL8cHgu3zayjDkP6uhM8cME4ieS74kUhV38vi5YExbPRWJl6l9FpHTG84hV6oVcvBYvi fP5k1hOcaK1JwhAerE/OqTITrGsGya5q+RkHHxmxdH9mckxB+YfHNndrf5SALovnF/D6 p2pA== X-Received: by 10.236.78.103 with SMTP id f67mr4967276yhe.52.1366272864060; Thu, 18 Apr 2013 01:14:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.5 with SMTP id d5ls1428438qer.10.gmail; Thu, 18 Apr 2013 01:14:23 -0700 (PDT) X-Received: by 10.58.15.232 with SMTP id a8mr7504794ved.27.1366272863908; Thu, 18 Apr 2013 01:14:23 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id ez9si6074896vdb.55.2013.04.18.01.14.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 01:14:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id ht10so2162156vcb.41 for ; Thu, 18 Apr 2013 01:14:23 -0700 (PDT) X-Received: by 10.221.0.199 with SMTP id nn7mr7551713vcb.14.1366272863714; Thu, 18 Apr 2013 01:14:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp111170veb; Thu, 18 Apr 2013 01:14:23 -0700 (PDT) X-Received: by 10.180.79.227 with SMTP id m3mr16208743wix.12.1366272862487; Thu, 18 Apr 2013 01:14:22 -0700 (PDT) Received: from mail-we0-x232.google.com (mail-we0-x232.google.com [2a00:1450:400c:c03::232]) by mx.google.com with ESMTPS id f2si7096436wik.34.2013.04.18.01.14.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 01:14:22 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::232 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::232; Received: by mail-we0-f178.google.com with SMTP id z53so1933895wey.23 for ; Thu, 18 Apr 2013 01:14:22 -0700 (PDT) X-Received: by 10.194.5.196 with SMTP id u4mr16617811wju.54.1366272861920; Thu, 18 Apr 2013 01:14:21 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id g4sm14418830wib.11.2013.04.18.01.14.19 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 01:14:20 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, Lee Jones , Russell King , Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2] serial: pl011: Add Device Tree support to request DMA channels Date: Thu, 18 Apr 2013 09:14:16 +0100 Message-Id: <1366272857-14038-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQn8K3O6FjO75ltysSGtOCAwIp92ARdS2Uf6M3EnxTfmAtOonAeaQYKVCRkRJfwBZ5FkqZFB X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The new DMA API is operational. It is now possible to request DMA channels from information passed via Device Tree. Cc: Russell King Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Lee Jones --- drivers/tty/serial/amba-pl011.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 3ea5408..1b39f58 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -249,6 +249,7 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) { /* DMA is the sole user of the platform data right now */ struct amba_pl011_data *plat = uap->port.dev->platform_data; + struct device_node *np = uap->port.dev->of_node; struct dma_slave_config tx_conf = { .dst_addr = uap->port.mapbase + UART01x_DR, .dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE, @@ -259,9 +260,9 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) struct dma_chan *chan; dma_cap_mask_t mask; - /* We need platform data */ - if (!plat || !plat->dma_filter) { - dev_info(uap->port.dev, "no DMA platform data\n"); + /* We need platform data or DT */ + if (!(plat && plat->dma_filter) && !np) { + dev_info(uap->port.dev, "no DMA platform data or DT\n"); return; } @@ -269,7 +270,10 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - chan = dma_request_channel(mask, plat->dma_filter, plat->dma_tx_param); + chan = dma_request_slave_channel_compat(mask, + (plat) ? plat->dma_filter : NULL, + (plat) ? plat->dma_tx_param : NULL, + uap->port.dev, "tx"); if (!chan) { dev_err(uap->port.dev, "no TX DMA channel!\n"); return; @@ -282,7 +286,7 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) dma_chan_name(uap->dmatx.chan)); /* Optionally make use of an RX channel as well */ - if (plat->dma_rx_param) { + if ((plat && plat->dma_rx_param) || np) { struct dma_slave_config rx_conf = { .src_addr = uap->port.mapbase + UART01x_DR, .src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE, @@ -291,7 +295,10 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) .device_fc = false, }; - chan = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param); + chan = dma_request_slave_channel_compat(mask, + (plat) ? plat->dma_filter : NULL, + (plat) ? plat->dma_rx_param : NULL, + uap->port.dev, "rx"); if (!chan) { dev_err(uap->port.dev, "no RX DMA channel!\n"); return;