Message ID | 1450431239-16439-5-git-send-email-peter.chen@freescale.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> X-Original-To: patchwork-linux-arm@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 787029F1AF for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 18 Dec 2015 09:41:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1124204A9 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 18 Dec 2015 09:41:06 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id B6730204A2 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 18 Dec 2015 09:41:05 +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 1a9rVq-0003oQ-Rh; Fri, 18 Dec 2015 09:39:46 +0000 Received: from mail-by2on0126.outbound.protection.outlook.com ([207.46.100.126] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a9rVA-0003BQ-U1 for linux-arm-kernel@lists.infradead.org; Fri, 18 Dec 2015 09:39:05 +0000 Received: from BY2PR03CA059.namprd03.prod.outlook.com (10.141.249.32) by CY1PR0301MB1996.namprd03.prod.outlook.com (10.164.2.14) with Microsoft SMTP Server (TLS) id 15.1.361.13; Fri, 18 Dec 2015 09:38:43 +0000 Received: from BN1BFFO11FD055.protection.gbl (2a01:111:f400:7c10::1:136) by BY2PR03CA059.outlook.office365.com (2a01:111:e400:2c5d::32) with Microsoft SMTP Server (TLS) id 15.1.355.16 via Frontend Transport; Fri, 18 Dec 2015 09:38:42 +0000 Authentication-Results: spf=permerror (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; Received-SPF: PermError (protection.outlook.com: domain of freescale.com used an invalid SPF mechanism) Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD055.mail.protection.outlook.com (10.58.145.10) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Fri, 18 Dec 2015 09:38:42 +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 tBI9cGKo020738; Fri, 18 Dec 2015 02:38:37 -0700 From: Peter Chen <peter.chen@freescale.com> To: <shawnguo@kernel.org>, <gregkh@linuxfoundation.org>, <stern@rowland.harvard.edu> Subject: [RFC PATCH 4/5] usb: chipidea: host: let the hcd know's parent device node Date: Fri, 18 Dec 2015 17:33:58 +0800 Message-ID: <1450431239-16439-5-git-send-email-peter.chen@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450431239-16439-1-git-send-email-peter.chen@freescale.com> References: <1450431239-16439-1-git-send-email-peter.chen@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD055; 1:QzMxTf/Mq4QnB3ovwif6mYCfLiY63XGnuXPj9cGT7h3UeqMqLJ9GXeP+JxH8X93LHC0AabgFMcsJGJPpuafUaa+ybYf5w3HutflmBo/vth6XUbaboG/dGx/WX2vIZijt27NsGPsMfR/E9Ik1xbm5aeUJ0zmwREfOUgToQvUEwwRIyMnx2JheBl6bFHCbYnUtoOX0pjrF4+0yoZHuivMSsULZrdgbmbSg31I7eaqZQO5RuAtf8BcXRQ6Q9ho3bYEDGmRz1Hkcb1Gp+vesc2Wyo6be3qpBFAwvzllJhVOGzSa9fym3oZLNOeRzuBNMRYX2JaotkIoQG7AOMCN/+vCvzHGGqDdv+jWGdMDveoecTGTBp2eBiq+7tWs+zb9auGkibNY5H90CAGAqxUbaEWaQe4J52ZK17zohhqRBrGEVd7FyRRP8zpecT1St5glqUUYg X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(448002)(3190300001)(199003)(189002)(69596002)(19580395003)(87936001)(33646002)(92566002)(2201001)(5003940100001)(86362001)(106466001)(586003)(85326001)(97736004)(1096002)(50986999)(5001770100001)(81156007)(47776003)(1220700001)(76176999)(2950100001)(50466002)(48376002)(2171001)(36756003)(4001430100002)(229853001)(50226001)(6806005)(104016004)(189998001)(11100500001)(19580405001)(5008740100001)(77096005)(5001960100002)(107886002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1996; H:az84smr01.freescale.net; FPR:; SPF:PermError; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1996; 2:sxO/zRuJHf087ROzlUlVB8F1wUuPzjxRJLXkWT9bz5ZUWuzr6suDHUzeOF9B3yoo33cOVDuS7fQweynJAlmX4OQXqZf5XYHV8CMLID7gtMLyeMRJixrIhOLQtV7Y2tTDPnjuWePnLU87dLOuL98RLg==; 3:gk0DM9PwIma2zKvqsnymrohyew2uATUcPm+ETVDp6z/LHL+uEpDA77kkppZgZnym8Kea+OL5XEm1wvghswXtOd0tkjVqRkXsWc9SpbDXhgQHVvbBibuzM8NwsBtOBMtCwaChQYry6jMkj7XUX2GvLb0ZzhVDSudTQGDOTngPEl7W6ZwO5owAS76SwtSBIt4kr1jA3pyb2d80H7geA9k6rOJO166suuQYi25sub9hZxI=; 25:F4VG/8Y2+gukc/OvLDSmVwvfHq82oAlO6Sfq5kNtR/r47qL8U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WINR+hi6TKrcEdns0psPW1eKYJjArWZEF1/hlAtBBivemZUFOZV1on+oqiaBD6d X-Microsoft-Antispam-PRVS: <CY1PR0301MB1996E96E7F71A686F57ED46981E10@CY1PR0301MB1996.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(10201501046)(3002001); SRVR:CY1PR0301MB1996; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1996; X-Forefront-PRVS: 07943272E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1996; 23:Xixp4WFvwoHfa6khoyiVcY3Pmjh7KU+Ji3uyT4r?= =?us-ascii?Q?/O4lmRZAf+ozQXSXNcGV4hfI9qCfJtO7xP6UQGYFlyYDP3HL0xLg79lHVGIB?= =?us-ascii?Q?ibwyP7aD7E95nErmYAO25yTnav/Gur7Es9EJ5v1aHXH1NNamYkKlQGCdEILi?= =?us-ascii?Q?2OtpjUE+q9AdbBXL8izmfF72Xu2n0Omtzi57/soURi9AGRpyIBlixVmFIfV0?= =?us-ascii?Q?BZFa6SW+qpWeJukb9n2IYRX1Qx1fXNeA7cG7ZFZzys0XAlNV7fbc7toiADuA?= =?us-ascii?Q?lCYWuGv7e4T8wwZtYBRcpniM/un6wMCTynaIHLaJmVJT1HQnj6wUIa2aqyun?= =?us-ascii?Q?+Q+H1rh0QdPYKiBvaCcDIsFWock5qE3dNY/wEU4kWiPy0EzvMcCGlKQEGNa7?= =?us-ascii?Q?GO29I8Uqjdnr/nghaRgvZyQ8y8WLGVXWW5EIqivyFIClvPAoEYm3tJx8Fy6A?= =?us-ascii?Q?vIjyvcWYnDqPmCusY/P+2NuFcA68GwLjvkrK48CqJU5nPdyhmtflKSlPbxAV?= =?us-ascii?Q?5uY8CpKZeCg0gAwzZb8Pciyink/eQ2DFrklhDD8u9sJOb1oLkO5Qf4oBWPcx?= =?us-ascii?Q?XpULvOz0O5a64zLEXC79mdxQnPjve7bnd10kjgd2D+CneIiaerIP43WuQmte?= =?us-ascii?Q?h2hcz1gf0gGPNUWJ8mcyjxUQvwQw+Xr+qWfFp/lMEK95PDCq9B2CxH7xQdeN?= =?us-ascii?Q?Mlmw5JQ9i+Xz15/0hKHuPmlx6pt3TyP+1SIrtACg7P7AjcCN5qOpsTmGDKyK?= =?us-ascii?Q?FwwYYW/VmO0ua8gIdrOnFY2RrDdleCg10gGDM6Xw3/NFNHfn+Sq+367ptpBy?= =?us-ascii?Q?++vXO4UkBSW+Ox/5Nhoutx5eL1zt4hAI0zPlqBK8pC73la17xFC6P8lPDrI7?= =?us-ascii?Q?lnHJJHBHXF/n54U94I8RcwxpsNd//EfSkLMj46Z2yN+fj+c0Uq6nemprX2iE?= =?us-ascii?Q?XIqYqBcOjKhD70QbFyNNSt22gzeSwF0+71KpM/pTwj0ylT3dcDKoUJk4EBlw?= =?us-ascii?Q?I3AI3GT5DpUu9y1TkTfaXRzxSkNlTEKfxOZEDehvu3dTQx4TF1twi9tnmted?= =?us-ascii?Q?g7DY4h6OTHA2BhQio5WROn7WPmwNbSfIH2p9i5v2rAKMIgJXnvAdLfWPbp05?= =?us-ascii?Q?GSFg3C0C7cwN9DhKZUCnkZznIbzJwgIz3?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1996; 5:KmVzv9R6cXR0m5DVHhD3K7wKasdPEcR1OJD1Mk5Q+EiUS9O/q3V7xEPM/uGlHgP+DFZ7EXhAmP0VTfyaF1sKj0v4FLOylyKCQBIcK5uzs9htT28XEaPykDqxTynHSrKyBnnrIDLLbj2Plcvo++0ULA==; 24:2QnD/LzsC3ADMXSywzibg1nep3UkEuNJicdjy4xssuTf2oPo25PlNKt4YNRIW0pi6GkBrdGTi4Zub4okgfddln5WOV67C2WvaUYlMo+RJ6o= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2015 09:38:42.4460 (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: CY1PR0301MB1996 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151218_013905_054131_32471FBA X-CRM114-Status: GOOD ( 15.03 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, p.zabel@pengutronix.de, pawel.moll@arm.com, mathieu.poirier@linaro.org, linux-usb@vger.kernel.org, patryk@kowalczyk.ws, balbi@ti.com, robh+dt@kernel.org, arnd@arndb.de, Peter Chen <peter.chen@freescale.com>, kernel@pengutronix.de, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 |
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index 3d24304..63a6aa4 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;
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 <peter.chen@freescale.com> --- drivers/usb/chipidea/host.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)