From patchwork Mon May 28 02:52:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Li X-Patchwork-Id: 10429729 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 7B6C460362 for ; Mon, 28 May 2018 03:10:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A9B628AF4 for ; Mon, 28 May 2018 03:10:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E02028AF7; Mon, 28 May 2018 03:10:38 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 C062228AF4 for ; Mon, 28 May 2018 03:10:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753174AbeE1DKg (ORCPT ); Sun, 27 May 2018 23:10:36 -0400 Received: from mail-eopbgr00071.outbound.protection.outlook.com ([40.107.0.71]:26304 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753050AbeE1DKf (ORCPT ); Sun, 27 May 2018 23:10:35 -0400 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=tt1NBVuMa1/KyV5ZEN3UQ/2r3DFsqisJ4/pV22P4pDg=; b=plIy9Y+NqccCnocwOZxEQnoA6Ljxet1uhZ484jyzgRM0zvNsVZ0MWM4VxPircsFCQM0c25S7n/KbDxZtIQ9PZl69R1Z+/vwOZ52v6F+NvVTEMm3WK9g2P433YzRhZla7+g25tfzoVUsnCUHVGEs1eq3c/EtRvsLzPdOxLhJkUUM= Received: from b47624-OptiPlex-7040.ap.freescale.net (92.121.68.129) by VI1PR0402MB3919.eurprd04.prod.outlook.com (2603:10a6:803:22::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.797.11; Mon, 28 May 2018 03:10:27 +0000 From: Li Jun To: robh+dt@kernel.org, gregkh@linuxfoundation.org, heikki.krogerus@linux.intel.com, linux@roeck-us.net Cc: cw00.choi@samsung.com, a.hajda@samsung.com, shufan_lee@richtek.com, peter.chen@nxp.com, garsilva@embeddedor.com, gsomlo@gmail.com, jun.li@nxp.com, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v6 14/15] staging: typec: tcpci: Only touch target bit when enable vconn Date: Mon, 28 May 2018 10:52:46 +0800 Message-Id: <1527475967-15201-15-git-send-email-jun.li@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527475967-15201-1-git-send-email-jun.li@nxp.com> References: <1527475967-15201-1-git-send-email-jun.li@nxp.com> MIME-Version: 1.0 X-Originating-IP: [92.121.68.129] X-ClientProxiedBy: HK2PR0302CA0015.apcprd03.prod.outlook.com (2603:1096:202::25) To VI1PR0402MB3919.eurprd04.prod.outlook.com (2603:10a6:803:22::32) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0402MB3919; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0402MB3919; 3:x8AQQPiM+XNhPDJC1vEwaJdAKfFvsgTc7jpVlgpucztymqEEEV3nmYpSOVYH7utPQcJiX1rXnB73jMKv2uq4Dx5KZynhs3JFQ5LOAOj2BQCWeYGC7ZQyolpL9WI/d+ypE9ulSTRLsDXEpFJOY2CCS4Vagkt5mu0Fo0wrlsundWqzdDntA29i5TOJUYsm/bWaoMhSVoGBSi1gR5uk+99T5cZEh9xlR+zhQTWMxB1HcFVBsP8iijrR22M5U8qbBtXS; 25:dMcbKwOiST0q+J9w/ULdGxAI8MVQB+v9dwy6/RCShJrsfEe2bcm738aZRxd3iT0u2YF879EJfMa3LzvcuU6N7mFduH5KRrPeW0jtVwd70Y19TBKPKdwczUOyK6aeX+xQT2owLhEE8u3Jwh+1SXtU+DyO6oweN1fOXujlt7E3FMyeAb/h7DfX1SyNpxWY/X45McZENc3MZ+FZqcFo4SCTXcdN0YSn8EKwshYY48rRAL1YsdlUyYMkq08r5q6zacd59bdjvghNFCn+IJ8z2b7v5y7WEyeNYIMF6HcdVFKRurxtxcP3Fz1eCEt+wjAVMOVRVvqmWGzsmnKPAq1FTgaeBA==; 31:a4ig6CAhIKN36YCXxAi1PeEmkW90ObOrV0QR/In0ojZcURHZsixXP/HsrIdVSstJ3A6wZ2wmYds7CnUF7NzdpBxAlYTlxbrMjvM5toCG8OVg1CKukRP6ob3Id/U7/tptyM36DAWeFpiIEjc1uXaF6qhdJUY0D7FVao4J4ga+lz+qQOgooFJgk9RR82JlAxQTFXPn7aLseUM2S7B/Qm5Ew+0uE28v2Pq4Id4KNZF70g8= X-MS-TrafficTypeDiagnostic: VI1PR0402MB3919: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jun.li@nxp.com; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0402MB3919; 20:QP9SvjMGB/4UaEFqhdjWah5a72AgnO3doh0yNvxuulf1ckuVdsxTYe0HfidEXfuWPRcTHP8ItNUXPWFy0eTvls+YOZdMUD/RoU8dYlRE1OUF3cKMdTyhDFtgnn6sJUSrc+zXNXHZWf4qnDa1GmRJDztTfoiP3Pndyq/tp8GipWAPLFVZ3yXpnHVznjYKB3vKYg7XlgG0saVcD5uhs95Sl3ZCjwMji4qi9JQEDPC2Hpm6sEEza983c8Lmd4R1MOsUEwq5iKLtuPfYU5iKxKiF7rsWJepQ7DoTk7tlOQyid2OpbEoBU4kuEYtG6B1LxtojXNkaVxMIllCKA8HUlOZfPvXz76n1vpUByI1RWpC319pLVTZuFTr1iXzq01QeWV3DUljS3G7ykNo2R+gWpKlL+tf3Dgy6NcHeHPKialBse8ytQ9bGSUIOSval0UkaZV5uezIxGTGWmOXSyTpCmY+C1ZqrfCctqBFXO6mkvqsb/xvLJCIJmYdX97dVyBlpxbhQ; 4:uh8eTZD+jmgCx1YslnXKPHWVFk/vAf1jasz7PabizykO9SM3LXcE5CO17TSiW7uKlHe654yLPsiuXn7QjSip2pb73LzB2tYIXnVir1xYXUiW73R3fY8nqn+T3AFbSz+KEbrbxiJ0+0m5B7vMz04MA5RJb8FEMNpDwZ/oKRzcZjw89uu7DBEX9y+E530CrgdxN4qrtgJ1zU1DBwuZiZo7oWGpdYQbtTXqns1Tem78+RnogyQdAVVPEE71TrgzOxWYZGLdkkUnIeBQ2aKbjDapNJhgMdgBAa1xcfsgOTXyUghCRi/XGaNpCSQ8GGx9zTMF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR0402MB3919; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0402MB3919; X-Forefront-PRVS: 06860EDC7B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(39380400002)(396003)(39860400002)(366004)(346002)(376002)(199004)(189003)(6506007)(8676002)(16526019)(305945005)(26005)(7736002)(386003)(486006)(446003)(48376002)(11346002)(956004)(2616005)(2906002)(66066001)(81156014)(186003)(3846002)(81166006)(478600001)(8936002)(50466002)(6486002)(5660300001)(6116002)(6666003)(7416002)(36756003)(50226002)(47776003)(39060400002)(476003)(86362001)(106356001)(68736007)(5890100001)(53936002)(51416003)(105586002)(59450400001)(16586007)(316002)(4326008)(6512007)(76176011)(97736004)(25786009)(52116002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0402MB3919; H:b47624-OptiPlex-7040.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0402MB3919; 23:sHWNea/mp48ocdIHCtoD37zGt/5rVkzkiuJ5mIO?= =?us-ascii?Q?JXhKwAy0cOFAHZ5AqzG2t8rp85sEja8MvFNjw12XdWbjKVRe3HUaNzD1bqxp?= =?us-ascii?Q?A6g1RiJJ9UjOL199HF/f7GIULHpuCbysgUcZuE2h2kjEGsA5hQuNINAcYmPp?= =?us-ascii?Q?EHrE4LiB8ceYfTdz6D38D5z3uISboyGjeOss0NvT+T2PKm1uJ9xTdGJ5gUqb?= =?us-ascii?Q?D+Crh/7AdUq8NVEBteBz7JC9UI5ZfQ8v28IUOqb2CwhTC8DGmpz9txOJSpkv?= =?us-ascii?Q?9dRt6xlAXeZs/AI8QKzRRcOgNU+/81NTU3P+kEQL6jwyffhAQ5ptLFMg+MYX?= =?us-ascii?Q?9qJDs2FPBmRRHxC2gL+asJvlcVcWhhBpVlVaTjG0t7sE73a7AJlp7MOLFJy3?= =?us-ascii?Q?1yJnw/NbS/cVyXlEKcT/ESNnXNjVi34ToEPJU3MgPx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gLkmlwhU/QlFvWXnFuamEJxjp6+huQ11quW1d/ga3ohiern91sgGES7h2f/FEq0qE1jtkY5vxE1TDFXC6VXEpO6/Rzw7Q81gJ0q5scJd0lwq5wqpaBeopPpvX65ff9xo63p3jfLlLuefnPgYif/rwp+0PJXhypu09HA9L8NIDBcrEt X-Microsoft-Exchange-Diagnostics: 1; VI1PR0402MB3919; 6:7wn62CA9YVx1/xZmp2a9QjaEH9WaTN/VP96or3BUnLUGNaPkyGXUHyotkpotNmelTBWpSaYcigeK+9ybV9X4ZGLeBDasaKwlAK9w+KXS+HXT9Db8FjngzwAOtgNf7qqE/5x7o6AuIUnFIOaxYgebL/ur601U+RJqQwLrGWOK+Tb0dCktRL1XFKvyxokj25cUDJUf2QBngc3OWp4/yOe1id06s7TYpmFvuo8abazsfWnzhIC+S/IWzhojDB6OkXa1pyvcykFFZR2o1NveUczqmjJM74AfD+xImoWjYh1wWCTejlsi/IJ/WcRt/1dsFOGW4WStwCQq1bZlXlEw5DHBMfktkRyjrx02fpTEUz6nuZkxuWq+whxXTsMfdQgeqbBHLqS5gT7csf/SvrkQqEqyc8mj605dYORHwYT8AXUxhnHwpoedp5tWDrBRFUmS6UB9TY0xiWQiHkLM+SYXUnw3hg==; 5:RyZzwYyc38Pi2X+i5NssepS6HJyFI7eJ2y0wl+FfQpiZJuUVWyHbBKzUDHUVw4E1kQR/r2tYvl0JEHKgqthh96Oi0bdjF7Iy9IDIo8WoCItLPyj1leLh1c9azZRnGlQ7CRh4F6H9pGQ7kvRDIZRsnsxzkOzlGgeNMH7bx6MVyZQ=; 24:YglwiZWWHtQ9ucdqr9jhUCSI4qCa6wQcf9M7/Hc9sAVsfDtBvB6wmzz6jxA61CfiUuSUPN+CjbRmrRxqperfUV1gZPCmycR+dkPGfoLji1s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0402MB3919; 7:bBYs/BeEmQgcbgNL09TgsWCLSFNGARWvs8D46VF9xRhoIrz7vYZEOxMmMeV1jdQ5UimmcMn9brXJuteRV/JO3VKoivyVrcsfAG6MM3uy3aCVbb8pKLOUMMvx5PaYkfe1aMwy8c/WPj/2pknTE4V7zaLCqO0R/0X8Ab3C4LrWM/Br/QsoEZOtWCIHbgrLyAfAtIiC3uPfNutLaeO0YdPVIqP0OW66u8xKUftpmvCS3WFPk+0gLixYBNxwAIhyLFrm X-MS-Office365-Filtering-Correlation-Id: eac52660-9a3f-4d59-c36c-08d5c4489311 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2018 03:10:27.3459 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eac52660-9a3f-4d59-c36c-08d5c4489311 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3919 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 We need regmap_update_bits to avoid touch any other bits when enable or disable vconn. Reviewed-by: Guenter Roeck Signed-off-by: Li Jun Reviewed-by: Heikki Krogerus --- drivers/staging/typec/tcpci.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c index 11c2d37..ac6b418 100644 --- a/drivers/staging/typec/tcpci.c +++ b/drivers/staging/typec/tcpci.c @@ -218,12 +218,9 @@ static int tcpci_set_vconn(struct tcpc_dev *tcpc, bool enable) return ret; } - ret = regmap_write(tcpci->regmap, TCPC_POWER_CTRL, - enable ? TCPC_POWER_CTRL_VCONN_ENABLE : 0); - if (ret < 0) - return ret; - - return 0; + return regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL, + TCPC_POWER_CTRL_VCONN_ENABLE, + enable ? TCPC_POWER_CTRL_VCONN_ENABLE : 0); } static int tcpci_set_roles(struct tcpc_dev *tcpc, bool attached,