From patchwork Mon Jan 19 03:53:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 5654601 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7A4449F2ED for ; Mon, 19 Jan 2015 03:53:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE9632011D for ; Mon, 19 Jan 2015 03:53:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF80E200E5 for ; Mon, 19 Jan 2015 03:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751341AbbASDxa (ORCPT ); Sun, 18 Jan 2015 22:53:30 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:9189 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751090AbbASDx3 (ORCPT ); Sun, 18 Jan 2015 22:53:29 -0500 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 19 Jan 2015 12:53:29 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 05A484D08B; Mon, 19 Jan 2015 12:53:29 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id D17AF480A4; Mon, 19 Jan 2015 12:53:28 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id C0475480A3; Mon, 19 Jan 2015 12:53:28 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id NBQ22973; Mon, 19 Jan 2015 12:53:28 +0900 X-IronPort-AV: E=Sophos;i="5.09,424,1418050800"; d="scan'208";a="177893679" Received: from mail-hk1lp0121.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.121]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 19 Jan 2015 12:53:28 +0900 Received: from localhost (211.11.155.147) by HKNPR06MB324.apcprd06.prod.outlook.com (10.141.38.18) with Microsoft SMTP Server (TLS) id 15.1.59.20; Mon, 19 Jan 2015 03:53:27 +0000 From: Yoshihiro Shimoda To: , , , , , , CC: , , Yoshihiro Shimoda Subject: [PATCH 1/2] usb: renesas_usbhs: add usbhsf_dma_init_pdev() function Date: Mon, 19 Jan 2015 12:53:16 +0900 Message-ID: <1421639597-2784-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1421639597-2784-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1421639597-2784-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.147] X-ClientProxiedBy: HKXPR03CA0028.apcprd03.prod.outlook.com (10.141.129.18) To HKNPR06MB324.apcprd06.prod.outlook.com (10.141.38.18) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; X-DmarcAction-Test: None X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(3005004);SRVR:HKNPR06MB324; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:HKNPR06MB324; X-Forefront-PRVS: 046164D5C4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6069001)(199003)(189002)(50226001)(66066001)(122386002)(64706001)(40100003)(87976001)(77096005)(97736003)(105586002)(19580395003)(19580405001)(78352002)(42186005)(42382002)(2950100001)(50986999)(36756003)(48376002)(92566002)(76506005)(33646002)(106356001)(47776003)(68736005)(76176999)(101416001)(77156002)(46102003)(50466002)(229853001)(62966003)(88662002); DIR:OUT; SFP:1102; SCL:1; SRVR:HKNPR06MB324; H:localhost; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; A:0; MX:0; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKNPR06MB324; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2015 03:53:27.0839 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKNPR06MB324 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To add support for requesting DT DMA in the future, this patch adds usbhsf_dma_init_pdev() function. Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/fifo.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index f46271c..48e31b9 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c @@ -1054,10 +1054,8 @@ static void usbhsf_dma_quit(struct usbhs_priv *priv, struct usbhs_fifo *fifo) fifo->rx_chan = NULL; } -static void usbhsf_dma_init(struct usbhs_priv *priv, - struct usbhs_fifo *fifo) +static void usbhsf_dma_init_pdev(struct usbhs_fifo *fifo) { - struct device *dev = usbhs_priv_to_dev(priv); dma_cap_mask_t mask; dma_cap_zero(mask); @@ -1069,6 +1067,14 @@ static void usbhsf_dma_init(struct usbhs_priv *priv, dma_cap_set(DMA_SLAVE, mask); fifo->rx_chan = dma_request_channel(mask, usbhsf_dma_filter, &fifo->rx_slave); +} + +static void usbhsf_dma_init(struct usbhs_priv *priv, + struct usbhs_fifo *fifo) +{ + struct device *dev = usbhs_priv_to_dev(priv); + + usbhsf_dma_init_pdev(fifo); if (fifo->tx_chan || fifo->rx_chan) dev_dbg(dev, "enable DMAEngine (%s%s%s)\n",