From patchwork Tue Jul 14 00:34:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 6783241 Return-Path: X-Original-To: patchwork-linux-omap@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 1BA27C05AC for ; Tue, 14 Jul 2015 01:43:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1192D2065F for ; Tue, 14 Jul 2015 01:43:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 080CA2063E for ; Tue, 14 Jul 2015 01:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752819AbbGNBnl (ORCPT ); Mon, 13 Jul 2015 21:43:41 -0400 Received: from mail-bn1on0118.outbound.protection.outlook.com ([157.56.110.118]:28704 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752816AbbGNBnj (ORCPT ); Mon, 13 Jul 2015 21:43:39 -0400 X-Greylist: delayed 81716 seconds by postgrey-1.27 at vger.kernel.org; Mon, 13 Jul 2015 21:43:39 EDT Received: from BY2PR03CA004.namprd03.prod.outlook.com (10.255.93.21) by DM2PR0301MB1229.namprd03.prod.outlook.com (10.160.219.18) with Microsoft SMTP Server (TLS) id 15.1.207.19; Tue, 14 Jul 2015 01:43:37 +0000 Received: from BL2FFO11FD032.protection.gbl (10.255.93.4) by BY2PR03CA004.outlook.office365.com (10.255.93.21) with Microsoft SMTP Server (TLS) id 15.1.213.14 via Frontend Transport; Tue, 14 Jul 2015 01:43:36 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD032.mail.protection.outlook.com (10.173.160.73) with Microsoft SMTP Server (TLS) id 15.1.213.8 via Frontend Transport; Tue, 14 Jul 2015 01:43:35 +0000 Received: from shlinux2 (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t6E1hUPD026025; Mon, 13 Jul 2015 18:43:31 -0700 Date: Tue, 14 Jul 2015 08:34:29 +0800 From: Peter Chen To: Roger Quadros CC: , , , , , , , , , , Subject: Re: [PATCH v3 04/11] otg-fsm: move usb_bus_start_enum into otg-fsm->ops Message-ID: <20150714003427.GA31197@shlinux2> References: <1436350777-28056-1-git-send-email-rogerq@ti.com> <1436350777-28056-5-git-send-email-rogerq@ti.com> <20150713015759.GC27710@shlinux2> <55A38F62.8010509@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <55A38F62.8010509@ti.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD032; 1:4JkACo7AjqrKVLc2syuYq5Zi8EKuSAS45EutvBdLI7pPSbrBOuIU+tAbD10WRchhxlezZ5VofFPbnWiYc+PrOb8pLCk8Ehp7rMT1dG/KOA5xx0PHwigkuED09SRRkVhI9lOreWK9Y4xGwI3Ju3Bhziz5WInMm5Sj1yUVSwolvEq8EvQG8Aii52O2CRe4y/hB06F8BSFwd/B8N/rIs3eDBiC7xXWC3CcRRnRXltq+x4/bGr7a0XDTG4bqwrT3p7/CTnz9FYtuTvkv1GIzBi9vdAEu/cZvqy+naCyWkoGyIUFiWQPsIShyvXljaZy45OaNGY4tkrMlsnPdRK3Wt0m6w0PzvHIMPbdlLczPU961UGPmets18Il7ts6BA7dHBavikHhSl2da5R4zV16R9M8fuiDTIQKXiKxXGQ49TKipcH4OO+Gh+BNGZoOVSCGgcDGWkOtQfWOelvBq0CyY8dCJIQ== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1060300003)(339900001)(479174004)(199003)(189002)(51704005)(24454002)(87936001)(110136002)(4290100001)(47776003)(77096005)(92566002)(4001350100001)(5001960100002)(85426001)(2950100001)(83506001)(110436001)(62966003)(86362001)(104016003)(77156002)(46406003)(93886004)(97756001)(19580405001)(106466001)(50466002)(23726002)(6806004)(33656002)(105606002)(33716001)(76176999)(46102003)(19580395003)(50986999)(54356999); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB1229; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1229; 2:NfVDx4HGZhPmJ2puqhi/KKiuc2pYgJI3uXURmO2WNav3NJwkohaPdu/6jfoUW8ZN; 3:a4hIICGcyxxS+wj2bRu3vCTE8wDNGItV11MPwNZhy7gqICfOpWrbFpuRsBrmFsGqtm5ueBupiNK1+4zwW7TQvSNUAL7pTMuWXDV9ac9mjcjxOIJrGwcKjld9v0u2P2S/Vq4cUb0G0caMwVkAYF+fUDaEI/Jyd0HTg6yXvH1I5NCaNo2AJb3yMd4w+uZkYcMqYcl1CPuv4OjhuJF8D/glZgwSNq0WhWuEDRqcwAxyTwE=; 25:wXSbhw8BvMzImphGvznvCbKHr0a7o3YCkWez4yPvH1QxbErwls4l7FdnshDbhcWYeGozc3b3oTA3I+Vt87fGsPMl6GsyQPAHR7ycjPcWg5ejD6uhSxTLaIeEaxXywh922KkQjUInnToS1jUjN6L4Zzy3gNotWQuwCCPLcomOiCPaHNGFvcA1Kog+VKIiCWChSrXOrdSj9uV0tyajUqpMTG87RANVBhfFvsypT+OqgVy/zRhRIUlWlozIaONeyecB+Clyl6mS0zz3QrmfQFRifQ==; 20:Z8JrH73Ym8EAQGEhhL70Xw+n/KhvWWMlbJFq+T4NAmravH8eSS+d4+c2ADmcfXMpqGoCf8S8KJQxf6pHNmeUg/YmR5RepZ++2wx8ryZtqAiwu1MHzDcRr1D6v7kEZMXQ21io5rFaH91rNtAUsMfzsWTYUHVPGPhPedZf3S79QWU/se8dl+rqDdBGtWsFiYdRS1yUxAoDVVmXk9lIwVTCrYuTG3s1t7AGKfvvw6NYekLbzCNMk0UIQ9QOs7lL+lEaWwL+ec1aEQgHi/K+jkrgTz8Te5SeSIFZ0CEo8cC/g0Zj9zKeYFqIjDPvld92whMWKaK550hdIunZXkEw+M62y6E08 mqdzbFPmtGMuo8CDQA= X-Microsoft-Antispam: UriScan:;BCL:1;PCL:0;RULEID:;SRVR:DM2PR0301MB1229; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:1; PCL:0; RULEID:(601004)(1201001)(5005006)(3002001); SRVR:DM2PR0301MB1229; BCL:1; PCL:0; RULEID:; SRVR:DM2PR0301MB1229; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1229; 4:qb0i3XKxJwVE0TIvPJcdo6wXVNPhN+JC2w+zIa0xnEPGzO0VW1paykydgwt6DhdEwb3bYJYFeXvfzF38VJJX4As10dyVVLYTqgA6ruXJfl/phLOowNtGaB9SeYxlOfKWpa/dod5JBsz5judNFdUsCUeMymnK9294ERktK41oiyN00aY8qSwfqYa60nlBqnod1aO8L9rvaIVKHuHFO2R9OIjVkXWnnTgj/mAE9zKMpLMtpH6N9MBseWhVyDqVYXFOI1IUcQtNx8nUq0ZutnFqJjczVR4KGIsCR0+vm/WEqUJYRMxlqL9XoxOjlbuEdnOa X-Forefront-PRVS: 0637FCE711 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB1229; 23:HBh8RnjQY2b4ZU9ZgVAmfQx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Uew2XuouwkBaEQy7Mxkwh04SZfMuY6tnYuvX?= =?us-ascii?Q?yQDcLdUivz5YOup9oqPOIzDQm+pEEc8qd3c80qHJdm4G8mLHaND/dIv5TjuF?= =?us-ascii?Q?YeUqwTKKNQgKgmaxL3gpxtZvDaJ4eFKw/jvhSaAZQc33bidoz3VbKflc8yuJ?= =?us-ascii?Q?rIX0BG3BKmX6Eerof5vOTFIYSrh+M?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1229; 5:00uVScSur9f8Iv1tGssFMhafBRSQUvvBK997uZT1t6lcvcXkGWuWaqbfgCXeBHdlc6S0XLF++K5NYK91TWAV1xhS0a+m5Dhnl/t9MCox1x7IZe9fGyEFxXMp5u5MvqR34RM9FSqKBCmL8Cjw2rIJ4A==; 24:4DuMp/1yl4llPpFKx0ZKNKmfvI/FwMQdYU9pXxeKzq6tJMQE/JSxJJMlt2nLdgPjvAgSjAbe4AdSBhBCerkEw+jOGlSBfpXTol+D9f2Idos=; 20:sReAXjrpqnULZEwMWRNoYvIt2c6JWUs/VLzQvzvHY+Squ1PDlLCZWOpMZVTN0ZSQTSvjfHvjDO7GcdCuKWt0fA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2015 01:43:35.8798 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB1229 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=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 On Mon, Jul 13, 2015 at 01:13:54PM +0300, Roger Quadros wrote: > Peter, > > On 13/07/15 04:58, Peter Chen wrote: > > On Wed, Jul 08, 2015 at 01:19:30PM +0300, Roger Quadros wrote: > >> This is to prevent missing symbol build error if OTG is > >> enabled (built-in) and HCD core (CONFIG_USB) is module. > >> > > > > We may let the OTG-DRD/OTG-FSM depends on CONFIG_USB to fix it. > > CONFIG_OTG already depends on CONFIG_USB as it is a sub-option of > CONFIG_USB. It doesn't depend on CONFIG_USB_GADGET and that can > be fixed. > > But dependency is not the problem here. Symbols not available to > OTG driver when USB/GADGET is 'm' is the problem. > > e.g. > CONFIG_USB_OTG is always built-in. > we need to work if CONFIG_USB is 'm'/'y' > _and_ if CONFIG_USB_GADGET is 'm'/'y' > below should fix this issue, but we may need to make some changes for code which are defined by CONFIG_USB_OTG. USB OTG is support for a > > > > > Peter > > > >> Signed-off-by: Roger Quadros > >> --- > >> drivers/usb/common/usb-otg-fsm.c | 6 ++++-- > >> drivers/usb/phy/phy-fsl-usb.c | 2 ++ > >> include/linux/usb/otg-fsm.h | 1 + > >> 3 files changed, 7 insertions(+), 2 deletions(-) > >> > >> diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c > >> index 1873eb3..156fd25 100644 > >> --- a/drivers/usb/common/usb-otg-fsm.c > >> +++ b/drivers/usb/common/usb-otg-fsm.c > >> @@ -166,8 +166,10 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state) > >> otg_loc_conn(fsm, 0); > >> otg_loc_sof(fsm, 1); > >> otg_set_protocol(fsm, PROTO_HOST); > >> - usb_bus_start_enum(fsm->otg->host, > >> - fsm->otg->host->otg_port); > >> + if (fsm->ops->start_enum) { > >> + fsm->ops->start_enum(fsm->otg->host, > >> + fsm->otg->host->otg_port); > >> + } > >> break; > >> case OTG_STATE_A_IDLE: > >> otg_drv_vbus(fsm, 0); > >> diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c > >> index ee3f2c2..19541ed 100644 > >> --- a/drivers/usb/phy/phy-fsl-usb.c > >> +++ b/drivers/usb/phy/phy-fsl-usb.c > >> @@ -783,6 +783,8 @@ static struct otg_fsm_ops fsl_otg_ops = { > >> > >> .start_host = fsl_otg_start_host, > >> .start_gadget = fsl_otg_start_gadget, > >> + > >> + .start_enum = usb_bus_start_enum, > >> }; > >> > >> /* Initialize the global variable fsl_otg_dev and request IRQ for OTG */ > >> diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h > >> index c631dde..22d8baa 100644 > >> --- a/include/linux/usb/otg-fsm.h > >> +++ b/include/linux/usb/otg-fsm.h > >> @@ -198,6 +198,7 @@ struct otg_fsm_ops { > >> void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer); > >> int (*start_host)(struct otg_fsm *fsm, int on); > >> int (*start_gadget)(struct otg_fsm *fsm, int on); > >> + int (*start_enum)(struct usb_bus *bus, unsigned port_num); > >> }; > >> > >> > >> -- > >> 2.1.4 > >> > > diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index a99c89e..5e374ad 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig @@ -42,8 +42,9 @@ config USB_DYNAMIC_MINORS If you are unsure about this, say N here. config USB_OTG - bool "OTG support" + tristate "OTG support" depends on PM + depends on USB && USB_GADGET default n help The most notable feature of