From patchwork Mon Sep 17 03:29:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 10602049 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 E0D2B14DA for ; Mon, 17 Sep 2018 04:26:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1F9028A35 for ; Mon, 17 Sep 2018 04:26:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B46582905A; Mon, 17 Sep 2018 04:26:55 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1E3BF28A35 for ; Mon, 17 Sep 2018 04:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KcequNV9Lenz3VXHAEs4NDcKkPhFFoGe3r7xOmuZn3M=; b=Y64Cs+u+Es59jb v2WQFgxh1YRF5HJAgB6y7DF7lq85YAhcfLyRj7wZ3gdRBUJDHSljge5CHHpYYFHQCsYDANt2H/2wi OhbJ+F98aCSDDne0rSWgojtpWQWYqKCrDIDPbwuwMChndUYSSMrKwqmY1yL2WSTuW/gDJlYr1yWA7 PiXcCU6m0SOfxX9Bj/Dd+YOaDCPXr3y0BZAOkOXo0FP5HlcgZDaOaue7nZlo2PWXvaxNLXXPnL9nE QDpFJVU1i5i+ny0edM5quVYkYHGUrlzE03f0NlFL2dDbR82lPYi2WDZ8kwK5YW6e/wZ4dNqJNndtB ddXvHY2brQlCUi0kjNOw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1l7T-0007E0-Pw; Mon, 17 Sep 2018 04:26:43 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1l7S-0007Dq-3H for linux-arm-kernel@bombadil.infradead.org; Mon, 17 Sep 2018 04:26:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OKDdj+KFBLxmrketiQ6QkPL/0vu/dadwKx4KhD1ObFs=; b=o5pOVpP26jmF668/tmrTRbtwZS cBjbODG5U0GEO8gNeC+Er+XLAqdZ9viQdLSfg6ZgpumGJkh+iGQ5yRMwC+2IjM3s33nOaQpQTac6L 3b09gRQ9oaXdtnfhn/fzdJGtwHslLlt8hQpRle37PSJ1CPKIxRAEpuaoUSaAW+hbZ2f/r+9RXgmlc NK/rW6HFF9x/HcUVk4mvXPTU3qiVlyX4Sa3vwcCDvZ6k/LHHMrcNB922DR7XIo5mLdFfaxKhUaOgZ SjYDKbWu3dleQax2fw6bYXaudv5RMavpb3jcbJa6/oiBIdgx3JeoT/N12bS30cTMotkecHZvAVlLL cHFI7XPg==; Received: from mail-cys01nam02on0040.outbound.protection.outlook.com ([104.47.37.40] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1kI4-0007dB-RW for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2018 03:33:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-synaptics-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OKDdj+KFBLxmrketiQ6QkPL/0vu/dadwKx4KhD1ObFs=; b=B150wx6ugr40E4dVt9iEVwSyeMIc3SaprF36RliQLKIuajZkFYkrupqnkr9HarlhRNc8BESZOt0WMSPM8F4F4+4l49rGMg4E38DRpDadZ6eKxVynsxiHzgmwIAViU+eYi7nMIeBB7cWrSx3j5xnfxQ+HLOKkvl703scckN29NLQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by BY2PR0301MB1574.namprd03.prod.outlook.com (2a01:111:e400:526e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 03:33:17 +0000 Date: Mon, 17 Sep 2018 11:29:49 +0800 From: Jisheng Zhang To: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Wolfram Sang Subject: [PATCH v3 3/3] i2c: designware: select gpio/default pin when prepare/unprepare recovery Message-ID: <20180917112949.414dd56f@xhacker.debian> In-Reply-To: <20180917112633.252c591c@xhacker.debian> References: <20180917112633.252c591c@xhacker.debian> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: OSBPR01CA0060.jpnprd01.prod.outlook.com (2603:1096:604:10::24) To BY2PR0301MB1574.namprd03.prod.outlook.com (2a01:111:e400:526e::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ecd16ecd-e2c6-4ff2-5be1-08d61c4e4fe7 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BY2PR0301MB1574; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1574; 3:ri4gaxqNwUtICxwdxUv7WcVxety+lWyr5OQV+YxebpTBF2iyCUT1EdfVtmBNOlY6xhTLvvywYY0OH+yNbEtAOlrUcP5pAF2Hoy8LARZcXY4pYpPb6AQGDwemthorlT6YQQupHwu43GMo6lGZfXr6PTkON0nMSpCB6i90DBxoBsw1m2q3gy/jrGmCGIREtQ90NXve0ehpx51NgdI8dcoW9RRnIEtuJhLKEmiL/ev7pqsC8amY99opuZDQeh8m/ab3; 25:6gnAsFVMi+FmeY2kSbA9h9S5B8BZ2lANd+xbc4eAm9B24ghUpXX2UjxEMo8Se3fk4dj2bi44vb8mWepKVh3i+qJSApDkY30FuNT9YIguXL93sxo+cx30t5Cnfg4DIuJiFwe1WDEhufkoyshovYH/q2NMogJqCobllonAIyvQ4YKvKnsBZrM0mzeSnjAA/W11xmsFCm4g95TujylsHMeZ81oc6udtKj6hrDRiRBpljCdoZXscaQ5lv15dGUUGYz4rhYPptnriG0OW4rtn542VuYIcqwmo95AWkAJFhAX6VaOuio2efqX8MMcWRT2K1m8mHkA8QnRAjFjPX4YgiefgwA==; 31:gQi5Bva1++agtx5gmEYHp2U5oIAI9GfRMXWoTaj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-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050); SRVR:BY2PR0301MB1574; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB1574; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(39850400004)(396003)(366004)(376002)(346002)(199004)(189003)(81156014)(14444005)(81166006)(86362001)(575784001)(53936002)(8676002)(5660300001)(72206003)(68736007)(486006)(7736002)(305945005)(55016002)(478600001)(8936002)(9686003)(105586002)(66066001)(3846002)(230700001)(7696005)(52116002)(386003)(6506007)(6116002)(186003)(16526019)(50466002)(50226002)(4326008)(110136005)(25786009)(1076002)(54906003)(2906002)(33896004)(316002)(956004)(11346002)(446003)(106356001)(97736004)(23726003)(6666003)(47776003)(76176011)(476003)(26005)(39210200001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB1574; H:xhacker.debian; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB1574; 23:eeNLk9yx5x2p2yI83/cjhWdfoH59NXgTgLLQ3DJ?= r2GE6gYTpf7YyMz3zUoiu8xnQ+6fAibP1Hyxj1bKi+5Wmpi38R8g/So6AHnJjwXm4JzVjsZkUebNKA+IXNUaTzL9ZuiXziA0HLKeqzpLTiVDIZ6Zq3g6RHPXaEuyuYB1T7m7NTOvxQX5nbxGR7OKnT/DAjxTkGIIOaF/JWztUeieajIYEK6rxS/Rt/bZJb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M2kztgvNs8wzNmB4VI6hSL54qUrAFAszoyi0uJUYo0F8qyiH/YUuWL0yDo/IwS1AMKzu+sOS2dVmlG+1DsIovXXnHHC7qJbu4XnjgYsqtdwlNAGGboyx86mNiq7Ae5qaHHlBb8lyzmwfmldhjdlTSwWsWnecMI8l+PIHgb75TKgwFlpOSHuBjpizELXV4zY4ajt3PuIDqIYnMSK6c5Zu4rIpnhRCNd3ibrnvE+2JCMCANeGNiLi8c5j SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 03:33:17.2035 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ecd16ecd-e2c6-4ff2-5be1-08d61c4e4fe7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB1574 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180916_233336_967143_BEF603E9 X-CRM114-Status: GOOD ( 14.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-i2c@vger.kernel.org, linux-arm-kernel , linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On some platforms, the sda/scl pins are muxed with gpio functions, so they could be used for recovery. Select the gpio/default pin function when prepare/unprepare recovery. Signed-off-by: Jisheng Zhang --- drivers/i2c/busses/i2c-designware-core.h | 3 +++ drivers/i2c/busses/i2c-designware-master.c | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h index e367b1af4ab2..01d5f01691a4 100644 --- a/drivers/i2c/busses/i2c-designware-core.h +++ b/drivers/i2c/busses/i2c-designware-core.h @@ -271,6 +271,9 @@ struct dw_i2c_dev { int (*init)(struct dw_i2c_dev *dev); int mode; struct i2c_bus_recovery_info rinfo; + struct pinctrl *pinctrl; + struct pinctrl_state *pins_default; + struct pinctrl_state *pins_gpio; }; #define ACCESS_SWAP 0x00000001 diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index 94d94b4a9a0d..384d6630366a 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -629,6 +630,9 @@ static void i2c_dw_prepare_recovery(struct i2c_adapter *adap) { struct dw_i2c_dev *dev = i2c_get_adapdata(adap); + if (dev->pinctrl && dev->pins_gpio) + pinctrl_select_state(dev->pinctrl, dev->pins_gpio); + i2c_dw_disable(dev); reset_control_assert(dev->rst); i2c_dw_prepare_clk(dev, false); @@ -641,6 +645,9 @@ static void i2c_dw_unprepare_recovery(struct i2c_adapter *adap) i2c_dw_prepare_clk(dev, true); reset_control_deassert(dev->rst); i2c_dw_init_master(dev); + + if (dev->pinctrl && dev->pins_default) + pinctrl_select_state(dev->pinctrl, dev->pins_default); } static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev) @@ -648,6 +655,8 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev) struct i2c_bus_recovery_info *rinfo = &dev->rinfo; struct i2c_adapter *adap = &dev->adapter; struct gpio_desc *gpio; + struct pinctrl *pinctrl; + struct pinctrl_state *s; int r; gpio = devm_gpiod_get(dev->dev, "scl", GPIOD_OUT_HIGH); @@ -664,6 +673,19 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev) return PTR_ERR(gpio); rinfo->sda_gpiod = gpio; + pinctrl = devm_pinctrl_get(dev->dev); + if (PTR_ERR(pinctrl) == -EPROBE_DEFER) + return -EPROBE_DEFER; + if (!IS_ERR_OR_NULL(pinctrl)) { + dev->pinctrl = pinctrl; + s = pinctrl_lookup_state(pinctrl, PINCTRL_STATE_DEFAULT); + if (!IS_ERR_OR_NULL(s)) + dev->pins_default = s; + s = pinctrl_lookup_state(pinctrl, "gpio"); + if (!IS_ERR_OR_NULL(s)) + dev->pins_gpio = s; + } + rinfo->recover_bus = i2c_generic_scl_recovery; rinfo->prepare_recovery = i2c_dw_prepare_recovery; rinfo->unprepare_recovery = i2c_dw_unprepare_recovery;