From patchwork Fri Oct 11 05:42:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11184823 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49ACA15AB for ; Fri, 11 Oct 2019 05:42:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 207DE21D56 for ; Fri, 11 Oct 2019 05:42:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="YMfMKboI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726205AbfJKFm3 (ORCPT ); Fri, 11 Oct 2019 01:42:29 -0400 Received: from mail-eopbgr60062.outbound.protection.outlook.com ([40.107.6.62]:35510 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726116AbfJKFm3 (ORCPT ); Fri, 11 Oct 2019 01:42:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bL+2PNtBZXCRPDVe3qAmXnnaFzWTn0YHVzIBF+dIxqgLUEsndjspKtA0TMVCfFzb9SgIwHxgIlxrcGmibSP0fXr9Bwe4U2lSAegIWgdUU/utA9wW1Ieo3WubuiL+12y3Hc6fVNdA4jO4xkCXeCkyMp6PdsNzm/FHXlCCAjoVi3QFR6BqwEP5kSuc1HIQC7qe2fZARbIpIUPGDmSNtP0NH/qRIs46/WRPswrUxr4RkQUmh2BSfz0hy4ddsOiRulEPu7PAyuyM4xw5KHbb31oykTaJM5Khkw5NR3jW5TFMKxfGQn819M5C6Pkppw3akLOQ24oPd/ZQALH21qe4puhCzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5W3xgHYF1T8WBlQn92j0FEqMy0bsddlU/fcBqbBJpgo=; b=eryHpW+79k+3iVSaKGndf6d92qgO3Vy3VxrqDqKrosHc5TLXyX0RVxSmjhyoupe4oNO4URX5Lx4+vETdthO7raIKoSj7HKfM9SRVutTocnXt1yN0SuFbftwNTdZILJgJDZCpzlJhVqqRhDNmq7f9sJF13mOuUiOsV6kfBzwljIUkLaB3JcqxGPXfXZJCCeUlhkjPcgP6S+oIkvzh0KLYa5gCOWR2bBM7x8DHkQiIMdOmmYXP8l4U8k6267euoM2WQLWHOMP8arf8+jd8q/mQNUnuOYv2InaXafHHfeZO3yYs9FFR/rt+HZGwJqlLN3fxX6vXi/cVhswaioRan+an5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5W3xgHYF1T8WBlQn92j0FEqMy0bsddlU/fcBqbBJpgo=; b=YMfMKboIUBX+qKKA7KWE/JZG6caqscsZDoA5kHKpJVMUh2QGvqGCLsnb1FpdUB1J2eMi/Tu7ZtA/pzcZPoKHvyhAGBnJ6c2rP3xv+GevNv/sLY+E5VEgqdnlCVkA2Ebdpb6lZSnt51aZnQrXIynq7rhvKw9KIkG3wKRz9C73YII= Received: from AM0PR04MB5314.eurprd04.prod.outlook.com (20.177.41.157) by AM0PR04MB4915.eurprd04.prod.outlook.com (20.176.215.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Fri, 11 Oct 2019 05:42:25 +0000 Received: from AM0PR04MB5314.eurprd04.prod.outlook.com ([fe80::99b0:3cb8:e409:1798]) by AM0PR04MB5314.eurprd04.prod.outlook.com ([fe80::99b0:3cb8:e409:1798%6]) with mapi id 15.20.2347.021; Fri, 11 Oct 2019 05:42:25 +0000 From: Peter Chen To: "linux-usb@vger.kernel.org" CC: dl-linux-imx , "git@andred.net" , Peter Chen Subject: [PATCH 1/3] usb: chipidea: imx: change hsic power regulator as optional Thread-Topic: [PATCH 1/3] usb: chipidea: imx: change hsic power regulator as optional Thread-Index: AQHVf/apXptcQx3r70GtQVZl7qMxQw== Date: Fri, 11 Oct 2019 05:42:25 +0000 Message-ID: <20191011054129.20502-1-peter.chen@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-clientproxiedby: TY2PR01CA0024.jpnprd01.prod.outlook.com (2603:1096:404:a::36) To AM0PR04MB5314.eurprd04.prod.outlook.com (2603:10a6:208:cd::29) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peter.chen@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e5388757-f3f8-4cd8-75ba-08d74e0dcb50 x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: AM0PR04MB4915:|AM0PR04MB4915: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:390; x-forefront-prvs: 0187F3EA14 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(376002)(366004)(136003)(396003)(39860400002)(346002)(189003)(199004)(6436002)(2501003)(2351001)(2616005)(14444005)(256004)(6512007)(8936002)(5640700003)(50226002)(6916009)(486006)(8676002)(476003)(186003)(81166006)(81156014)(44832011)(1076003)(26005)(386003)(305945005)(54906003)(52116002)(66946007)(102836004)(316002)(5660300002)(86362001)(36756003)(71190400001)(64756008)(66556008)(66446008)(6506007)(6486002)(66476007)(3846002)(6116002)(25786009)(478600001)(14454004)(71200400001)(4326008)(7736002)(2906002)(4744005)(99286004)(66066001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB4915;H:AM0PR04MB5314.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8WwBd+6gXqtkAElP8vvqd8uYanmwZ/RgsFxvyb/peRHLyrQqahERw949Ca//WNGSWVCIas/vxMjKEsOahZ/RlJr+A2JQsnIkVsYg+ToLiAh5jAQ0A7JG74KLFKvTXkIliBoMHiazs8bllA6hLAluAtMBchI70uWxZPZQZV5sNbybL1RPKSSEEgQqiWwRS8s9PXKfM/Ieulq1NKtHIJeasRc47ZHX60OXqpjxx148AGOwBDy/0NX3tjFL+ADlb4PZRXqHY4avoxJ96YhvhV9gW9NkAv6ZlzDbZQi/a9Ynz/leSfwDMfJX7paoFv5krSVdUgyKwWKCdrvbWX+3q37MIvhkKOwahnShTjlS1KWRhQKAEFmH58DpmUFjrF1fKDBgD3tKtgpk+aFiui/XMLqqN37b+FCidNAjST4KwvDwftk= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5388757-f3f8-4cd8-75ba-08d74e0dcb50 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2019 05:42:25.3611 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lMfnhoq6ScM3d0QX895hwaUSPCeglQtf/4ncCutM7brPXAbziCTsGObq+muspl6md4alr3PO6vwDxLT+yNvXaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4915 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Not every platform needs this regulator. Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 16700170bc34..25a38ed27aa8 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -359,7 +359,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) return PTR_ERR(data->pinctrl_hsic_active); } - data->hsic_pad_regulator = devm_regulator_get(dev, "hsic"); + data->hsic_pad_regulator = + devm_regulator_get_optional(dev, "hsic"); if (PTR_ERR(data->hsic_pad_regulator) == -EPROBE_DEFER) { return -EPROBE_DEFER; } else if (PTR_ERR(data->hsic_pad_regulator) == -ENODEV) { From patchwork Fri Oct 11 05:42:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11184825 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B362112B for ; Fri, 11 Oct 2019 05:42:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4334D21D56 for ; Fri, 11 Oct 2019 05:42:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="rol2xY0j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726281AbfJKFma (ORCPT ); Fri, 11 Oct 2019 01:42:30 -0400 Received: from mail-eopbgr60062.outbound.protection.outlook.com ([40.107.6.62]:35510 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726174AbfJKFma (ORCPT ); Fri, 11 Oct 2019 01:42:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GaL10hbZ4SHpeCHeoR6VUaXVL8qEhgpwr2RmKvYHPhpukI+SYRMOecFQeJeKXmxHChZJjORmQfjk8Y/z9Hu4xS8T+VhuI/6UIqU81QcsWk/SE1zOM7/lssdKtp7NMRJmtMDp2RjsbtUSHqEfyPlPM9feoFj1Vd+t7qVxFYWGov0wO/Gh9rzt9//0e70xZaKjND8A9zaGbr+GdSmC3rp588295cr1bFaYqCGTQEQpZmoiuJhjuOmb7Afbq9cksDTiYwv3uSXuL+U+HHCgg7QEgGzrtsMYgBiJVHEX1gt0xRVN24be1BpKltdpciEdK0bNKxC0czCMr3G9Bl3vf2MqfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8ArEl6B/UMbrE3p3K0bGbCP+xF40/CjJrNu8+63MKXs=; b=Hu/gnQN0vcGH4WY7FHpXyfdgsixW5n71n8GLAKdHRPlpp3VqP2R3pwgHGOvy4+OC8+WWKdtTETSpeNV12rhgVx7A/iD1fUQw0joDs5Phr5VhOl4shj0kn00RXzmruHJHrdEoxcEvXhBStZWApjtvZqdXCmn/zfHIAlvB8gvwI0+YZBME64HKqwdHIYiNfQgk0v1ayznaQb4f6Xtaree5+v2aMMsfr8BwESPzO6nFaY5YHPWtwdm3V6v+3xzCuByQ3tfEP+tTiCRcaTGRCUo+SFMBpystOdhlowO/5ShOD6fzcLQIQdpL8PZ46MD2VYlyohhxYxbrbJlP+munoQq8Xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8ArEl6B/UMbrE3p3K0bGbCP+xF40/CjJrNu8+63MKXs=; b=rol2xY0jFwIzl6Ctyp0TYW1cUA4dndjLRFJZYfDiVK48SL2Zsx9tsjbRDNh7JewPSOtNQx0sIn9H26Nem29VhLJ8YJBssw7FrC2/NVZ830GU/BfgPCDtG82geDkunMWnx/mjp36BDGdXm8Xc0vGWWPqIP+Q2qvn6my+bibCegHU= Received: from AM0PR04MB5314.eurprd04.prod.outlook.com (20.177.41.157) by AM0PR04MB4915.eurprd04.prod.outlook.com (20.176.215.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Fri, 11 Oct 2019 05:42:28 +0000 Received: from AM0PR04MB5314.eurprd04.prod.outlook.com ([fe80::99b0:3cb8:e409:1798]) by AM0PR04MB5314.eurprd04.prod.outlook.com ([fe80::99b0:3cb8:e409:1798%6]) with mapi id 15.20.2347.021; Fri, 11 Oct 2019 05:42:28 +0000 From: Peter Chen To: "linux-usb@vger.kernel.org" CC: dl-linux-imx , "git@andred.net" , Peter Chen Subject: [PATCH 2/3] usb: chipidea: imx: refine the error handling for hsic Thread-Topic: [PATCH 2/3] usb: chipidea: imx: refine the error handling for hsic Thread-Index: AQHVf/aqoz0J9aOI3UyENrY4GDYyQA== Date: Fri, 11 Oct 2019 05:42:28 +0000 Message-ID: <20191011054129.20502-2-peter.chen@nxp.com> References: <20191011054129.20502-1-peter.chen@nxp.com> In-Reply-To: <20191011054129.20502-1-peter.chen@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-clientproxiedby: TY2PR01CA0024.jpnprd01.prod.outlook.com (2603:1096:404:a::36) To AM0PR04MB5314.eurprd04.prod.outlook.com (2603:10a6:208:cd::29) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peter.chen@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 712581fb-5484-4b01-a3a9-08d74e0dcd1b x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: AM0PR04MB4915:|AM0PR04MB4915: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:146; x-forefront-prvs: 0187F3EA14 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(376002)(366004)(136003)(396003)(39860400002)(346002)(189003)(199004)(6436002)(2501003)(446003)(2351001)(2616005)(256004)(6512007)(8936002)(5640700003)(50226002)(6916009)(486006)(8676002)(11346002)(476003)(186003)(81166006)(81156014)(44832011)(1076003)(26005)(386003)(305945005)(54906003)(52116002)(66946007)(102836004)(316002)(5660300002)(86362001)(36756003)(71190400001)(64756008)(66556008)(66446008)(6506007)(6486002)(66476007)(3846002)(6116002)(25786009)(478600001)(14454004)(71200400001)(76176011)(4326008)(7736002)(2906002)(99286004)(66066001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB4915;H:AM0PR04MB5314.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2PUrJNdqX7HpfJWpAmlSR8CNG4BMbOUq4WpfhEoEqXS9cHmZ8w3saJeX8s6b9nZTCtZ4dnq6SmWQBpbdj2kk1XhGdY38+oYVluwE01/qWggK8lKR8r8FFJB1wwkBuCCS0UiNmgj5SEZYBydPOnLPhVq/ehov68oklwmwaGltz5BSvuc1NOuivdrVTTpHRGj7+v9+nSxb8RQRleLTkruvNAvDra9awDLFf+y0tnKXby+bvzaEifEATJPLbmrHNEpT8xfcuVI3fEgh2hILKt/EZxcyT+Lkldt52jE55Sl+sIooIgAPr7srBgbuHgh8degPqIE55WgVTHzW5tlLFSynrkUIB7If02oBohhDkRrDykQ+lDfvHpExkFAK/FV+36G1HJf3wbzEbjxnMa32NWA/C17Ks+zrjxYGbJ1n99h/4bQ= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 712581fb-5484-4b01-a3a9-08d74e0dcd1b X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2019 05:42:28.1455 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eaMyeGmycg+hZUMESTGm5vr+UDDjC1w0kxB/whzL6rSXaxPfX78SHQj5qVPdZDPd0c37YuLFotYUoTUDM2DD1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4915 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org - -EPROBE_DEFER is an error, but without need show error message - If pintrol is not existed, as pintrol is NULL Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 25a38ed27aa8..c34fcc079cd4 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -330,8 +330,11 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) pdata.flags |= CI_HDRC_IMX_IS_HSIC; data->usbmisc_data->hsic = 1; data->pinctrl = devm_pinctrl_get(dev); - if (IS_ERR(data->pinctrl)) { - dev_err(dev, "pinctrl get failed, err=%ld\n", + if (PTR_ERR(data->pinctrl) == -ENODEV) + data->pinctrl = NULL; + else if (IS_ERR(data->pinctrl)) { + if (PTR_ERR(data->pinctrl) != -EPROBE_DEFER) + dev_err(dev, "pinctrl get failed, err=%ld\n", PTR_ERR(data->pinctrl)); return PTR_ERR(data->pinctrl); } @@ -361,13 +364,13 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) data->hsic_pad_regulator = devm_regulator_get_optional(dev, "hsic"); - if (PTR_ERR(data->hsic_pad_regulator) == -EPROBE_DEFER) { - return -EPROBE_DEFER; - } else if (PTR_ERR(data->hsic_pad_regulator) == -ENODEV) { + if (PTR_ERR(data->hsic_pad_regulator) == -ENODEV) { /* no pad regualator is needed */ data->hsic_pad_regulator = NULL; } else if (IS_ERR(data->hsic_pad_regulator)) { - dev_err(dev, "Get HSIC pad regulator error: %ld\n", + if (PTR_ERR(data->hsic_pad_regulator) != -EPROBE_DEFER) + dev_err(dev, + "Get HSIC pad regulator error: %ld\n", PTR_ERR(data->hsic_pad_regulator)); return PTR_ERR(data->hsic_pad_regulator); } From patchwork Fri Oct 11 05:42:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11184827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C55B615AB for ; Fri, 11 Oct 2019 05:42:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C3FF21D56 for ; Fri, 11 Oct 2019 05:42:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="OLiVqi+f" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726299AbfJKFmg (ORCPT ); Fri, 11 Oct 2019 01:42:36 -0400 Received: from mail-eopbgr60073.outbound.protection.outlook.com ([40.107.6.73]:62878 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726174AbfJKFmf (ORCPT ); Fri, 11 Oct 2019 01:42:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uzv+jjc6qtWyYQOV9RSiykYLpcYz5sUaqtbIj8MykKxJ+iEfncmOfdr0Mz/yL8jueyif1VXUacb2U8/lLE1xlFfxdQFUHBUhqWCa4bP8rK1CyQtzUfz+rJ7Q3+jjrrHqIknmlCROz6FXDgB3TTxdatSeo+/2Pnz3VUjEJCsZdosEnLy0CUWYEjOfWsHk1Zzz8VVKd7cw+9PudG6vFKSRjfY+Saf6fB0kB6+krkFh63am3lvUjwFyb2QOTqfk6VSZgM6sbSizxwuGT9glLxFC05K1YeU0oMd2gaEFm4g9OgRvfZucqZa4qxUWvOlpkA70XF2F8xLR1wVI89+8c9czLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eCnyjx2pNLho7fw8/gE7ZHKqHepncWcuOGmM7JFEO1E=; b=FfEXZuzJ5h7l9zBNSVFjLfvW8QWhL8TlLE59qz9InXciV4XRddFgHH5A6lgGds91GdCCbPhPFJabSki39gFVf7vCnCtzxGI656FYaM2ql4sgTXGtJ5rDrs9Qsv/WyqAPRXQpy/k6v1T6jlTypAa9UE/jRxf8mYWVX8Rpqe7RdE38Cprh9LqzyQLD0kJXUSBq9z1ciiw7bEHJQCZODgChdgX+2dHaJhdxpOcYoc7HncBuKMJRfQTL3GfmJ7P1m04U4oW+7oBZTg2SuitxGhS1skH4KXdljxSXG4k6cD+1bnCQY4XIxHaB0SCZouOjJZaceHZoUOYNv6Z7hW5ojzskQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eCnyjx2pNLho7fw8/gE7ZHKqHepncWcuOGmM7JFEO1E=; b=OLiVqi+fabZulkn3mWrIzkM8sL93hAVIf6FR3sAPbKsLW76BzARKefcMcF0R/iM8pW+TKdl09fo9fkvzJbOqAGU7wMnU88xzdqfBr9aW1WZYOpWqTm6rXRHMwGuKNl8Dp9xWSVyZLvdZ1yYrIRayatoGtozUgHZfn1tffEKflVM= Received: from AM0PR04MB5314.eurprd04.prod.outlook.com (20.177.41.157) by AM0PR04MB4915.eurprd04.prod.outlook.com (20.176.215.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Fri, 11 Oct 2019 05:42:31 +0000 Received: from AM0PR04MB5314.eurprd04.prod.outlook.com ([fe80::99b0:3cb8:e409:1798]) by AM0PR04MB5314.eurprd04.prod.outlook.com ([fe80::99b0:3cb8:e409:1798%6]) with mapi id 15.20.2347.021; Fri, 11 Oct 2019 05:42:31 +0000 From: Peter Chen To: "linux-usb@vger.kernel.org" CC: dl-linux-imx , "git@andred.net" , Peter Chen Subject: [PATCH 3/3] usb: chipidea: imx: pinctrl for HSIC is optional Thread-Topic: [PATCH 3/3] usb: chipidea: imx: pinctrl for HSIC is optional Thread-Index: AQHVf/as820hEURzI0yo31E55+YF3g== Date: Fri, 11 Oct 2019 05:42:31 +0000 Message-ID: <20191011054129.20502-3-peter.chen@nxp.com> References: <20191011054129.20502-1-peter.chen@nxp.com> In-Reply-To: <20191011054129.20502-1-peter.chen@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-clientproxiedby: TY2PR01CA0024.jpnprd01.prod.outlook.com (2603:1096:404:a::36) To AM0PR04MB5314.eurprd04.prod.outlook.com (2603:10a6:208:cd::29) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peter.chen@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0100a91d-004e-4f0d-2efd-08d74e0dcec6 x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: AM0PR04MB4915:|AM0PR04MB4915: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:569; x-forefront-prvs: 0187F3EA14 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(4636009)(376002)(366004)(136003)(396003)(39860400002)(346002)(189003)(199004)(6436002)(2501003)(446003)(2351001)(2616005)(14444005)(256004)(6512007)(8936002)(5640700003)(50226002)(66574012)(6916009)(486006)(8676002)(11346002)(476003)(186003)(81166006)(81156014)(44832011)(1076003)(26005)(386003)(305945005)(54906003)(52116002)(66946007)(102836004)(316002)(5660300002)(86362001)(36756003)(71190400001)(64756008)(66556008)(66446008)(6506007)(6486002)(66476007)(3846002)(6116002)(25786009)(478600001)(14454004)(71200400001)(76176011)(4326008)(7736002)(2906002)(99286004)(66066001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB4915;H:AM0PR04MB5314.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fX/5iM0Gnfo82xheswE7SRDeai5b8BkJhQIz12MbkslBe2YJddDB6nbPv8vo+dkXHOCDzJRV9i8E/zH1/Pm8EjE1K2VSyufkozT+IfVDXZqVJJzsVrP8iRcw2mXgRzxjD9krUVYwG6MmA8tUwaKdSAbt5GjGGOFIxS9lKCoiMOxoD8mRly68Te0vlcSoxMLpWQJUV5oZAObWNqeFVxGg8HteiGee3vDGnBFbXk1TOQ963hng6NNwhca25Ieqqd6viwA3gPD7VFiKDmdHNHlwFjPcikgrGNRkiThNhgZmx2JE/1oB9yVZ8MjtYiXL15Rz4Fo4jqDHkfWkkH7qN+8DMX8gNTDiAumD683HRsPXLTcPNk2OcPSP4/FRFQUK0pHjSZ31gcn2vbqhwIuIvFVNUry11BE6u0gEZ57xTKukD2Y= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0100a91d-004e-4f0d-2efd-08d74e0dcec6 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2019 05:42:31.0498 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ROK63+rA1kkQYOxOXF/6Hr7C0CQxhO6nfIEv8KzC/MH/T2qTWXrhBhk99UCnyGlGZ8dfGZsZ/oDKLBu6muPAwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4915 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org For imx chipidea controllers, if they use mxs PHY, they need pinctrl for HSIC. Otherwise, it doesn't need pinctrl and usbmisc control. Like imx7d and imx8mm. Reported-by: AndréDraszik Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 63 +++++++++++++++++------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index c34fcc079cd4..d8e7eb2f97b9 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -274,11 +274,14 @@ static int ci_hdrc_imx_notify_event(struct ci_hdrc *ci, unsigned int event) switch (event) { case CI_HDRC_IMX_HSIC_ACTIVE_EVENT: - ret = pinctrl_select_state(data->pinctrl, - data->pinctrl_hsic_active); - if (ret) - dev_err(dev, "hsic_active select failed, err=%d\n", - ret); + if (data->pinctrl) { + ret = pinctrl_select_state(data->pinctrl, + data->pinctrl_hsic_active); + if (ret) + dev_err(dev, + "hsic_active select failed, err=%d\n", + ret); + } break; case CI_HDRC_IMX_HSIC_SUSPEND_EVENT: ret = imx_usbmisc_hsic_set_connect(data->usbmisc_data); @@ -306,7 +309,6 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) const struct ci_hdrc_imx_platform_flag *imx_platform_flag; struct device_node *np = pdev->dev.of_node; struct device *dev = &pdev->dev; - struct pinctrl_state *pinctrl_hsic_idle; of_id = of_match_device(ci_hdrc_imx_dt_ids, dev); if (!of_id) @@ -339,6 +341,33 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) return PTR_ERR(data->pinctrl); } + data->hsic_pad_regulator = + devm_regulator_get_optional(dev, "hsic"); + if (PTR_ERR(data->hsic_pad_regulator) == -ENODEV) { + /* no pad regualator is needed */ + data->hsic_pad_regulator = NULL; + } else if (IS_ERR(data->hsic_pad_regulator)) { + if (PTR_ERR(data->hsic_pad_regulator) != -EPROBE_DEFER) + dev_err(dev, + "Get HSIC pad regulator error: %ld\n", + PTR_ERR(data->hsic_pad_regulator)); + return PTR_ERR(data->hsic_pad_regulator); + } + + if (data->hsic_pad_regulator) { + ret = regulator_enable(data->hsic_pad_regulator); + if (ret) { + dev_err(dev, + "Failed to enable HSIC pad regulator\n"); + return ret; + } + } + } + + /* HSIC pinctrl handling */ + if (data->pinctrl) { + struct pinctrl_state *pinctrl_hsic_idle; + pinctrl_hsic_idle = pinctrl_lookup_state(data->pinctrl, "idle"); if (IS_ERR(pinctrl_hsic_idle)) { dev_err(dev, @@ -361,28 +390,6 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) PTR_ERR(data->pinctrl_hsic_active)); return PTR_ERR(data->pinctrl_hsic_active); } - - data->hsic_pad_regulator = - devm_regulator_get_optional(dev, "hsic"); - if (PTR_ERR(data->hsic_pad_regulator) == -ENODEV) { - /* no pad regualator is needed */ - data->hsic_pad_regulator = NULL; - } else if (IS_ERR(data->hsic_pad_regulator)) { - if (PTR_ERR(data->hsic_pad_regulator) != -EPROBE_DEFER) - dev_err(dev, - "Get HSIC pad regulator error: %ld\n", - PTR_ERR(data->hsic_pad_regulator)); - return PTR_ERR(data->hsic_pad_regulator); - } - - if (data->hsic_pad_regulator) { - ret = regulator_enable(data->hsic_pad_regulator); - if (ret) { - dev_err(dev, - "Failed to enable HSIC pad regulator\n"); - return ret; - } - } } if (pdata.flags & CI_HDRC_PMQOS)