From patchwork Mon Sep 17 03:27:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 970384 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=synaptics.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="pRgfh248"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42DBVf2fpkz9sB5 for ; Mon, 17 Sep 2018 13:31:22 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729557AbeIQI4g (ORCPT ); Mon, 17 Sep 2018 04:56:36 -0400 Received: from mail-sn1nam02on0079.outbound.protection.outlook.com ([104.47.36.79]:26118 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729322AbeIQI4f (ORCPT ); Mon, 17 Sep 2018 04:56:35 -0400 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=4cmwYGxLe8gg4jOzWNSNzOrWo3eIpy4vFF+AovXAqzg=; b=pRgfh248Y1WXP81Drsixp2Ry+32krFJuu0KCqUn2q27fDiOuInnaS3aV92TKTZx7JAT8LEiIgHPfJEcqFZsY77aGuvSZcfuBa/C+IDhq8fcnPzMEjvjMASa3AJEA13fv3PariRAqTvmZ/cjS2dEJvLYs1nxXlgqAyzM+MsS6cUU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by SN1PR0301MB1583.namprd03.prod.outlook.com (2a01:111:e400:5232::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Mon, 17 Sep 2018 03:31:08 +0000 Date: Mon, 17 Sep 2018 11:27:41 +0800 From: Jisheng Zhang To: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Wolfram Sang Cc: linux-arm-kernel , , Subject: [PATCH v3 1/3] dt-bindings: i2c: designware: add optional gpio recovery properties Message-ID: <20180917112741.7c3d6514@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: KAWPR01CA0081.jpnprd01.prod.outlook.com (2603:1096:402:c::17) To SN1PR0301MB1583.namprd03.prod.outlook.com (2a01:111:e400:5232::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e2c88991-7ec0-429b-08c2-08d61c4e032e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN1PR0301MB1583; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1583; 3:mPDPau0y29rZUlJt+N8ZhA8EenMHAQsiUSspVCLLxrfNMgHLf/RG/r5xyDVDY+xm5qe/DJCnmiO+Wo4QjDcKtyphL0B/+9mj+ZKL+QOUP/PchIjnV7aN2M/hb/oeXerh/3xA12TnsMUOFiY7AW9IjuppFYAF+tIOhT2lxw6yRM+VDdhW047XhTUpAuEcZ4VaODs8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tLm3jhv1kd6RG/HW2bO81I1HLzwIM56sZF4bE4BKtdajNQ0ZMi9D0BJ6Su2of2YF+hI7Eu4UnqgxUxCvOYpDWiO+Psy8/rgrBg3fHV3Mg9XOcCt44DeS/4Tlca47tnAdLpcHj/fsEfMuEgpQhoBJP2tf; 4:hHBiEgA+g1aPzbrJ3OM8089llxDcZkYVSck/HCuuTgOA+VbfvHF5yUbIeKRhy7FGHQGLOoXzNMkx48DSMKlNHsQdWazANQO88DrxATZq2jBgN3fGPSiXZiU3TJjdraHBcRUv89nO8kte4bL5YPAFwk1tKuMbsi5FhIcyl0Ly0fDmeFf6dkjjOxszZK5KwmgaJpqBwW3m7VOz78O0S/PH17BgOJz4Vgnh6rrc7xAYtZCwV+FrPFRs2iePviSWcFK/HAl8UAQgmsQ1im1RKB3qog== X-Microsoft-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)(5005006)(8121501046)(3231355)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:SN1PR0301MB1583; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0301MB1583; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(39850400004)(376002)(346002)(136003)(199004)(189003)(3846002)(53936002)(6116002)(446003)(11346002)(478600001)(8676002)(68736007)(50226002)(81156014)(23726003)(8936002)(33896004)(2906002)(50466002)(97736004)(72206003)(81166006)(26005)(16526019)(4326008)(25786009)(52116002)(7696005)(76176011)(186003)(6666003)(86362001)(7736002)(47776003)(386003)(6506007)(5660300001)(956004)(66066001)(106356001)(9686003)(55016002)(230700001)(305945005)(476003)(575784001)(110136005)(54906003)(105586002)(1076002)(486006)(316002)(39210200001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1583; 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: 1; SN1PR0301MB1583; 23:/Vz2RVQAmiwXjY2T5SWk0AbgXlURS7UzxQkleg8CnWKPTHfL5+JEpTso8nmjKhitGvEMd4rteo85k5jgLkPChs/SFsBkCEre1wUBT0v3QJmOhaogeuK4N7FtUWLuKwMQHCbx0KBzK9mnMX5pH1j1vJsHS6KA5btrivA6Z9oSVKNloS/jKRD7NCx6+LV0fL+5nXpxG9wcYfTEMNy5w70ci7GAHbRh6CFCYLkfp0Of4hGBhkIeAV+gaiOIwG4SrV86jxl+zt2aMY+2ojzrWYQozahOv0rS0H0d5CyvEUpm4lts9bfmbK82nn4s22cdV400r/clNGGzgqHHK5nf4bKj5y+F03GcrPlwc2ACr72xY/5d3xifE6gUTHKFDMcYWkgGXbuDcLTiL6N4N1z5FkpeBiBibZQyBNeBrTknjjAD3tVjnQTz23Nn4huZgCAdMy/lUeD6DmRsIJU7x3CHBDSsIFGzy+r6doqiSeioP5zXsxNZOa81lMrh+YPSiI16zPsZRjiWUihGhR0rmQp6LolZYAsDr6pHzH/vJ4R7zpjpgz09G6TNPBNN3MvLRT5d4q3tLVUy2nAvmWgaIvlqYjWU1f1xJb7Oz/kn7CoEFti3WeqzETHwhLIDKMy6YmSQqStCoXhXaYqWOOcer8xWbbiO4L11RmcGbwQYZV5ghNYBFqKKUIKYGCcq8jyjk6SJsD5vpmtG/H6oQHtWDpoHfivDUmJvRcoaNBT89/mUvNkXfFf4O1wkRkOpjL+XAOFSns1dJ4ovnF0WwOI1g/UbPWDUK4dBXwicBDCnQSBThRNL/DGin5HvzUkw5oLL7unGWURhQsGFHFFX/bK0H8Qe2cIgv32dKRgja2TEe5xFrsoL72p/+Rj/kWlbM6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KvREKIAZHpzARWgD8lMAdHtdRwJ4K2YDh6diimxa7tmsaYB1nWPq4mzyWZrOoiFfPHH7rndMp9W7RMhQFvepBw/LBC7tKh5uYWrHgSNm+0gQwknw8cWIuoPwXHgSMlaupyumpE5ZSN0pF7a1arCKmdElWm7/wgPQ0WSA9IYjvUZPFF1khGjls6Fiet626AlDWydoGMD0FJXAlH/Q==; 5:/eTVLFSrzDmam8uxJlsc62gzT/NsU4vhVWDzJ7rtH5dkPce0iaWoxe5zc6kdme9ZPvedaitwER0f8G67ncYeAY7/2BM0xgOjHA69nxl1fn8fFymcOwzBK0Ym8xD9r5UPwVb3WUNvcHOvA2rdbSwxlgIkRhIhPm053dQqfuoOLTY=; 7:LRvdwo7KiJnEbih1nFHSQUVSEbTxCAaIMSLLcJLOZBGmfoh3uvKl1dHGHzTAWaXYQJ2hB2A3eQ5sVrBmnHlfGnCBmUCIEIcnGFJT6hzvpFjuLv6RR1R7q0FWBxPufxCEymubk2nV2go30SK3JHYKxxFaVArR6hY9igMat9wc+paR0mqvrqeN+byG7PRKVwrJn/NpCuHaACe5W3haWY3UJ3Kv7gdZkT1GBDlHRGSXoDU+OFwZmP0Il7X82xsGdhiB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 03:31:08.7634 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2c88991-7ec0-429b-08c2-08d61c4e032e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1583 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Document the scl-gpios and sda-gpios properties for bus recovery. Signed-off-by: Jisheng Zhang --- Documentation/devicetree/bindings/i2c/i2c-designware.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-designware.txt b/Documentation/devicetree/bindings/i2c/i2c-designware.txt index fbb0a6d8b964..1d6a6a8061ba 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-designware.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-designware.txt @@ -20,6 +20,10 @@ Optional properties : - i2c-sda-falling-time-ns : should contain the SDA falling time in nanoseconds. This value which is by default 300ns is used to compute the tHIGH period. + - scl-gpios: specify the gpio of the SCL line for gpio recovery + + - sda-gpios: specify the gpio of the SDA line for gpio recovery + Examples : i2c@f0000 { @@ -42,6 +46,8 @@ Examples : i2c-sda-hold-time-ns = <300>; i2c-sda-falling-time-ns = <300>; i2c-scl-falling-time-ns = <300>; + scl-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; + sda-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>; }; i2c@1120000 { From patchwork Mon Sep 17 03:28:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 970385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=synaptics.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="SjYImgcQ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42DBWS4frCz9sCS for ; Mon, 17 Sep 2018 13:32:04 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729571AbeIQI5Y (ORCPT ); Mon, 17 Sep 2018 04:57:24 -0400 Received: from mail-sn1nam02on0053.outbound.protection.outlook.com ([104.47.36.53]:34880 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729315AbeIQI5X (ORCPT ); Mon, 17 Sep 2018 04:57:23 -0400 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=416xl4x5h4ef72JPztdsXRUle72nv/LFTTKyQldAx6g=; b=SjYImgcQBdMInjzvtJrFyDJc+cLkerskDVXHZKIqidHVwI9MXbNQYUXX+UYw3TWPiIDfJ+/TKeTyltjyY8trkgLpEYOVKithrJf5aTRU5MDF2PHbs/AbyC/o3jFAkHyqagWOaWfsgvIigAqGpvidXfOzD53orjPRumQWSeHbQVQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by SN1PR0301MB1583.namprd03.prod.outlook.com (2a01:111:e400:5232::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Mon, 17 Sep 2018 03:31:55 +0000 Date: Mon, 17 Sep 2018 11:28:30 +0800 From: Jisheng Zhang To: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Wolfram Sang Cc: linux-arm-kernel , , Subject: [PATCH v3 2/3] dt-bindings: i2c: designware: add optional pinctrl for bus recovery Message-ID: <20180917112830.2a3c9be9@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: KAXPR01CA0012.jpnprd01.prod.outlook.com (2603:1096:402:19::22) To SN1PR0301MB1583.namprd03.prod.outlook.com (2a01:111:e400:5232::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e4c51553-ca0b-4c1c-4dfc-08d61c4e1f54 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN1PR0301MB1583; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1583; 3:8c7+qFSvpo5XoYeuy3yHihQllmQpl//uIMrig/qC33Yi1UFzwHF2f5/VURa3VxJ23Tejb1HrocvmBwKk4ihWyJlvD1QxkuMHITUlMLSM35UU36h7VqDUewpuaaESl7wvla42k2osUSYuKwFBsYTjnyX8Z0i2SeYw2NeacLqPff5NApNKoCjm1r7xM70ihcEqAtogeAwPYYSCEoANJOR8fdNkOE4qq8lAQLqbW1Xx7CETKhrLMYEMQEMf0Akxo76g; 25:l5HTkhdWbLXKk+liGJ2uG7PPrJ778WSmw8eEm7LPOnwHbiwneBBXT3iyX0OYuKImdopQ0DVNh2tn4Yq2O28PKAJL7+LLSZ7AW319h68lizVj/sveNdEawa/6FN7dO+Ppo/c1jqc8AdsufMpWy+4v1Zhsgrq/I7vLapHBjWOdPhhb5Yf0ujjVWaXnbrdAld3gFCNxs+h9qUNLKWCsjHMWuJLmSZz/lDY4b9PDIBmspZ/21h52K4rVgvoQlLXHBjodYpyl7RLJg1GVvyREISaNGWAsTh1QKBpx2ipVz5EjBWwBbECMOBmVpljEeHfkMAJ8snh04smShZBycZ6RPxiIig==; 31:eD9Xse/xhgFUDpDaJ47mYf+o5Btz2aTtAUxNsu3tttaRLROgRBM13MVKwWoe1m+PuSpPZKfMEqu7kVl2pPbrvY18vXxZeTTdnw3rlgIORFrSJHqp0DE+gUfhk4daljSnQ/cuyIY/dkV6imEIXabDdZVlxKpjqgHuElsOwTh1WbWoSW74t0ZrugjRZanrvBLaJggl9N62IIAbVOYX1uMqO0ro7YPOqmNLQ2BhmTpmnxs= X-MS-TrafficTypeDiagnostic: SN1PR0301MB1583: X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1583; 20:uY60D6AYaWNH3MJPNYNRaDTZK7hJCgOP++FjIuoSLjBYb6gizzknZXQvpB6BvR96T8iviOearKyARUxf8CmjwKy0RJRgdgCmd8fWJ6gEgIuANrLHyEL4jMTrFL8vhCdLqazzDOWtYPtCYgMgsOyiW4aT4sPoLGedGYyu+slSu8aiaZJKL/KmhfymqYNI0JerB+GvkTea/LauPtjViyA6coWpIVfbwYsmXq3vXX6dOeJFiPCzZ8B3Jfrs//w4dc6VHVTDASZtRVs8SM7Zf3JMbznPnKjGZ6SXS2o4DKU1P1YqS368v2eh7+CNcwshqzj3ljoA+c2UsUzu3EWox9JXBLGq8S88LJ2+EN6ProoKLoX6YFkl84q8DB1Xg7U4TCuDiy2Fyekg+iJ2XqWpVeni2KDSwg4H97aHeB0odFNv8a0Tj400IUzXb2vWwmZT5TcEm7YBG/p/FOHoFx1J8flNx6Uz5y+7rcR0m7T0YZIMiG2OLKv6rozuosPZo8AV2irK; 4:gzx+F56dfU4JXs40yUzpJdSWJPVKbesLEUkUowHaYQelPPuxpNtsibrW8YSriKljs9XamosTyWqRMkh+BPgkEB6oSC/iZoFev3E9ZEnqFKinx8PjEa0JZaz80JT9rjCPfMhgAdzAb3ZGEJ3ig+qpzW1YJxVHv58gtgU21CEIRfdJ+IudDW9UF8JlK1t8+3h2Ntcrd2wjWlnzJWDiB/2gX8gV+1V+k37mhTH73xCu9EeirPnW+wCgRbPiZSPT+mHR0H0WO0/1X1dff9llK2OLiw== X-Microsoft-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)(5005006)(8121501046)(3231355)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:SN1PR0301MB1583; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0301MB1583; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(39850400004)(376002)(346002)(136003)(199004)(189003)(3846002)(53936002)(6116002)(446003)(11346002)(478600001)(8676002)(68736007)(50226002)(81156014)(23726003)(8936002)(33896004)(2906002)(50466002)(97736004)(72206003)(81166006)(26005)(16526019)(4326008)(25786009)(52116002)(7696005)(76176011)(186003)(6666003)(86362001)(7736002)(47776003)(386003)(6506007)(5660300001)(956004)(66066001)(106356001)(9686003)(55016002)(230700001)(305945005)(476003)(110136005)(54906003)(105586002)(1076002)(486006)(316002)(39210200001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1583; 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: 1; SN1PR0301MB1583; 23:F2sPmgc4fCAh0izA3cKrXg4ZmupcdPkdSo2zbaAeMHpmVAhqey+wVjDK6L5ncfmVIztJ2C5aHnoYnM2hZvgMBd5Qy9dFfOX5Fv/gHpwy+powZbvKNQpDUlI2FZZnahWBtV7xnLW5xwOvjsOCqiLjTyo55EybQbqyistCoD5DTOgWKqVJwd7B2cMlLvT/ZtsfOYQQhhKoIBZjzy8HTG7FmKyG5AU8pkVIPe0WyzBEJ+D3yRgzIVy8Tv/Zoj9+IIlQi9XJJyu8hjnckgWb5D9pW9W1X06SaJagBGh8L6PZvEJQxh+QD7/NZOAiSbXW32lfPvGeM4TQYB5irUJvzHnV5QrkYCzhelc0rynM/4PB/4WBB4lwE9s1tDEYIoRGfKFXssfKPTgVIXb7Xhm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0v7z4EHoKnLlvQf1BW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 03:31:55.9984 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4c51553-ca0b-4c1c-4dfc-08d61c4e1f54 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1583 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Document the pinctrl property for bus recovery. Signed-off-by: Jisheng Zhang --- Documentation/devicetree/bindings/i2c/i2c-designware.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-designware.txt b/Documentation/devicetree/bindings/i2c/i2c-designware.txt index 1d6a6a8061ba..c1544d1f7b55 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-designware.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-designware.txt @@ -24,6 +24,9 @@ Optional properties : - sda-gpios: specify the gpio of the SDA line for gpio recovery + - pinctrl: add extra pinctrl to configure i2c pins to gpio function for i2c + bus recovery, call it "gpio" state + Examples : i2c@f0000 { @@ -46,6 +49,9 @@ Examples : i2c-sda-hold-time-ns = <300>; i2c-sda-falling-time-ns = <300>; i2c-scl-falling-time-ns = <300>; + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&pinctrl_i2c1>; + pinctrl-1 = <&pinctrl_i2c1_gpio>; scl-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; sda-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>; }; 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: 970386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=synaptics.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="B150wx6u"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42DBYD5GqRz9sCS for ; Mon, 17 Sep 2018 13:33:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728711AbeIQI6v (ORCPT ); Mon, 17 Sep 2018 04:58:51 -0400 Received: from mail-cys01nam02on0076.outbound.protection.outlook.com ([104.47.37.76]:22553 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728552AbeIQI6v (ORCPT ); Mon, 17 Sep 2018 04:58:51 -0400 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 Cc: linux-arm-kernel , , 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+xbc4eAm9B24ghUpX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3oalnTMmcDhIHLyOZMag+Co7UKx; 4:RmLiAS0HDVteaph+1D+OFdRbWm8h1MSEAAHmgabM/yvi3GgEe0gPS5MEIPXrQkkCy3CHzxP7JJ+UzAN8SH9ZrZY28Sn2ieqlFklF1Pi57AvNuU98GmQp/3ABRXGF/6FADNvPgt7UxhD3oUopFc/lReolrRjai8Iv7SkL2HcE1o83/SB5TAt0U9qHOf6af5zY21vsBfrDHhgUtPsdnRoQRoJ+tz/g6Dy3IbduadvGo88q0r3ZfzrnvE5GaiDc0lxXeZ/KpuUaTo9ZxoeUcGehQQ== X-Microsoft-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: 1; BY2PR0301MB1574; 23:eeNLk9yx5x2p2yI83/cjhWdfoH59NXgTgLLQ3DJr2GE6gYTpf7YyMz3zUoiu8xnQ+6fAibP1Hyxj1bKi+5Wmpi38R8g/So6AHnJjwXm4JzVjsZkUebNKA+IXNUaTzL9ZuiXziA0HLKeqzpLTiVDIZ6Zq3g6RHPXaEuyuYB1T7m7NTOvxQX5nbxGR7OKnT/DAjxTkGIIOaF/JWztUeieajIYEK6rxS/Rt/bZJbvpuplq7FRvmJwmrzcdTko5A0x5l4GvYAwqEPeHF7GM+NR7xnBMl8y2tBK0okgotFQ72NHcccheTqOq6iCvyCtwrNvzAfQRWyL204w9EFAuyMHltbOT/2LVYa1A9Er4rodI9BwB3LqcGUScLpDBJWByzHA92J7PtzBoFOiFGTwtpfhbUoKRta0Qpk4dv1COxv9J6nW4gcBsPw2y1GTxXOwMiUc6D7RIooHTJUTh5FjG5rUMFT/oGRBS9rWpJ5Ev4H+2SwEJuf+/YorMCBfQfWNx+IgIDUCEPrq9vyV2E2iXAZ0vsyCdp91XLCXDAcdIrnNFhVpJDpVMn4n46b81u7B3caQXo4hU5Hcb98Hl+B4ruh/Q3I0ThIJ8AEjbN2VYBGI94PFGdVRAEOkycrIN/7qHinE6h1Ni41rIeG7884A6bIJCrHR3N6LanoyGvwN2W7MuYtQ2ZaNkvAoPe1ULh3hAK4RSKETA69bZ2NlrRX5Z+QAPzQM/q7grka4pzbIeC+r1GVEQOlC/0MgEVOmzm2egvhgJSDcljrlSYUshzKWERxQWYCAW4CDbuHNPda2hEE6hZxrba/NWdEAaoO/eMlQONLF9zOdUo38etoQsHOxyWWXkUdkpTq5KaB7OptALkKLO0pVKXgwXLGTLHPoRceBleIpQoOKOIs0i+Ohn/KC1kljnrMRVV+AtrJ8dmBX9nS4sFkslbUuytvUlFbtMtlGPtCGuwiHKOgpU4u/IMNLBgX5GKp+yzWlY73Sz9w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TCtZoaUC7QWI4q7sA22xPrbARh3SG6UpiflFxDUGfLNcZZNLCiGHcblWijhV56DUfi2/HiOsbJqeM92aIhbXuCMJwfMJIkISOKUit3AZdShp7ek7mcKVW8T5w6efJjiZIeg==; 5:XZ5zpqpwSj73vziXHfJTlzLSztxpFsYg79yXInpbhOeisfv+AnxYfv3S++be5E1H2wKEC3G1rFLWr9JJqMwIh42y70iVt4t7CSbm2qtRGSuGQSSWERCCXhvQAW4jicZQD8fjCc304TBf1DOmV430tAVx6Qxj1TJZ0A11iuw+hQM=; 7:f18scNkdpM2kztgvNs8wzNmB4VI6hSL54qUrAFAszoyi0uJUYo0F8qyiH/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 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 Acked-by: Jarkko Nikula --- 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;