From patchwork Wed Nov 18 05:34:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 7644551 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 65FDD9F2E2 for ; Wed, 18 Nov 2015 05:34:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8780B2060D for ; Wed, 18 Nov 2015 05:34:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C63420607 for ; Wed, 18 Nov 2015 05:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751384AbbKRFee (ORCPT ); Wed, 18 Nov 2015 00:34:34 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:33679 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751029AbbKRFec (ORCPT ); Wed, 18 Nov 2015 00:34:32 -0500 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 18 Nov 2015 14:34:31 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 11BFE4F0E4; Wed, 18 Nov 2015 14:34:31 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 01AF72806E; Wed, 18 Nov 2015 14:34:30 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id F10E22806D; Wed, 18 Nov 2015 14:34:30 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id QAG01722; Wed, 18 Nov 2015 14:34:30 +0900 X-IronPort-AV: E=Sophos;i="5.20,311,1444662000"; d="scan'";a="198811690" Received: from mail-sg2apc01lp0246.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.246]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 18 Nov 2015 14:34:30 +0900 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost (211.11.155.144) by SG2PR06MB0920.apcprd06.prod.outlook.com (10.162.204.153) with Microsoft SMTP Server (TLS) id 15.1.331.20; Wed, 18 Nov 2015 05:34:28 +0000 From: Yoshihiro Shimoda To: , CC: , , Yoshihiro Shimoda Subject: [PATCH v2 2/2] usb: renesas_usbhs: Modify ep.caps.type_xxx and usb_ep_maxpacket_limit() Date: Wed, 18 Nov 2015 14:34:10 +0900 Message-ID: <1447824850-6296-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1447824850-6296-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1447824850-6296-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR06CA0013.apcprd06.prod.outlook.com (25.164.91.23) To SG2PR06MB0920.apcprd06.prod.outlook.com (25.162.204.153) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0920; 2:gO8pKdZWOKjvBxajF+eMEs2Ig7KNQ+483ufush5fod0/RS/a9XcTkiMHVgTjB7VM+q3a5MJNAK+NrFukgLCFuKtyyyfVNNy5EuCHeCj4vFM8bBPeBXr5RbY6kmAPknWN+/PpYyhUo3Qq4wtZn/3puA==; 3:eRCJ2Y2/2lAkUPkLGXw3rD0pvOSWkqy1ks4CQiKTd4pwWzE/hr6P+G+CvF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FdN3+BGNvltO9VilQGukgmQzN5AZjPggzlPiSjemtbFAxifHnH0ZIotYFkK8mvgF2UakRuWRJrknyralcey/27cKmT4U0EXlEWitv5/2ym3iPlz5goAgShrfagn214mFLmILQG/J9zn+NNRiHurDvCrsN54CDKxheHkLaZ6ZROgT9zNoGpW5jxmBI/PIqHADqib7o5Qq9ucFOYA61aSqSA8w1wNa1Uahd0tl6IMCRBvegRXs2eYPfDFFuKMRKC7eKz9/W3IV0oFXxPXPpRjNMDSsCBi/h7bJueQOrOlHCr5XxRvgAB +CL5lieCzgPexdbr2+o+inphik X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(10201501046)(3002001); SRVR:SG2PR06MB0920; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0920; X-Forefront-PRVS: 0764C4A8CD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(6009001)(199003)(189002)(76176999)(33646002)(92566002)(50986999)(586003)(189998001)(97736004)(5008740100001)(5001770100001)(106356001)(50226001)(77096005)(19580405001)(19580395003)(40100003)(5003940100001)(2950100001)(81156007)(4001430100002)(42382002)(87976001)(47776003)(122386002)(78352002)(66066001)(42186005)(105586002)(5007970100001)(5001920100001)(229853001)(50466002)(5001960100002)(76506005)(48376002)(107886002)(36756003)(101416001)(5004730100002); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0920; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:0; MX:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB0920; 23:SK4b/KdLKvqZe5Gf+JJKAMpC++vkn7pIxWKyPs/n1?= =?us-ascii?Q?JCHnpzBSqr+xJpI1nm7AKYM+3M89+rWRXSHzykZJIi4oUs4y7bxw42YiHGvU?= =?us-ascii?Q?tdZzDgF5zqDH0wH/R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y5be5w?= =?us-ascii?Q?QcapioQ2QDjb9KcepUZYxvztFunwMDCYS3l5Qq+ljojZnGdQKxXpWtm3G9ND?= =?us-ascii?Q?Grnx8zSYMFnJYuZhbRUbFhRQOWc1UyTaeU213eiHtiGTwCoqhw0SYOptPRxh?= =?us-ascii?Q?wEcW9R/b6t7vRvBho6/oJyIvqGlV26lehkm7XGCnYU77CRbr00gdQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0920; 5:ThEokO/MbBZYC+Z4i0bJD5pyZZg5nq3o3yc6J3gakc0xGzcweEZRBAtnf7vCaAQsRdBkRLM/tlpcDBZ5Pcn1oAsDtfs8dLiyNNhNgU3hB/wTVvDvSMWXrFZI5BdUdEsJ68kMw2jVPh/RXWJCzKbuSA==; 24:QEkr0J9lmnFMgU+LncEWXz7ervWGak/U/PMbd/4fPDleJnqSgaW35FNhX+RsfkhiBH0GDhtkeRXB4P/0rTjpWXT+wgf7wTiGoEGCljdg3h4=; 20:fAJWscNJ3cme+fSaLkoCa4bh/u4CZu/wFYVcIKw4+e9srzYdQ2nWkvb2sQLvq5AcBylhcYyDytYag43RJemRBVBpFu1X4/Gp+LhsFEmxD2NjciiiDCV3c55kqxzPYYQG7ieqQ1sk/ogYAs7mG/t7/axQtMN3Q4ghnUcIe4nHZcs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2015 05:34:28.6358 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0920 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-4.5 required=5.0 tests=AXB_X_OUTLOOKPROT_ENVSDR, BAYES_00, RCVD_IN_DNSWL_HI, 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 This patch modifies the ep.caps.type_{iso,bulk,int} setting and the second argument of usb_ep_maxpacket_limit() using the dparam.pipe_configs. In the previous code, all the type_{iso,bulk,int} were set to true. However, to avoid waste time for finding suitable pipe in usb_ep_enable(), this driver should set correct type. Also the second argument of usb_ep_maxpacket_limit() was set to 512 even if the pipe is isochronous or interrupt. So, this driver could not bind a gadget driver like the g_audio driver. Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/mod_gadget.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index de4f97d..d45a2c7 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -1035,6 +1035,8 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv) struct usbhsg_gpriv *gpriv; struct usbhsg_uep *uep; struct device *dev = usbhs_priv_to_dev(priv); + struct renesas_usbhs_driver_pipe_config *pipe_configs = + usbhs_get_dparam(priv, pipe_configs); int pipe_size = usbhs_get_dparam(priv, pipe_size); int i; int ret; @@ -1104,13 +1106,16 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv) gpriv->gadget.ep0 = &uep->ep; usb_ep_set_maxpacket_limit(&uep->ep, 64); uep->ep.caps.type_control = true; - } - /* init normal pipe */ - else { - usb_ep_set_maxpacket_limit(&uep->ep, 512); - uep->ep.caps.type_iso = true; - uep->ep.caps.type_bulk = true; - uep->ep.caps.type_int = true; + } else { + /* init normal pipe */ + if (pipe_configs[i].type == USB_ENDPOINT_XFER_ISOC) + uep->ep.caps.type_iso = true; + if (pipe_configs[i].type == USB_ENDPOINT_XFER_BULK) + uep->ep.caps.type_bulk = true; + if (pipe_configs[i].type == USB_ENDPOINT_XFER_INT) + uep->ep.caps.type_int = true; + usb_ep_set_maxpacket_limit(&uep->ep, + pipe_configs[i].bufsize); list_add_tail(&uep->ep.ep_list, &gpriv->gadget.ep_list); } uep->ep.caps.dir_in = true;