From patchwork Wed May 15 09:51:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16941 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f197.google.com (mail-gh0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A37902396C for ; Wed, 15 May 2013 09:53:32 +0000 (UTC) Received: by mail-gh0-f197.google.com with SMTP id r20sf1941714ghr.0 for ; Wed, 15 May 2013 02:52:56 -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 :in-reply-to:references: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=W5DnJF5xrZH4lsET49Cy40nzgnR8iJp+oMTOMp082O0=; b=kRzbScCTIn3TqkJuGAFBIGTHePt9zZeC0/6XlnYBUnkcws1bsN4n0N1AwjqD4bJGj6 VJ9tq5AoHF3CbaIsHV1UNaBYH4wrI18MGZFAq4xhVbwsm6iyZU6Pv33Sx0RqZD+huYVi HkjpJFw/7RLWdRE/JukjdKqjLllM18jD3gmWvXroQk0lJ+z3xC0sFVAyuj6ipcRHr4JN jsZXcZ1EwBoR386tW0BtLOtA+urkgwbKSyutPRHAN8KdUjmPF5VWhO52Hhtm/53WNC/6 Qx6b2VlusAhShzYXhbSkNPeeGSsTSEOdQxub+H83ex2uBE7faCM9l44qa7P8ZCQIJ7yg 2kSQ== X-Received: by 10.224.42.141 with SMTP id s13mr23057189qae.3.1368611576103; Wed, 15 May 2013 02:52:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.163 with SMTP id 3ls672945qef.58.gmail; Wed, 15 May 2013 02:52:56 -0700 (PDT) X-Received: by 10.59.6.101 with SMTP id ct5mr23916942ved.8.1368611575940; Wed, 15 May 2013 02:52:55 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id zp6si1042594vdb.41.2013.05.15.02.52.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id hr11so1594768vcb.19 for ; Wed, 15 May 2013 02:52:55 -0700 (PDT) X-Received: by 10.58.144.231 with SMTP id sp7mr24297590veb.34.1368611575748; Wed, 15 May 2013 02:52:55 -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.220.217.15 with SMTP id hk15csp11365vcb; Wed, 15 May 2013 02:52:55 -0700 (PDT) X-Received: by 10.194.172.105 with SMTP id bb9mr2778031wjc.24.1368611574654; Wed, 15 May 2013 02:52:54 -0700 (PDT) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [2a00:1450:400c:c05::22f]) by mx.google.com with ESMTPS id j6si588518wix.42.2013.05.15.02.52.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:54 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22f is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22f; Received: by mail-wi0-f175.google.com with SMTP id hn14so2598883wib.2 for ; Wed, 15 May 2013 02:52:54 -0700 (PDT) X-Received: by 10.180.109.84 with SMTP id hq20mr13276308wib.11.1368611574117; Wed, 15 May 2013 02:52:54 -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 ESMTPSA id q13sm2898210wie.8.2013.05.15.02.52.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:53 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, balbi@ti.com, linux-usb@vger.kernel.org, linux-crypto@vger.kernel.org, davem@davemloft.net, herbert@gondor.apana.org.au, vinod.koul@intel.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones Subject: [PATCH 24/39] usb: musb: ux500: attempt to find channels by name before using pdata Date: Wed, 15 May 2013 10:51:47 +0100 Message-Id: <1368611522-9984-25-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368611522-9984-1-git-send-email-lee.jones@linaro.org> References: <1368611522-9984-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkMgz7FJmpbU9pBuk1PZ1+VNAb45u+QeYIyDF8UI1/siBSxBmx8RUOFCg+35tMIyWNv4kXe X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 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: , If we can ever get to a state where we can solely search for DMA channels by name, this will almost completely alleviate the requirement to pass copious amounts of information though platform data. Here we take the first step towards this. The next step will be to enable Device Tree complete with name<->event_line mapping. Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Acked-by: Linus Walleij Acked-by: Fabio Baltieri Signed-off-by: Lee Jones --- drivers/usb/musb/ux500_dma.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c index 4bd5400..7d80699 100644 --- a/drivers/usb/musb/ux500_dma.c +++ b/drivers/usb/musb/ux500_dma.c @@ -34,6 +34,11 @@ #include #include "musb_core.h" +static const char *iep_chan_names[] = { "iep_1_9", "iep_2_10", "iep_3_11", "iep_4_12", + "iep_5_13", "iep_6_14", "iep_7_15", "iep_8" }; +static const char *oep_chan_names[] = { "oep_1_9", "oep_2_10", "oep_3_11", "oep_4_12", + "oep_5_13", "oep_6_14", "oep_7_15", "oep_8" }; + struct ux500_dma_channel { struct dma_channel channel; struct ux500_dma_controller *controller; @@ -291,6 +296,7 @@ static int ux500_dma_controller_start(struct dma_controller *c) struct musb_hdrc_platform_data *plat = dev->platform_data; struct ux500_musb_board_data *data; struct dma_channel *dma_channel = NULL; + char **chan_names; u32 ch_num; u8 dir; u8 is_tx = 0; @@ -312,6 +318,7 @@ static int ux500_dma_controller_start(struct dma_controller *c) /* Prepare the loop for RX channels */ channel_array = controller->rx_channel; param_array = data ? data->dma_rx_param_array : NULL; + chan_names = (char **)iep_chan_names; for (dir = 0; dir < 2; dir++) { for (ch_num = 0; @@ -327,9 +334,15 @@ static int ux500_dma_controller_start(struct dma_controller *c) dma_channel->status = MUSB_DMA_STATUS_FREE; dma_channel->max_len = SZ_16M; - ux500_channel->dma_chan = dma_request_channel(mask, - data->dma_filter, - param_array[ch_num]); + ux500_channel->dma_chan = + dma_request_slave_channel(dev, chan_names[ch_num]); + + if (!ux500_channel->dma_chan) + ux500_channel->dma_chan = + dma_request_channel(mask, + data->dma_filter, + param_array[ch_num]); + if (!ux500_channel->dma_chan) { ERR("Dma pipe allocation error dir=%d ch=%d\n", dir, ch_num); @@ -345,6 +358,7 @@ static int ux500_dma_controller_start(struct dma_controller *c) /* Prepare the loop for TX channels */ channel_array = controller->tx_channel; param_array = data ? data->dma_tx_param_array : NULL; + chan_names = (char **)oep_chan_names; is_tx = 1; }