From patchwork Thu Jul 7 09:14:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 9218659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 309F1607D9 for ; Thu, 7 Jul 2016 09:25:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20DD4287EA for ; Thu, 7 Jul 2016 09:25:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 154CC287EC; Thu, 7 Jul 2016 09:25:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9ED75287EA for ; Thu, 7 Jul 2016 09:25:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bL5XT-0004V3-PX; Thu, 07 Jul 2016 09:24:07 +0000 Received: from mail-co1nam03on0052.outbound.protection.outlook.com ([104.47.40.52] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bL5Wk-0003Rb-Lj for linux-arm-kernel@lists.infradead.org; Thu, 07 Jul 2016 09:23:28 +0000 Received: from DM2PR03CA0050.namprd03.prod.outlook.com (10.141.96.49) by BY2PR0301MB2024.namprd03.prod.outlook.com (10.163.196.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16; Thu, 7 Jul 2016 09:22:59 +0000 Received: from BL2FFO11OLC010.protection.gbl (2a01:111:f400:7c09::132) by DM2PR03CA0050.outlook.office365.com (2a01:111:e400:2428::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Thu, 7 Jul 2016 09:22:59 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; freescale.mail.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BL2FFO11OLC010.mail.protection.outlook.com (10.173.160.154) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Thu, 7 Jul 2016 09:22:50 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u679M9nX024626; Thu, 7 Jul 2016 02:22:43 -0700 From: Peter Chen To: , , , , , , Subject: [PATCH 5/6] usb: chipidea: host: let the hcd know's parent device node Date: Thu, 7 Jul 2016 17:14:51 +0800 Message-ID: <1467882892-27589-6-git-send-email-peter.chen@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467882892-27589-1-git-send-email-peter.chen@nxp.com> References: <1467882892-27589-1-git-send-email-peter.chen@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131123569788068544; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(3190300001)(199003)(189002)(5003940100001)(586003)(305945005)(7846002)(356003)(189998001)(5001770100001)(4326007)(2201001)(50466002)(2906002)(107886002)(97736004)(19580405001)(19580395003)(47776003)(92566002)(69596002)(4001430100002)(8676002)(2950100001)(81156014)(81166006)(68736007)(77096005)(85426001)(11100500001)(76176999)(50986999)(86362001)(48376002)(36756003)(105606002)(33646002)(2171001)(50226002)(106466001)(104016004)(6806005)(87936001)(8936002)(229853001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB2024; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC010; 1:crMuk3my16wJlH9wzOQZHlbdwsOtSitRqYIETKyMLcnnRHaAt83UOu7ctVqxvZiUSBHTf0JO4PduCNmqilw1uOkHPYihNsS8p3O8m6uta0lzhm0uekTtZ/exPN7mD5M6FlnTYQ9vXOBDPeWVTOXRANbYjjLcA8oVzbl8xQWLeZZzOUIDR2jbQwfAPV7mdZqUF63O9ZRZ7Iqvn/2o2JocYiqU3TFhjYN6JKg+m1i04VTmx90cBeGxGNTA1/FSBGB5ad0BykqMh1MlzUNMRGZZPcneYSG2ln69dOfo0qH+tTq2NcMl2n7dPTSNpNWck8Ie7Oui2ybCq+dna9DZjYWXL4DJh2O37EJk3sh1BY7IRoh0nyAYy+yDXvUOZB3KUonLvKmxdrfZyduKWJwJIrDNw+Epk2BeYt6mqHAga6vbYEsN4jOG48Vf1AGR6cIbyfqunKC+6pmHpm5GQnbthuqCVfd29saS4VJUiDicn85TisB8YBQi+Hp8GzPVygH80Fv3JT/aMnJXFPYSKMZyCgbVhYUOOcrMW3++VuFhK0/5doth32BnGybmbDkkI067Ox7kJ10PEd/e2Xa93ZAid6IOzezb25ss+0RJmeqRKhuimZfiYphc9EF2BBid/W5o9Kmz4/gnBf2YokJREXlTOwO1Gs7kX3OdcLinMazVGxb38hLzRklwjXNZ1QzmKA29Mir3 MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 12890b74-1f39-4422-c163-08d3a648495a X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2024; 2:BFJlpQmkLcJc2VPHu8+yK4MD8wjYgITCafQwbUaUKSqJc/VH/QK8tTinRtr352ybkIzPRh1B8To9b0FBgiKmCyfwVKgMRqGFh2aHAbb6HqpFKD0tPvy2uW0yUnHswGY8j1Yw/31s0rIOPeioivbvC8wJ84r0dU54KJCDZYHEeUVlMmpxaW1dv7pTVYdQgX3c; 3:tDpLJE1PcPberpZ2urYSmpWZA0CD9x7hkOx80EzY02XnJoxmRrXzhlaTULbrT3Rf48KUngY9qqI9yODpGxaZkoKnzbIbrOY5R4wTRK3on7BY52gO7XJ/DfuQIgfJCidCDZZ3/J6bmZdOvIpIO2YFw4XbQydXyRFP1jS6CYNE7M31j/jRnhW7aTEu2LyJmFxp+G3nZcOno5i+Y0mDZtv5VPQLDvvHC7S1iqnrtIbPwE8=; 25:GoJj+cQ9Phb9ONThUGZw2Mq/OYiELRsvvDTweIQm/nL9jOpif0sA27E8wYTpEVUXYSK0/4lAyd2SvQ/ufzCMcyC86HuEJZVqZy1QPYFylTQD4oohUIULBeWa60JwYeKG7VRk8nuV50ztDAH0jUCzWiqNxCcCOQfbz7guBXaaU2nErtWHrdKIBE2g0d+CNZgOQfwaTaIxmHoTP8siBcs78f8LnNihnE1iXhXgTu+qU0yxrstSq2pikvS+rllRutXYE3BoyV0Sr66xpNCqFd1fYoAGvWgbfGmdgTEGvzitSDjJJBGeRmjHW7BvwD5G6mrdp4sCBV0oBUSFYOUMheMJ5TEyaidzjLUUxoX8SWB+C4n9lqbhl/X0QhE3KLq5ZHLwyMnF9ozUjBwonpV8dztH9MIDiQSVlI7aV4TbKPhTlCE= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB2024; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2024; 31:BIkYHESklL7SEp3OKv2oqQ4iVASZx5gYQx1jzOOkSP22DOMwY44Iz+ColyutapK28FpeIiSUhtli+IIyNVtsFrAbhPHYALH8jgCuO1agPyhzQvKgIH4NR/FkC93F6y4l1eI/HDQ+N9sRPYr2J09R7wPJ/DP2OPph2lZscJKfQkhJV2ihM0deNG8fY1ZT1mqAmaoeotmLDJEvV0c+25KJJA==; 4:0fWslSdL1B0d9mwnn1o0VOS5EO8Fa3JW8KRh7SfN2cq1M1dbDdyBUoKT+1N5h1KBBABIXE0ojo8gG0ITeIDa8XndORxS5FEdDiy9VXq2NjLeG/0HcBhkHM8N5UD7hDG6hg3gWZ22kYH+eNqQ40230K08cC+GYMLCYhPpRo+2PFErkLXVSl7EU+KZVoePTJH/i75wLcxhWs/h2cGbG4T78uQFMG4fz14ztzHb9MWPVwZZLWlWxMGU8Uz6+uGI2xS/OXZVXnkxLgv+pDpl9Ap4zt5dRyhJuDVHkNpMFZzbD7wAqzXPAK3zzHHObWB5sj0ltLEmrDPgPk1rkm22g3oxIWBkaFMcb8Ubv0YJcB+vyPiFgVxHFUSaNc1ZsN/xMQ1mrAjZH9ys4qm/grVrPHrsy84YIcM19iwztOH4dYBHY76CXPcMXmCTgwW8XlLosotCZrMDijolpxpFYqDfW/VzPchwGNCitA6XD7KxLD4kErMeM2GvOQmzNsGDNMZGmL2VZE5YVJRk+djz2IjR3FOpvQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13023025)(13017025)(13015025)(13018025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB2024; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB2024; X-Forefront-PRVS: 0996D1900D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2024; 23:AAm8CN4F1lr4LKz3ED5ajYkMySL9zBtUQeUjYUs?= =?us-ascii?Q?AdrCS4bOScPbibnJpFfaMJmltmZtT/0m8aMSgD9mXGHFc3KTe1g3K2rpFNs9?= =?us-ascii?Q?F2eSGnXC+zV2yxCpvhNNnK0L3YW7Z6wkj17NJo8hiw+ABHXOm/lashqbugK4?= =?us-ascii?Q?N9t4FER9BwfVWClN1Jb6Vt0k4KKiDn56/uvlIpao5hMPwkZWMXbFevrKFyHs?= =?us-ascii?Q?ypJJWwS1BZPSco6OAZ/edQvWZPM7KCXVentMkwvJEEm5U31JiaBvl8opGCQu?= =?us-ascii?Q?Y02Ra+F+wbQEOo1t9T2Syucbjj+fBTL6A44u0maN/IWW1AwlW0gXBlAU5moc?= =?us-ascii?Q?q0AhbsXu24AwfWONzuFknEkI0pXgIvQpihlHI6f2CyGnJmowKkoVwUGaEg+m?= =?us-ascii?Q?skj1+3uWK99qpv+6NvMAcu5yZl3jL0dA6+PbZJgwqjZPcdjg2xTXWc7MMeop?= =?us-ascii?Q?VR+nvwek3C3tw2BRNOO35Sfywkxkypd07YRVIehyrNDojWsXODL+nqUHlOYE?= =?us-ascii?Q?WzARV7MBM+z7lP55DdkuBr4m2oEyfk524RpwbqxLCUdwlBDyMSB70mBTY5NJ?= =?us-ascii?Q?heIo4JNk42kLFjNhuS8qB/zxacumKdEpzX5NBLe8x+A7HFZKgJHqHcMd9Oty?= =?us-ascii?Q?n+0q9QYPz4djNNULYkByBnM7pmedey3mKWO9oksPL2yOR1VZokDRbR9lz3MK?= =?us-ascii?Q?pKRkFrdBRHAk1BCaZQYVJECVHdvCYZKtw7GFappa4TPNj1N1uD9oB2rwE6FK?= =?us-ascii?Q?EODbx1J5FXvx396ZxUuvD7XpQMdiGdP9WL3IBehfLBY9ACcPpHgjwoM/KImu?= =?us-ascii?Q?PhCpko+aLGbvfU/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SCGZvb+KehmgStBaAkw0tMh3Lp/lksIGvKlrcdNkAZIsP1BXkQkNzEg0ff7WMPO1ujX7Zrc/HUOaXSet1F5A=; 7:5CBjjxhkCdq0fh5prKbZvwShUp284v4++owLg7uZQWuqUO/J1nFLI1AwUFKj4aQKJbVDisyqNKajdt1uaARtlzcvFyfwKSCyJWQkCDqudGSQhN9kN0MF9U4lr6J19aenex7wLSQkSSLaIThTF5z6eUvzd3Ia8ZgTEUiCP8J3b1H7NhzcZWLnZC6zb5CGsrlzcSEROabtrrew+PRTOwpzdQIuigI+ibx2Vz6waELxdz7FSCxukQdLkdqWAwfJYfbB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2016 09:22:50.1022 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB2024 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160707_022323_204967_81DDF788 X-CRM114-Status: GOOD ( 13.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, k.kozlowski@samsung.com, stephen.boyd@linaro.org, oscar@naiandei.net, arnd@arndb.de, pawel.moll@arm.com, linux-pm@vger.kernel.org, s.hauer@pengutronix.de, linux-usb@vger.kernel.org, mail@maciej.szmigiero.name, troy.kisky@boundarydevices.com, Peter Chen , p.zabel@pengutronix.de, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Chen Since the hcd (chipidea core device) has no device node, so if we want to describe the child node under the hcd, we had to put it under its parent's node (glue layer device), and in the code, we need to let the hcd knows glue layer's code, then the USB core can handle this node. Signed-off-by: Peter Chen Tested-by: Maciej S. Szmigiero --- drivers/usb/chipidea/host.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index 053bac9..55120ef 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c @@ -109,15 +109,25 @@ static int host_start(struct ci_hdrc *ci) struct ehci_hcd *ehci; struct ehci_ci_priv *priv; int ret; + struct device *dev = ci->dev; - if (usb_disabled()) + if (usb_disabled() || !dev) return -ENODEV; - hcd = usb_create_hcd(&ci_ehci_hc_driver, ci->dev, dev_name(ci->dev)); + /* + * USB Core will try to get child node under roothub, + * but chipidea core has no of_node, and the child node + * for controller is located at glue layer's node which + * is chipidea core's parent. + */ + if (dev->parent && dev->parent->of_node) + dev->of_node = dev->parent->of_node; + + hcd = usb_create_hcd(&ci_ehci_hc_driver, dev, dev_name(dev)); if (!hcd) return -ENOMEM; - dev_set_drvdata(ci->dev, ci); + dev_set_drvdata(dev, ci); hcd->rsrc_start = ci->hw_bank.phys; hcd->rsrc_len = ci->hw_bank.size; hcd->regs = ci->hw_bank.abs; @@ -143,7 +153,7 @@ static int host_start(struct ci_hdrc *ci) if (ci->platdata->flags & CI_HDRC_TURN_VBUS_EARLY_ON) { ret = regulator_enable(ci->platdata->reg_vbus); if (ret) { - dev_err(ci->dev, + dev_err(dev, "Failed to enable vbus regulator, ret=%d\n", ret); goto put_hcd;