From patchwork Mon Feb 25 06:27:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Li X-Patchwork-Id: 10828261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E0521390 for ; Mon, 25 Feb 2019 06:27:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 298862A935 for ; Mon, 25 Feb 2019 06:27:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A81A2AB3F; Mon, 25 Feb 2019 06:27:49 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C5EB2A935 for ; Mon, 25 Feb 2019 06:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726785AbfBYG1p (ORCPT ); Mon, 25 Feb 2019 01:27:45 -0500 Received: from mail-eopbgr10050.outbound.protection.outlook.com ([40.107.1.50]:49829 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726401AbfBYG1p (ORCPT ); Mon, 25 Feb 2019 01:27:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aWGHFyFtNu8pggjcANeLkjqDLnxB533zBG1IFk4P25A=; b=pG9N/NvIvLanlmEp7dPf3B78EQVLKLpwEf+kMuV+0VHV8r140BtVOyGl3sJ6N2f6tBTHg6VRvHzT1KUQakmx5PXnbXoMyEykLhlOdeSLKiEDnFP34czQtdmE7oXwh5E9Naz32clCf3BxOQWQTxhlbMYGLNAISFkodTuWqcB52+c= Received: from VI1PR04MB4558.eurprd04.prod.outlook.com (20.177.55.216) by VI1PR04MB3118.eurprd04.prod.outlook.com (10.170.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.15; Mon, 25 Feb 2019 06:27:41 +0000 Received: from VI1PR04MB4558.eurprd04.prod.outlook.com ([fe80::b0fe:dee7:b2d3:9355]) by VI1PR04MB4558.eurprd04.prod.outlook.com ([fe80::b0fe:dee7:b2d3:9355%5]) with mapi id 15.20.1643.019; Mon, 25 Feb 2019 06:27:41 +0000 From: Jun Li To: Peter Chen CC: "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , dl-linux-imx Subject: [PATCH 1/2] usb: chipiea: add flags for id and vbus from external block Thread-Topic: [PATCH 1/2] usb: chipiea: add flags for id and vbus from external block Thread-Index: AQHUzNM1u4s2MYLwQkmtue70xWTv2Q== Date: Mon, 25 Feb 2019 06:27:40 +0000 Message-ID: <1551074807-27792-1-git-send-email-jun.li@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0PR04CA0005.apcprd04.prod.outlook.com (2603:1096:203:36::17) To VI1PR04MB4558.eurprd04.prod.outlook.com (2603:10a6:803:6f::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jun.li@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 48c2a02d-4355-4201-0b21-08d69aea57d4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB3118; x-ms-traffictypediagnostic: VI1PR04MB3118: x-microsoft-exchange-diagnostics: =?iso-8859-1?q?1=3BVI1PR04MB3118=3B23=3ALR?= =?iso-8859-1?q?HILbCAbAdwCvvS2ftyILRkEYusFlV3NaCrEcNWbmMvvgcwbwDGDzAW6QFMJE?= =?iso-8859-1?q?H8z16AmU64ALGsU+NV94H3cG3A9MzgYzxcp1GhE9Cy7UsOQ6Efw65SctwBLU?= =?iso-8859-1?q?8Q0M1XfpNh5kTWkvqu/TmPnTSg8DKpjfCFzCuHUy0e6rtzlDpje8jfbMMPyC?= =?iso-8859-1?q?H0WlV7camkEArHDF0iqQ2bpWH5djDGNKI5PulstEM+2ua+NEOR/zjZohNB3L?= =?iso-8859-1?q?8dvLdvL+CRZYV/c/7dwtck09cowMr5M5LK9qp8mLpYTDiN9hO98OYNZqaekF?= =?iso-8859-1?q?J2XIvN/SWOMnmxii4NDNW8u6RpegAsPHsnm2MdTAgj3qeISu4myE5mTJ3q10?= =?iso-8859-1?q?w8nVarAxsO+VTPq2qxTN4ESziEPF4ZpSbyNyrt1C8eNVwxJYrjIGc5VQYs5K?= =?iso-8859-1?q?Fgbuo7WsmQ3thlVNLPTT2xAPFHzImL1dDiYsz/Vp3BPytn+R3Co8sV8nLHZO?= =?iso-8859-1?q?lnmk4Mhske45eUBRs4Q6f2V5gkmQfEDgpzaCGM8xAKkxqA3AbnJromSIUvxs?= =?iso-8859-1?q?Ad2dYPr8bYBlx/lDzl3amwwKb5pygxqbvfQ6xWDJRMaf6LOLgTH4yABmRDr2?= =?iso-8859-1?q?NNDSemBYIh0TysMTpDbNHfIOjmBB3p3xYt0kAvnGv/R2DABPNrMHDQaGPk5d?= =?iso-8859-1?q?5q/QkIucFvgAOWpPPSEcq1wS7wwL008RSfGLuVxGA4hIdaVtMDdT4Jzg7Vea?= =?iso-8859-1?q?nJGHop5nft4Ar/pnKtM+8AohKSz9hoUqfKxu9b1Ukurl4wGISteJJdGdVZGS?= =?iso-8859-1?q?TZdNUSmvVMdgKf1VnSeHMZoCvDIX9jmJW4mwKtnj9Y1EXX5Ul45dcPj4XwVS?= =?iso-8859-1?q?tpF8cQ8lzBW+hXN6wYwXfT1BTGJMBkG5Y5WU5RQChDN979t+uMgNA4b8SnzK?= =?iso-8859-1?q?Dh6npcKeSMLS4bnUG5nNG+OXxNQFaj9N0GFMLPKtPZRBNw5lOQjhQonxVqRF?= =?iso-8859-1?q?+MCEPI4dhUvsODPoLiUpbu7/N+IDCLeOAw4WesFnHqwdwoufdIu8RarOJpxi?= =?iso-8859-1?q?7tNTYAwg4mX88iKMcfgVPpQh2e3CEeeIzwnl/laEc+qxSC9qSe7+dfwUciK1?= =?iso-8859-1?q?V+WKcCxyofd4GcgGBuxBOWxLoB4yHzAzoDcJ3OelK9XIziV0yxtlVba0NEGF?= =?iso-8859-1?q?mIG6aU1JAosGEGKHtWv8CPnPrqcuvQSkyOwcKM3Ncc8rLT8YTTF5I=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 095972DF2F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(39860400002)(366004)(396003)(346002)(376002)(189003)(199004)(50226002)(8936002)(2906002)(99286004)(36756003)(25786009)(52116002)(97736004)(6862004)(6116002)(3846002)(68736007)(4326008)(6436002)(6486002)(256004)(6636002)(478600001)(44832011)(2616005)(486006)(105586002)(476003)(26005)(106356001)(186003)(53936002)(6512007)(66066001)(7736002)(305945005)(37006003)(54906003)(81166006)(71200400001)(71190400001)(81156014)(102836004)(316002)(386003)(6506007)(14454004)(5660300002)(86362001)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3118;H:VI1PR04MB4558.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-message-info: CKmWBKnMgVSOvyrKRFZk2ZsL8FnwNqyDvi9HmYuXhB9BBSSK6lJpDgHD+gdW0HbyFJ3qbLa7ZbdICO10/tJc7VcGJdKVhS0EnB6z1c4q/tyrtndAwkd7tnANsGj1S4KoW7l5M42ip4CDOTf98ykA2Iw2i0mAY6wO3Kh5mgPo5bVPfgoOtnas5ZAaXrxF1yhJ/dNiXR0HOjUgPw4ERLEXyMkfV1osI6bvTEKuS5KTiqXMRGQzHi4k7RNHhRdJAZtHHNb3FvX2ZZOMHMAoFXWasT02WZjD1fXBEskV9C9xgSS5PEqvHmZDohZHszlN64UVgmhicPAiAWKIdWW2+GlQTj5lRQyNdiQOYmqrs7SHw9ehbj84830g8s91//Kq1SpkwAcIJjcLm5c5tR+JoOHdUvhGV29wtzD2N0SDouq2ytc= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48c2a02d-4355-4201-0b21-08d69aea57d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Feb 2019 06:27:38.8840 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3118 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add 2 flags for id and vbus if the state is from external blocks instead of OTG block inside of USB controller. Signed-off-by: Li Jun --- drivers/usb/chipidea/core.c | 2 ++ include/linux/usb/chipidea.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 7bfcbb2..0bfa850 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -706,6 +706,7 @@ static int ci_get_platdata(struct device *dev, cable->edev = ext_vbus; if (!IS_ERR(ext_vbus)) { + platdata->ext_vbus = true; ret = extcon_get_state(cable->edev, EXTCON_USB); if (ret) cable->connected = true; @@ -718,6 +719,7 @@ static int ci_get_platdata(struct device *dev, cable->edev = ext_id; if (!IS_ERR(ext_id)) { + platdata->ext_id = true; ret = extcon_get_state(cable->edev, EXTCON_USB_HOST); if (ret) cable->connected = true; diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 911e05a..cd72d82 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h @@ -70,6 +70,10 @@ struct ci_hdrc_platform_data { struct regulator *reg_vbus; struct usb_otg_caps ci_otg_caps; bool tpl_support; + /* ID state is from external event out side of USB */ + bool ext_id; + /* VBUS state is from external event out side of USB */ + bool ext_vbus; /* interrupt threshold setting */ u32 itc_setting; u32 ahb_burst_config; From patchwork Mon Feb 25 06:27:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Li X-Patchwork-Id: 10828263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 102761575 for ; Mon, 25 Feb 2019 06:27:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F364E2A935 for ; Mon, 25 Feb 2019 06:27:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7E872AAB0; Mon, 25 Feb 2019 06:27:49 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3632C2AAAE for ; Mon, 25 Feb 2019 06:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726795AbfBYG1r (ORCPT ); Mon, 25 Feb 2019 01:27:47 -0500 Received: from mail-eopbgr10050.outbound.protection.outlook.com ([40.107.1.50]:49829 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726786AbfBYG1r (ORCPT ); Mon, 25 Feb 2019 01:27:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1W21FcWtJvPFmSen0vTbhG0qwWTrYXrUTyUC7oK+tYI=; b=kWv/r5Ku5c5s1H72HGkPJCKTttEh7O6zaKgIFc/k/fLM55iuXz3FftuciYGnUkb/tpJ3tpiMAhteCxpn69ClUtjfmGXVhLUhSkcSk0A6DSLDTrZ9biUrq+bXNg81lD4JrPe9g2IObAREEeXO53Ivk3LCmJDB14GfuJPbxZWPTNw= Received: from VI1PR04MB4558.eurprd04.prod.outlook.com (20.177.55.216) by VI1PR04MB3118.eurprd04.prod.outlook.com (10.170.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.15; Mon, 25 Feb 2019 06:27:43 +0000 Received: from VI1PR04MB4558.eurprd04.prod.outlook.com ([fe80::b0fe:dee7:b2d3:9355]) by VI1PR04MB4558.eurprd04.prod.outlook.com ([fe80::b0fe:dee7:b2d3:9355%5]) with mapi id 15.20.1643.019; Mon, 25 Feb 2019 06:27:43 +0000 From: Jun Li To: Peter Chen CC: "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , dl-linux-imx Subject: [PATCH 2/2] usb: chipidea: imx: enable vbus and id wakeup only for OTG events Thread-Topic: [PATCH 2/2] usb: chipidea: imx: enable vbus and id wakeup only for OTG events Thread-Index: AQHUzNM3YVjQiyZteU68VbQ4zkUmtg== Date: Mon, 25 Feb 2019 06:27:43 +0000 Message-ID: <1551074807-27792-2-git-send-email-jun.li@nxp.com> References: <1551074807-27792-1-git-send-email-jun.li@nxp.com> In-Reply-To: <1551074807-27792-1-git-send-email-jun.li@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0PR04CA0005.apcprd04.prod.outlook.com (2603:1096:203:36::17) To VI1PR04MB4558.eurprd04.prod.outlook.com (2603:10a6:803:6f::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jun.li@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 721b260e-3f4a-4570-de3e-08d69aea5950 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB3118; x-ms-traffictypediagnostic: VI1PR04MB3118: x-microsoft-exchange-diagnostics: =?iso-8859-1?q?1=3BVI1PR04MB3118=3B23=3AXm?= =?iso-8859-1?q?Rce5LYdgEzdnEIPl5q9gAq5fXugsV+UULQtqUqqyvU+i/Qzd33n5RUj/AIfA?= =?iso-8859-1?q?wZJH/CDzRVjrT/xARCmj3GpamgMqM01VVfhex8tCGLvxhZYfIkX/d6OQlxWi?= =?iso-8859-1?q?A4xlz/yRiqZ0nu6Tys4iKMY5b5WPww8Odpkyb+wLR7xC62K8n+IDYj4vf1X1?= =?iso-8859-1?q?9rY+N49DAfPUtQTtr5O+6v+qRs2JfMKu87Hgl9avrVabjCbqIky0rEIjOwb1?= =?iso-8859-1?q?HzqMRvDMao59PeLWBsMsoJe1iWilQluqIj6+IkdezgjwALSVNd4qLF5QTuOK?= =?iso-8859-1?q?OPMNR56ocnpkXo4wfw/OE11kx6NrDoFTRvkSEAPfr2C1CQlu0NNVSNYKA9VT?= =?iso-8859-1?q?KELj7old/jLMNSz4Nia82qDsk78bq0L7vJunhAp4ZbeMGPOLdOZYl+yj9ywg?= =?iso-8859-1?q?7tC2jyHWH+e2u/iytcP/ylmrgZ0PVbrQ9KfkVUhVVIHKNlN7WSXLK/WaHxUS?= =?iso-8859-1?q?dOR6fhCtUNxr4nbu+9X2gXBOSoUo8ANryDPWJ/SZXdc49vdRX5ggo270gs52?= =?iso-8859-1?q?d/xiNwyUbMqj2/0rWXVQEuOf/rdoLBM4NDuRh+fTQeET2wz9ez7DSVc1ToU2?= =?iso-8859-1?q?dpJ01xdBSg11kZMp2CO9Pnf1cxYXcCy/PA10+fPlcEuzKv9gn2Kh8GyaID4e?= =?iso-8859-1?q?++LtO10jvHnKK/g+Pto3sNRsa20q/NXwM07y8iuemv+mbPS2SzHdWB5G7CiJ?= =?iso-8859-1?q?899DS2LdMsoWBPCpbsBqgVx4z1ctZOYg2qYVvISlfXSwYO5sJJsPiVZB2N52?= =?iso-8859-1?q?lfw93a4hsYoFwPldGycYTW0TxEiGFr4sY8P4XH9ywN6BeOUGd50XW+EVqX4V?= =?iso-8859-1?q?Hk6e+RNqr0CD/tSmf7d1uYxwN1nnCCjwDjs1pJBvV5D/gFpKcnGU+Nczck8o?= =?iso-8859-1?q?7w7z+1BK+byUWjzVkiiAdWnJzTkFkG80+PkNJo+AXmAd6OM/E7RilcT03AnJ?= =?iso-8859-1?q?5eTgMlo35q1Fho5srSGmNkboZ819g1eazRxjstk9sP5ROv7Qk9/QDXC/KQ9e?= =?iso-8859-1?q?Kr16Zv8HbIP2Te7Mtl3FwnFdlyA7Xdzcz6O3YbN0HraO7P6yjnZVFZbOeeqx?= =?iso-8859-1?q?Je/BGmHRCcE8sWqj11g0lzUth+WTTKo7PJoT6y7KbFYHmQQ1hQIjiJmiVAW6?= =?iso-8859-1?q?xnLmAb8hXf3L1j2mo+d2G1sqtXvUVXUUFuXHQ8ujsvOmAvfoszRX4IHwchA4?= =?iso-8859-1?q?ZrXCmlZ8aboFcQ0MgKyY0gHkrT4S6iXUCjaUAkKR55WNpUpHF1K1EPWNs3S3?= =?iso-8859-1?q?vlcWroGTCjaCDSRXHW?= x-microsoft-antispam-prvs: x-forefront-prvs: 095972DF2F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(39860400002)(366004)(396003)(346002)(376002)(189003)(199004)(50226002)(8936002)(76176011)(2906002)(99286004)(36756003)(25786009)(52116002)(97736004)(6862004)(6116002)(3846002)(68736007)(4326008)(6436002)(6486002)(11346002)(14444005)(256004)(446003)(6636002)(478600001)(44832011)(2616005)(486006)(105586002)(476003)(26005)(106356001)(186003)(53936002)(6512007)(66066001)(7736002)(305945005)(37006003)(54906003)(81166006)(71200400001)(71190400001)(81156014)(102836004)(316002)(386003)(6506007)(14454004)(5660300002)(86362001)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3118;H:VI1PR04MB4558.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-message-info: Ba81zadFcA/2cAMnt63rH3teD2BSUxTAgWBCwCmGMY5QP8hyoFqvK6S/VNcAhVBtpOoV6Pgw1HdAVhSdEnzITVLKzIAru2g1+V3R9YdnhgLsQP1dYErKvUcCRKgrD6eVJNOv0zOVQXHwrXnPs0BDLjyVBKZwZonZOOGPWC808+XEvSadpEuf5o76qJw/NfBF4pljQxQHvM6jyrYlSfiiAKpxvgj8MGGqPoBSMceN6UyQz+NQr8+pP4KhunzB2VJHE7hrbCvfKCFf0f5OLsN7hDQCnrqe5dr/xyodV3QjHBjDkCbrXnLqO0K91JfYyDqDJPzCNhuusRndaLd9HWzc9IZKWsSsZ+2lIdQ9KFe5ij0WfH3lsfA9LzRmHOmzIxktbOJdI05nSnLNCcDfrbex61XPWnfRBlUL1PjTaTOmNgs= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 721b260e-3f4a-4570-de3e-08d69aea5950 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Feb 2019 06:27:41.2777 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3118 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If ID or VBUS is from external block, don't enable its wakeup because it isn't used at all. Signed-off-by: Li Jun --- drivers/usb/chipidea/ci_hdrc_imx.c | 6 ++++++ drivers/usb/chipidea/ci_hdrc_imx.h | 2 ++ drivers/usb/chipidea/usbmisc_imx.c | 17 ++++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 9b45aa4..ccd59cc 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -419,6 +419,12 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) goto err_clk; } + if (pdata.ext_id) + data->usbmisc_data->ext_id = 1; + + if (pdata.ext_vbus) + data->usbmisc_data->ext_vbus = 1; + ret = imx_usbmisc_init_post(data->usbmisc_data); if (ret) { dev_err(dev, "usbmisc post failed, ret=%d\n", ret); diff --git a/drivers/usb/chipidea/ci_hdrc_imx.h b/drivers/usb/chipidea/ci_hdrc_imx.h index 7cc53e2..8017144 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.h +++ b/drivers/usb/chipidea/ci_hdrc_imx.h @@ -21,6 +21,8 @@ struct imx_usbmisc_data { unsigned int evdo:1; /* set external vbus divider option */ unsigned int ulpi:1; /* connected to an ULPI phy */ unsigned int hsic:1; /* HSIC controlller */ + unsigned int ext_id:1; /* ID from exteranl event */ + unsigned int ext_vbus:1; /* Vbus from exteranl event */ }; int imx_usbmisc_init(struct imx_usbmisc_data *data); diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c index 097ffbc..d357288 100644 --- a/drivers/usb/chipidea/usbmisc_imx.c +++ b/drivers/usb/chipidea/usbmisc_imx.c @@ -329,6 +329,20 @@ static int usbmisc_imx53_init(struct imx_usbmisc_data *data) return 0; } +static u32 usbmisc_update_wakeup_setting(struct imx_usbmisc_data *data) +{ + u32 wakeup_setting = (MX6_BM_WAKEUP_ENABLE | + MX6_BM_VBUS_WAKEUP | MX6_BM_ID_WAKEUP); + + if (data->ext_id) + wakeup_setting &= ~MX6_BM_ID_WAKEUP; + + if (data->ext_vbus) + wakeup_setting &= ~MX6_BM_VBUS_WAKEUP; + + return wakeup_setting; +} + static int usbmisc_imx6q_set_wakeup (struct imx_usbmisc_data *data, bool enabled) { @@ -345,7 +359,7 @@ static int usbmisc_imx6q_set_wakeup spin_lock_irqsave(&usbmisc->lock, flags); val = readl(usbmisc->base + data->index * 4); if (enabled) { - val |= wakeup_setting; + val |= usbmisc_update_wakeup_setting(data); } else { if (val & MX6_BM_WAKEUP_INTR) pr_debug("wakeup int at ci_hdrc.%d\n", data->index); @@ -549,6 +563,7 @@ static int usbmisc_imx7d_set_wakeup spin_lock_irqsave(&usbmisc->lock, flags); val = readl(usbmisc->base); if (enabled) { + wakeup_setting = usbmisc_update_wakeup_setting(data); writel(val | wakeup_setting, usbmisc->base); } else { if (val & MX6_BM_WAKEUP_INTR)