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;