From patchwork Thu Nov 12 05:45:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 7599441 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A5920BF90C for ; Thu, 12 Nov 2015 05:46:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0C92204EC for ; Thu, 12 Nov 2015 05:46:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C60902045B for ; Thu, 12 Nov 2015 05:46:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752668AbbKLFp7 (ORCPT ); Thu, 12 Nov 2015 00:45:59 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:8013 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752364AbbKLFp6 (ORCPT ); Thu, 12 Nov 2015 00:45:58 -0500 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 12 Nov 2015 14:45:57 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 5A9C943AA1; Thu, 12 Nov 2015 14:45:57 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 450B48002E; Thu, 12 Nov 2015 14:45:57 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 193268002D; Thu, 12 Nov 2015 14:45:57 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id QAF03013; Thu, 12 Nov 2015 14:45:57 +0900 X-IronPort-AV: E=Sophos;i="5.20,280,1444662000"; d="scan'";a="198359136" Received: from mail-pu1apc01lp0023.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.23]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 12 Nov 2015 14:45:56 +0900 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost (211.11.155.145) by SG2PR06MB0919.apcprd06.prod.outlook.com (10.162.204.152) with Microsoft SMTP Server (TLS) id 15.1.318.15; Thu, 12 Nov 2015 05:45:54 +0000 From: Yoshihiro Shimoda To: , CC: , , Yoshihiro Shimoda Subject: [PATCH 3/3] usb: renesas_usbhs: Modify ep.caps.type_xxx and usb_ep_maxpacket_limit() Date: Thu, 12 Nov 2015 14:45:30 +0900 Message-ID: <1447307130-6072-4-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1447307130-6072-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1447307130-6072-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.145] X-ClientProxiedBy: KAWPR01CA0004.jpnprd01.prod.outlook.com (25.161.24.14) To SG2PR06MB0919.apcprd06.prod.outlook.com (25.162.204.152) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 2:OpBhvU2q8oAdcbYgNlYPYcrqmJxlW/VMWeLBTVqeQnGEnS1fDeXyd6LgRuJFVx3IpEx7+h3pzYkjB8JjjDjgXHQECuSpoFF2OsXFI3atYwxlpkO3dWvCPLiregnMPGOuDGAksmlQS+9AElEkyw4ohY9m15DyixOjpbLCU3ctRpc=; 3:9tx6ieUfaYZHnNIsv5mbZ6Jt1DJM9sA2nbnUleClUy+4W+X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94qDr43CHM2U/UGWpFoAd1EtYwVJha0YoywcjM32jwytlOQZyTNhJkObksqUNf4IfscXizfgiWUY2E6X3rf5amMLJiK1r2WQPf8d+NzeRIHs0/7NVQF+KnXXNeKQY/LroyfWLFQFxJwb1geeVctZULLDIEAxr+FcZLib+sPPsKwMAyQbKjYUArXT4hZ5d2MId61xM0DhmDMDqN/6Fni95EUOMOx40GDWMxIFu295f/m6J5u4uP0bmjeelm+g9We9OGGnp5CfHVfXHi2RYqNJowbo5rcFaw0XUYOQxCDpuw3JDFml2hkjZ5Z5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(10201501046)(3002001); SRVR:SG2PR06MB0919; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0919; X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6069001)(199003)(189002)(47776003)(229853001)(5003940100001)(19580395003)(50226001)(92566002)(66066001)(78352002)(76506005)(40100003)(42382002)(106356001)(19580405001)(101416001)(2950100001)(5001770100001)(5004730100002)(42186005)(76176999)(105586002)(189998001)(122386002)(50466002)(97736004)(5008740100001)(5001960100002)(36756003)(48376002)(5007970100001)(5001920100001)(33646002)(50986999)(4001430100002)(81156007)(77096005)(107886002)(87976001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0919; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:0; MX:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB0919; 23:nIvjUfbwYBcioPU8b7To9xseTMjXL++uPPTfoujI5?= =?us-ascii?Q?SoDsImrmi7kEigeMNM3pPtWFRDNmmZ/8Nh7I3AJDK7G9i6mnde78EYpQNhTF?= =?us-ascii?Q?rYvyzIEmFJ8GSeyHMHPLBnUCarEROTZKieth3BCTPg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4/Kgj1QikTPDP+JB0NjD4stl0eEeUM5qxsIiFiEWLa9PdFpKTLR0CdYR?= =?us-ascii?Q?eM4PAW10n79WTIxqeaz0KL27QqkX0Xkldc4aISlR19b4ID04t3sZHZU2HCn7?= =?us-ascii?Q?Qz/itsB0a+cde3yL8s3y33fAzeXs2lr?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 5:O/1c0EzKOi/wMhzrg9vVVtxDNcoR7Xfi2SiZ94LBmi7doTsFh8XE5cSdeTO5OfQCfKkIm7R0Kr98h4OLAhN4SzvP8F6Nlo5VyeUDfxRognas9Q6lX2p42n/sKj1RmTNmTq1sKiXCPfGTYs1ynHnNEg==; 24:wO9gRgYWOxQ+LLJcSEPinoOwi4uoY/i2MiLssWsMqDQRyyEgQZ8hL6h7LfoECwp/nD7v461DwY1Q1mq2zrAb5TwPaRc/0VvilFtlGDpyd0A=; 20:beSLvtiRgzSPj0avI1mqlyCZHVRWyoK8+T4EsSjSGpfopi8LJopT/VUpTeW7jdupzoevjHIiRcC8fE8dcvrPEPPF7rG6t+jQwS0VNDR25MF3ooxYAQflbEHfsx+P4iEgqIsbkhHBNWOCbNC6dPDb1+o+odulca78y6JWIplDNCQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2015 05:45:54.3737 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0919 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.0 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 8f7a78e..657f967 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -1042,6 +1042,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; @@ -1111,13 +1113,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;