From patchwork Fri Jun 17 10:09:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 9183271 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 26AD96075F for ; Fri, 17 Jun 2016 10:19:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 143451FF60 for ; Fri, 17 Jun 2016 10:19:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08D2D28388; Fri, 17 Jun 2016 10:19:52 +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 8AAFE1FF60 for ; Fri, 17 Jun 2016 10:19:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDqqx-0007h4-HL; Fri, 17 Jun 2016 10:18:19 +0000 Received: from mail-bn1bon0063.outbound.protection.outlook.com ([157.56.111.63] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDqq4-0006QA-KJ for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2016 10:17:30 +0000 Received: from BN3PR0301CA0034.namprd03.prod.outlook.com (10.160.180.172) by BLUPR03MB1444.namprd03.prod.outlook.com (10.163.81.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.517.8; Fri, 17 Jun 2016 10:17:02 +0000 Received: from BY2FFO11FD030.protection.gbl (2a01:111:f400:7c0c::174) by BN3PR0301CA0034.outlook.office365.com (2a01:111:e400:4000::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12 via Frontend Transport; Fri, 17 Jun 2016 10:17:02 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; freescale.mail.onmicrosoft.com; dmarc=none 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.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD030.mail.protection.outlook.com (10.1.14.211) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Fri, 17 Jun 2016 10:17:01 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u5HAFbSx029984; Fri, 17 Jun 2016 03:16:54 -0700 From: Peter Chen To: , , , , , Subject: [PATCH 11/12] usb: chipidea: host: let the hcd know's parent device node Date: Fri, 17 Jun 2016 18:09:24 +0800 Message-ID: <1466158165-9380-12-git-send-email-peter.chen@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466158165-9380-1-git-send-email-peter.chen@nxp.com> References: <1466158165-9380-1-git-send-email-peter.chen@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131106322218648121; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(3190300001)(199003)(189002)(19580405001)(5003940100001)(229853001)(77096005)(8936002)(92566002)(19580395003)(2950100001)(2171001)(48376002)(4001430100002)(85426001)(50466002)(68736007)(87936001)(33646002)(50226002)(2201001)(47776003)(86362001)(586003)(36756003)(11100500001)(97736004)(106466001)(2906002)(5001770100001)(81166006)(81156014)(107886002)(8676002)(189998001)(104016004)(6806005)(5008740100001)(356003)(105606002)(50986999)(76176999)(4326007); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB1444; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD030; 1:BqR9C6kiiYRmmHVj8xyx/w6dxtFiDZzBnH1A26edz76lsOQrx0uW2Dj4f+4jejNLoTtStqkFLzPniCyZrcr+tgagwkafoZCShym0D5Wa/QYo/+umfwMMJiSpIqHKZHOGEGf3wOIcFWid0XK0W4MWu5UfO+8YrtM4Gt+ze5i1rhvjw8VDTVyt0W16n8VR1zJo/1hDwof2QJ2/E0OQbQkVQXtew4ljb877jq3fqUpCnLRP9baDoOXC9IyCcO506osOOusR6Milz6nVLuHeD7EsKJp7lLztiGtW+i2PIKDBj+peIQgg4UQ6WjScppD9awKadN8ghSX0nSo3Y/+cyGt2kOYlSsRpQWet90FJFrRE/nmjqFwnKgSnXeRQOKg41JsrGoJHZ08iZfoMYGlo1CntZIdH6JxlGM2jwN/G0ysdfVZoplUcCt2vPcZ/jBGdUHqvPWqPe241J9KM89akg10z7VpxwTGmmKlX7Ur5iwX3uWFlm6cwjq0DOFAzju7yAvu/s5gr9Eo2zyomcVd75ja59RdGq7AUzle9fNtWHzMDXzWSUtZdXjtqSscANnCfUZNaln88kU3MGlt8WboLj4Ep+bv58+URxy3BTYodhQ/ce2p2giVqheOszoozDN1kgeZSFgIPWZKt0Vt7IQJPjlgQy+ZkuLubnktn2KWY7FXGp94= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 53f60031-c19e-49d8-20d8-08d39698861b X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1444; 2:B25VhFI/vnxfo9jQwni7vF3hnbBbaV3B5GYM+z9vgYI0is3hkqhDUUi6URB9mYLwnKERM6QhkRRgNZDeI0RkgzKP+tzAdHQYnRpH+1Y7nQfYxrK1oFlFbGnrfNFM53BzO52yW54KezzoqppRyIVxWVWtXu/3qWHOSYgUfZ1mWYfPnXIyvZEDGN1aQ8YL2abb; 3:RRTqoWem7QVkamanBxQ3TUEgMMYh23m/CG4ER9aGLiq8JVUEQjHhc2juksXLF/Sq1mrYh+aU/LlWRwW5gY3+EanJhwiSu5J0TwMPPDqxJelJH+wvnSjF6jmxtJgRODqsKnclVpeUVCUDujK9BM6zpyNMS0yEhu9UHQ7wA/osL9ZbyvN2VuVRvHatHUpuGVJZGvjOvhmKgo0gIMbLWbl7HODQfssO35dumy8rUrHTa/g=; 25:GKjXwd9TuVsiP7IoXnk69EZ3r5pwWHeYRpFhYl5fjoUe/w3K7Ub2jyBIBq314dzLrj29fDXKAh/+yewAsYdB70KKtuB20+iRPNOKxH+sZ9k0Ppu6jl1F3sN4mIgPba5QPmuso2sOVNTJTdUEj5Ef4me1uTtkYJT3mDH1U+TFXQSyVDXSCrb7KrhkYnLP1XYVJVl/U2JwUNDxmm3R2ia20wzYDMQ+MlBT/MdR+7JviNNzhUT36OiqQ8H7iQiAP1ZGYucA6erMggsxYh4SHh/Rop/u7wrpOvqgPNrRcY04t2jefu2Zz1fR4pkXZeq6wT89ubEh/n1np8YagcG71mQZohU5cIYIUaoizjbgbr1VN3Nu60t96DlpNpDFpx3F5fBiCb3AAkFA/lsovsV0tt+f1lQct7ySJomgCcVgjkuPr4Y= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1444; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13023025)(13017025)(13024025)(13015025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BLUPR03MB1444; BCL:0; PCL:0; RULEID:(400006); SRVR:BLUPR03MB1444; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1444; 4:/ZUsEJXW5CEnDXHXxnJsVITS3j7ffCQim1GT76EzusR6cQf37xKCjWzibaq25VdGE+noFIZRuGNsydg62NWuO69jIgl1g7rG3D2MXoN6CuebLO+EZZ6GNiBG2zYk1YcWcAf0xVQShGIrmvkVa4dkGepf0ccd/Z/Xj/8RZz06f3hQ41QlwXC+WMwqjO2H7rvfUtYeikdGUPBM267ac0WMO7Jn27dUzd8FLyqcZLMLblsyM8ep064cpkKBrgkyzzGCiHfLeLeZZwLjNq4eo0MjjWtHVPxos0WtSeqE37THsX0UIcn2MFuD7JL9ouS/4ysRcJIT3InoYb+cLDfT2aYM/WcZZjvRXF81jleze27wjzUTeVvRMZqrYYhdCE/Re8yaNTnkcGu9qovZ4yJMd8DIhCqVstWiLhb3FPc40mqzltBdVLVjx+AhHA8rLHPb+u6xNEnvo2g2mEmWiXt8Yr1ikdzSx85jovVF+h/2tLiH3yOCR/teMZtJ0vvm3KQe02inUojh4cby2Gt4inOlWAEDKQ== X-Forefront-PRVS: 09760A0505 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB1444; 23:ZwfgN3evlsZXVfxtSJOa0fiGio5M6ot6ufiKdx3/n?= =?us-ascii?Q?Q4kcUJgS38J2HV0yPFKGfMSvVEP8VgN5td5b+rzrs4AuSs1wVm/MxLDkTHj4?= =?us-ascii?Q?pwuqIpTsxifH9TbeklsejzehlU0tJGrBqr8ssRO0tyEWzi0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fyyAa+xf9WLG0l5gVJC9lqwYYXmLHBZOcQcW3oZT4r7EmIkuXSC20kn6xsOAZTMahvExLx331or4nKtr3KlJQ5GEgZrQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2016 10:17:01.6464 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1444 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160617_031725_144268_60E80408 X-CRM114-Status: GOOD ( 15.68 ) 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, linux-mmc@vger.kernel.org, mail@maciej.szmigiero.name, troy.kisky@boundarydevices.com, javier@osg.samsung.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;