From patchwork Fri Jan 3 09:49:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 11316733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFF21109A for ; Fri, 3 Jan 2020 09:50:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CCB5820672 for ; Fri, 3 Jan 2020 09:50:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="j3N8OQr7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="WLDR4/A6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCB5820672 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WJKRIt0nD3ORokITIJ1OBiy/F6fc6GlrxqW+p2NQLXs=; b=j3N8OQr7ZYYUAJ Vrb3nZbx2rk+R2Rd431odDBqky2LwZgLJRaGN0qqS5AkGU0KUst5svuz3Pi9M6hOIYWbxm51am3BK kFv9v4WNazCM0/n3/+9f0Rzjy5Jm4QCJuvNAtPNwVU5L7cyuFfYlvA+3+aL6cxM0yWFStCEfph0GG 8qQJBIMLAGshinEL0Op+8cEuOhkm8I6S0oxM7Fv+/bGeoceMPStyRp4vEZzIRcfTa1E8Egbi5JNRF PZ/dw6iLdNx1qRMB7P/0bsmkfVF7izHlaW6sBw8nkKmfvGMYb4wf28BySgR52OR+zJ10n/YrBGO6J IfjuYFIbJ1pooUg3+zVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJbW-0002Vu-0m; Fri, 03 Jan 2020 09:50:50 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJa3-0008QD-8l for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2020 09:49:20 +0000 Received-SPF: Pass (esa2.microchip.iphmx.com: domain of Codrin.Ciubotariu@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="Codrin.Ciubotariu@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa2.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa2.microchip.iphmx.com; spf=Pass smtp.mailfrom=Codrin.Ciubotariu@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: laCIMzLXLze96kd4VhHX6aAt3e5ZbvFMKe3aO06WOw2p8iUFOAlwBPNbUauYDosCAjQCGnR7wQ ARB6vUhe2yWnpXYi5XaINQwoEUl9rCRMEwR7yX3BHJvNnXOHBJ0tNTxFNv4svFrNTF1U22Eivg IIH85XoEPh3zN7xNg7vqZg4iyurHCuI598Ze6IT1ch8SUvxkGpWaA0lkTdkEskUvfHP6bUSi57 zzbknqBbAog7SGKuoTZmXmt7DrAX55rPIRroWV2Rd/qso9XWhdQkzVqifAn8QGJuZSqj9kAwcn 8ZQ= X-IronPort-AV: E=Sophos;i="5.69,390,1571727600"; d="scan'208";a="61520572" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Jan 2020 02:49:10 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 3 Jan 2020 02:49:09 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 3 Jan 2020 02:49:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G5qnkw6ChLO/q1W0CMWKfi+wGSKTB0lT7udALraBIFQEqnaEY0AK8VXztreGEK4ujkP3NWQlNdswW9AFHksT57xOMBzoVYDgPsr8IQdcO9d5KhNkFImPLe1KUmAkG18OhCFcL0YOYpnQ6vWdhOxiZd9Ss8bKjys/fZOyYlpWOy0/pPfUe2/aczifVWJB3ferM0RfR248bi3aO4obK+TOPS9RrMR9FYrrpKod3GLwr0+1awWA/W6+AFDkZsWnbyGoFbIRlmf1Uo16vete6DUGYwENssY0QQ7eA7ub2mx6f0fUtIK9mSD1f5GzS8AkdLd8OQvssbN3r/BTgrW239HG7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eSqMQROnt3CzAluTR8YEXw2FiBiHCpR/t9YCxkUfkjU=; b=H170zifAI8FPJYvB5rimVBwgUEA2FfAZQwNz3b1UDf02BR7gr4XdrtKy9ue97YuJFQMwLIbYtrwOryRgGdEL7SfMbHfAShOnUU4e9D0985YrU6wY3buiH6rKwJ9Y4M3r9oJOkfZMiRCw4oyKjMVU3D+naCCSpzf881N3MgAxdpPs+wClsou/c9td/TJ7wdQJgOLGlKbYq86eYoLa01jQLiwSgv3N5CXn2505u5QPU2mXjxDLcA0Txx62SidwORUnM+6YYqCPFDnOO1wnXsDr1JUP3PV9GNO+B1F8SuxnUH7rrv+ugwq7peAAN+sWzLmiBk4B5eBWagg8UhXHbWHoZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eSqMQROnt3CzAluTR8YEXw2FiBiHCpR/t9YCxkUfkjU=; b=WLDR4/A6tBnniE8OnpA14OLtYNyVNXZUJ1tktTxbxt2UvRi7/Lh1rEwmYlLmHM9Ot9bMIwx8sbsgp9fl4FlQVf/G0eeenuw6ljTTfHwmqVKAjkT1DloeRq6wKzyTDwH/lmREFb8JM/yCFz2W5D5dqMEkUYhY+LkZ8hpr6XBNS7I= Received: from BY5PR11MB4497.namprd11.prod.outlook.com (52.132.255.220) by BY5PR11MB4322.namprd11.prod.outlook.com (10.255.89.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10; Fri, 3 Jan 2020 09:49:07 +0000 Received: from BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd]) by BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd%5]) with mapi id 15.20.2602.012; Fri, 3 Jan 2020 09:49:07 +0000 From: To: , , , Subject: [PATCH v2 1/6] dt-bindings: i2c: at91: document optional bus recovery properties Thread-Topic: [PATCH v2 1/6] dt-bindings: i2c: at91: document optional bus recovery properties Thread-Index: AQHVwhsK1Px6bcqwdEqfvaNsF/8nOQ== Date: Fri, 3 Jan 2020 09:49:06 +0000 Message-ID: <20200103094821.13185-2-codrin.ciubotariu@microchip.com> References: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [188.25.143.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a01c8265-bbff-47cf-172c-08d790322d53 x-ms-traffictypediagnostic: BY5PR11MB4322: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 0271483E06 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(136003)(39860400002)(396003)(346002)(189003)(199004)(36756003)(478600001)(4326008)(6512007)(6486002)(110136005)(54906003)(316002)(5660300002)(186003)(66946007)(66446008)(64756008)(66476007)(66556008)(8676002)(86362001)(6506007)(1076003)(8936002)(76116006)(26005)(81166006)(2906002)(91956017)(71200400001)(81156014)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR11MB4322; H:BY5PR11MB4497.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ee87BVI0pWJdIJ0CF8fVeeS4l9WoCMwcuxssagLlTIhbMq5d0u0HRRmuQaJMp5WfTwg7ud+U5WmBbp3OYBCEdpZmDlQIhnIiC68wLD4TDaveACjBzz5AUT+q1c8pJd2xWq7D0R9LRVOp6Fvr/YzDcWs5RnZT+azJ0X5wtsO5ln37cN40ocwLm/kno1WcLNYGDyVmVNdoTypqneilSGaUgIV7Jq5YxQhi7+uR/3IPl1ytYz+7xud552pOCH6i17e3DiKX8BYO73YgV4xhgGDkOE+yjsAVu+ByV3PgewU+9H1pDz++0Poj8WZO8PMf4tk9X0ncoYOUB3hP8AfQT8n5ioODiuPFmgkd+3fSeY/sB1Ja3aY6PS4DEV2B7McqpxLS0tcAn3Hg8zSgWimO1NFWHG+lcE40slYst8awRLCYfSJ2UhRDzYiifzOZbEX/UrUt MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a01c8265-bbff-47cf-172c-08d790322d53 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2020 09:49:06.7555 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FnJ2aEYC9Y2LxQbi1QywsbZV6RGo/eeur8fnI7Cq1ZXFh0PLZqbKTkPInX+YWWKF/TveYz2d4fGlmVkaAcNp7QVFaaezW6+77qUza7QSaI8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4322 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200103_014919_373893_980EFBFC X-CRM114-Status: UNSURE ( 7.97 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, alexandre.belloni@bootlin.com, kamel.bouhara@bootlin.com, wsa@the-dreams.de, Ludovic.Desroches@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Kamel Bouhara The at91 I2C controller can support bus recovery by re-assigning SCL and SDA to gpios. Add the optional pinctrl and gpio properties to do so. Signed-off-by: Kamel Bouhara --- Changes in v2: - none Documentation/devicetree/bindings/i2c/i2c-at91.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-at91.txt b/Documentation/devicetree/bindings/i2c/i2c-at91.txt index 2210f4359c45..551ddabb566b 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-at91.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-at91.txt @@ -20,8 +20,13 @@ Optional properties: capable I2C controllers. - i2c-sda-hold-time-ns: TWD hold time, only available for "atmel,sama5d4-i2c" and "atmel,sama5d2-i2c". +- scl-gpios: specify the gpio related to SCL pin +- sda-gpios: specify the gpio related to SDA pin +- pinctrl: add extra pinctrl to configure i2c pins to gpio function for i2c + bus recovery, call it "gpio" state - Child nodes conforming to i2c bus binding + Examples : i2c0: i2c@fff84000 { @@ -56,6 +61,11 @@ i2c0: i2c@f8034600 { clocks = <&flx0>; atmel,fifo-size = <16>; i2c-sda-hold-time-ns = <336>; + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&pinctrl_i2c0>; + pinctrl-1 = <&pinctrl_i2c0_gpio>; + sda-gpios = <&pioA 30 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioA 31 GPIO_ACTIVE_HIGH>; wm8731: wm8731@1a { compatible = "wm8731"; From patchwork Fri Jan 3 09:49:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 11316725 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B052109A for ; Fri, 3 Jan 2020 09:49:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 544FD2464B for ; Fri, 3 Jan 2020 09:49:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jfwNXnrK"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="RpWB7TwG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 544FD2464B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LrxpAlkNjlDTIBBEpDP5tJ8Yvq343JXINobUZTcDKb8=; b=jfwNXnrKVSKyOJ 8sUsWNWLk8tI1duyCtukrOszpChmXdwufWZhk855qdc8o2D7BjO0DuzU+JKml6e/dAJoyGze+uV8M TG99Gnl2Q1pEdVDJHJ2ctkCmNYhM9UNMO7pR9nvlz5qdThTocKliICSRwvJa6lfigyCjbaIegBTAO syYPVuRVEC6GGSR/PBaOoA6vSWAEVsWE71GGW3pNDdbS+ZYsW0fBpTmiVbauMW5MC/7cWW/68mLqC v7vt45tDUXYw/5bvrbtKRs+U4SPXV2Bf1WJjlCHkgtSf7+yACMeCu+sN3xJRvvaSTWnz1M6PR4L6p M61KYaUdPmWMvo0ppQZw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJa9-00009k-NK; Fri, 03 Jan 2020 09:49:25 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJZy-0008Q9-0y for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2020 09:49:15 +0000 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Codrin.Ciubotariu@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="Codrin.Ciubotariu@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Codrin.Ciubotariu@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: /X7ryBPnlJoKzdeuoZN5hdxhrmtpfRTLjBJpof4SC+EEz0cTu7+I1IQMtfkZF1OyjjST8EZxxF XZnkpxSUv3gfIj6reSG5bWCIMIa3icA+6v3oJUeZM73Gdvsk/vXfgc9J28cfTxWYGTHmwWYo21 5k56nsyKSQgBxrEqeti5I/DrJNDn/13tZPAAD12M2r44x4c3fJKrEyz+f9wtJ0rbSukzufJoG9 YFZgFN5FO0VX2JxyFUxNCNQq3U32ScWpHAXh6OK8SKhAsjBlVbBiTlHEndxXfY9A2vhd8iX+26 mNw= X-IronPort-AV: E=Sophos;i="5.69,390,1571727600"; d="scan'208";a="60069279" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Jan 2020 02:49:10 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 3 Jan 2020 02:49:10 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 3 Jan 2020 02:49:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gHLE/YGlWnBpERipTEej+os0T9TDls0B66MtA3HfC+hXNeH8kRPNWFVakcJeh7pFJQggi8rjYQzThlLlNkrMQGBir3ILrfAUy+Y6OAek5Cg7Jzb4SnDKU8WeVyqAAoXo00NtD2WhnSjQT+JHrba7xOjsLW6DNujSFCnJusP6Epebf96vGJyFFXATds0b5y1NEIVV1kbLNBjip0vcGcG0H1MqgbCFWp9Hn+FssRu03YVRmDaRvIjiXQmhmvXxBIjJ/bL+bI6nm3FwEfao2SCFwR4A+lRfpgw/JykTKH9RWp/A3lLz3W5jx+Ddsv4pBz5yZDCeSVpWugAGlQMhGVSYgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jxCtcrCwWDKwNlQKPJIiIcCVxKPTfh1F28q3inb/ink=; b=TpTmG67zfBhbQlRK7LLT1uHlstokzQquvMAV15MlL5Zy0WlZswt7HkTO1SmIoirCRLhI567LxZKeCciU3BtX7qPkg2HCZoXUec2gZSvBx5BQHtdBHYCI2/icgQl2CRQJB97RkW605H0XhYP9IoIEHTUEB+isOAJCuFm9BH+Ktu7Iy2cM3fREwS8mKyxsbGlN0GQCm+WCbRORg3OLanc46oXZ+bxlcBdA8ttOFVuYFdYyI+5kHDQENYicdP+yISGtXBcxtJT+hGPGx1wb6SfLJiOUBmVcfDzIkoPHnmQQo1rcmTHeGN7YetsUdL5ImhN/kUiUNDxdq8QUrT0HTyypXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jxCtcrCwWDKwNlQKPJIiIcCVxKPTfh1F28q3inb/ink=; b=RpWB7TwGYZgMr3u4n25evkYn3MxHfgjVnfJzIx95ugcLCluWGVJQxZ6TPgC/6G3CDMoMbj8/QRI+/cYP/6935Gx+ezwSzcUnx+6qoEjxhcNVHrH2JFmscBVSj9ZQeH94lhBmJd14ACKwF/G/ABS/ayOYiN0GznEj/Jv7Zcfld5w= Received: from BY5PR11MB4497.namprd11.prod.outlook.com (52.132.255.220) by BY5PR11MB4322.namprd11.prod.outlook.com (10.255.89.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10; Fri, 3 Jan 2020 09:49:08 +0000 Received: from BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd]) by BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd%5]) with mapi id 15.20.2602.012; Fri, 3 Jan 2020 09:49:08 +0000 From: To: , , , Subject: [PATCH v2 2/6] i2c: at91: implement i2c bus recovery Thread-Topic: [PATCH v2 2/6] i2c: at91: implement i2c bus recovery Thread-Index: AQHVwhsKxM62dO/65kaQpOISnuFHxQ== Date: Fri, 3 Jan 2020 09:49:07 +0000 Message-ID: <20200103094821.13185-3-codrin.ciubotariu@microchip.com> References: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [188.25.143.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b3fe6360-f8af-43ac-5245-08d790322daa x-ms-traffictypediagnostic: BY5PR11MB4322: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 0271483E06 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(136003)(39860400002)(396003)(346002)(189003)(199004)(36756003)(478600001)(4326008)(6512007)(6486002)(110136005)(54906003)(316002)(5660300002)(107886003)(186003)(66946007)(66446008)(64756008)(66476007)(66556008)(8676002)(86362001)(6506007)(1076003)(8936002)(76116006)(26005)(81166006)(2906002)(91956017)(71200400001)(81156014)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR11MB4322; H:BY5PR11MB4497.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uMZ5FuNWzyhte8zKubUksQ4o3kOQvEF3SucBzi+eCaH6YPYRFR9mJkzFUQ7hVqZHpsz9FGGaWl50tZAg2KSP1Y+vQQpeYPZEDeG8QKcDmOUe7LT/3J+I1tTQV3ih2wxWwEGnOZuNdMz48iKn9FrRZoMcsns2/GvMgafOjM+ValWWlDoZoj29rMP1yplBbThcfsFDq0JKbe+I3VlLpfgvueiGjbNd/XELBgihxze/aQX9FJfnxB2I0ck8t5ftfmrGeR4W2WnUM235+VT0G8Ay8UjO8MresVichaOZ+yaq88Hsx9nARSyI0Wo1na7ajHyPWLtA8FCvSQW7xioTtd4g9K7HNA9ieFRLymXZ/+JnEv7dpu6MOwRG1GyZWytqD0Am5m4EkdmBi1Ov5fYN6wdpZusRVI0eTPmKb2+hWlbyoHky1/nRKTRV0+jf56hd7/8P MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b3fe6360-f8af-43ac-5245-08d790322daa X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2020 09:49:07.3162 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5jK8IfA3yIC/cGcbRwiC0iVn64PXmz59StYsnAzM2wBgJmZd/CCgvJpo0uZBwI8mTAQ22pQEbqnvAp3QxHm2CWvHzwgpRpMt66cVqG16RTs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4322 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200103_014914_133780_EA69F652 X-CRM114-Status: GOOD ( 11.92 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, alexandre.belloni@bootlin.com, kamel.bouhara@bootlin.com, wsa@the-dreams.de, Ludovic.Desroches@microchip.com, Codrin.Ciubotariu@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Kamel Bouhara Implement i2c bus recovery when slaves devices might hold SDA low. In this case re-assign SCL/SDA to gpios and issue 9 dummy clock pulses until the slave release SDA. Signed-off-by: Kamel Bouhara [codrin.ciubotariu@microchip.com: release gpios on error; move i2c_recover_bus] Signed-off-by: Codrin Ciubotariu --- Changes in v2: - called i2c_recover_bus() after an error occurs, if SDA is down; - release gpios if recovery information is incomplete; drivers/i2c/busses/i2c-at91-master.c | 79 ++++++++++++++++++++++++++++ drivers/i2c/busses/i2c-at91.h | 8 +++ 2 files changed, 87 insertions(+) diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c index 7a862e00b475..c55e8ff35201 100644 --- a/drivers/i2c/busses/i2c-at91-master.c +++ b/drivers/i2c/busses/i2c-at91-master.c @@ -18,11 +18,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -478,6 +480,7 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) unsigned long time_left; bool has_unre_flag = dev->pdata->has_unre_flag; bool has_alt_cmd = dev->pdata->has_alt_cmd; + struct i2c_bus_recovery_info *rinfo = &dev->rinfo; /* * WARNING: the TXCOMP bit in the Status Register is NOT a clear on @@ -637,6 +640,13 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_THRCLR | AT91_TWI_LOCKCLR); } + + if (rinfo->get_sda && !(rinfo->get_sda(&dev->adapter))) { + dev_dbg(dev->dev, + "SDA is down; clear bus using gpio\n"); + i2c_recover_bus(&dev->adapter); + } + return ret; } @@ -806,6 +816,71 @@ static int at91_twi_configure_dma(struct at91_twi_dev *dev, u32 phy_addr) return ret; } +static void at91_prepare_twi_recovery(struct i2c_adapter *adap) +{ + struct at91_twi_dev *dev = i2c_get_adapdata(adap); + + pinctrl_select_state(dev->pinctrl, dev->pinctrl_pins_gpio); +} + +static void at91_unprepare_twi_recovery(struct i2c_adapter *adap) +{ + struct at91_twi_dev *dev = i2c_get_adapdata(adap); + + pinctrl_select_state(dev->pinctrl, dev->pinctrl_pins_default); +} + +static int at91_init_twi_recovery_info(struct platform_device *pdev, + struct at91_twi_dev *dev) +{ + struct i2c_bus_recovery_info *rinfo = &dev->rinfo; + + dev->pinctrl = devm_pinctrl_get(&pdev->dev); + if (!dev->pinctrl || IS_ERR(dev->pinctrl)) { + dev_info(dev->dev, "can't get pinctrl, bus recovery not supported\n"); + return PTR_ERR(dev->pinctrl); + } + + dev->pinctrl_pins_default = pinctrl_lookup_state(dev->pinctrl, + PINCTRL_STATE_DEFAULT); + dev->pinctrl_pins_gpio = pinctrl_lookup_state(dev->pinctrl, + "gpio"); + rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN); + if (PTR_ERR(rinfo->sda_gpiod) == -EPROBE_DEFER) + return -EPROBE_DEFER; + + rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", + GPIOD_OUT_HIGH_OPEN_DRAIN); + if (PTR_ERR(rinfo->scl_gpiod) == -EPROBE_DEFER) + return -EPROBE_DEFER; + + if (IS_ERR(rinfo->sda_gpiod) || + IS_ERR(rinfo->scl_gpiod) || + IS_ERR(dev->pinctrl_pins_default) || + IS_ERR(dev->pinctrl_pins_gpio)) { + dev_info(&pdev->dev, "recovery information incomplete\n"); + if (!IS_ERR(rinfo->sda_gpiod)) { + gpiod_put(rinfo->sda_gpiod); + rinfo->sda_gpiod = NULL; + } + if (!IS_ERR(rinfo->scl_gpiod)) { + gpiod_put(rinfo->scl_gpiod); + rinfo->scl_gpiod = NULL; + } + return -EINVAL; + } + + dev_info(&pdev->dev, "using scl%s for recovery\n", + rinfo->sda_gpiod ? ",sda" : ""); + + rinfo->prepare_recovery = at91_prepare_twi_recovery; + rinfo->unprepare_recovery = at91_unprepare_twi_recovery; + rinfo->recover_bus = i2c_generic_scl_recovery; + dev->adapter.bus_recovery_info = rinfo; + + return 0; +} + int at91_twi_probe_master(struct platform_device *pdev, u32 phy_addr, struct at91_twi_dev *dev) { @@ -838,6 +913,10 @@ int at91_twi_probe_master(struct platform_device *pdev, "i2c-analog-filter"); at91_calc_twi_clock(dev); + rc = at91_init_twi_recovery_info(pdev, dev); + if (rc == -EPROBE_DEFER) + return rc; + dev->adapter.algo = &at91_twi_algorithm; dev->adapter.quirks = &at91_twi_quirks; diff --git a/drivers/i2c/busses/i2c-at91.h b/drivers/i2c/busses/i2c-at91.h index 977a67bc0f88..eb335b71e775 100644 --- a/drivers/i2c/busses/i2c-at91.h +++ b/drivers/i2c/busses/i2c-at91.h @@ -151,6 +151,10 @@ struct at91_twi_dev { u32 fifo_size; struct at91_twi_dma dma; bool slave_detected; + struct i2c_bus_recovery_info rinfo; + struct pinctrl *pinctrl; + struct pinctrl_state *pinctrl_pins_default; + struct pinctrl_state *pinctrl_pins_gpio; #ifdef CONFIG_I2C_AT91_SLAVE_EXPERIMENTAL unsigned smr; struct i2c_client *slave; @@ -171,6 +175,10 @@ void at91_init_twi_bus_master(struct at91_twi_dev *dev); int at91_twi_probe_master(struct platform_device *pdev, u32 phy_addr, struct at91_twi_dev *dev); +void at91_twi_prepare_recovery(struct i2c_adapter *adap); +void at91_twi_unprepare_recovery(struct i2c_adapter *adap); +void at91_twi_init_recovery_info(struct at91_twi_dev *dev); + #ifdef CONFIG_I2C_AT91_SLAVE_EXPERIMENTAL void at91_init_twi_bus_slave(struct at91_twi_dev *dev); int at91_twi_probe_slave(struct platform_device *pdev, u32 phy_addr, From patchwork Fri Jan 3 09:49:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 11316735 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F36B109A for ; Fri, 3 Jan 2020 09:51:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EFA0720672 for ; Fri, 3 Jan 2020 09:51:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GSAoxawR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="UCAKr3H0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFA0720672 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2inc+/Vdwcticb5T1sDORBlhXiJKUpWWz/QoEYP0sPA=; b=GSAoxawREtJ0Pv fS7m0KDxjn8Klw45Nk1Ud5jD1k4f5+TB3CkPc+8nrtDBwqGTxzR2VYs1uXxRlofLhANHzwbSSmxvt hqitDKpV0/4MKWu0d5A869ob0vqdnH/HCsTIm0SA0MWVcvPmUFGK2YNwNs9f8ffVUjlLWFAkww2xG xWceuwHiN/Tqx4akojDWfzrIWdqFXI0B+ZMKdau/4oU4Q7HFKDpBJ45A3kPzTy0P7DTbKX+T832w9 HkquLnrL1fjX+Mb7zM2J2/Ja/x0USvMIF5SwpvY5J9hWmTmaSb0rIlAEueh9aG0z53acE974xybyU oMtnSTCUXa13/uhFKPwg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJbm-0002jE-22; Fri, 03 Jan 2020 09:51:06 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJa4-0008QD-Vr for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2020 09:49:22 +0000 Received-SPF: Pass (esa2.microchip.iphmx.com: domain of Codrin.Ciubotariu@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="Codrin.Ciubotariu@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa2.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa2.microchip.iphmx.com; spf=Pass smtp.mailfrom=Codrin.Ciubotariu@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: Q+LSbpm2UErjB1eA7uw7VqImjW/HmjZL6YdDBzMxoW0XQD9285B627MiDXiG7UnTEyRoYOHrHJ T3f+Nu+S5f8cz70BrWz2Y8t6NNjPoa9zQ068xoEM1D7cWeefJYcMuxw04cs4tscb2ftFzqkm2k sIwqOy8AP5ZW+QQS4OXRP+Fbh1comumvPMrwZb9I+cybBLmvKtkCwUo5G6rBzoTccTmJPLtCwR ULvR90FGQseQJXBnThRCIgc1ylz43lLLAZ4bG8qa5owYDFemR1gmg3fPI9X8895QHWfjN73q+d ykk= X-IronPort-AV: E=Sophos;i="5.69,390,1571727600"; d="scan'208";a="61520573" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Jan 2020 02:49:11 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 3 Jan 2020 02:49:10 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 3 Jan 2020 02:49:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KgjvJrEuVggWe61J2c7AcwtmmiVu21v3qqBkC4xRapfng1baZFa4cVQuRTvykvvTOq6gIWU6EiZ2I0TGOeVVyaJKzHQpcW7bsJt6RLydugPbVjLVvMIFYRRvJqa6if5ZgeqfqDwJClYT1SZKu/O09sXjNCBxDUluzFZHQwryZ0+LZPUAZ7Fkvmsi+/F2lXi5IoPIhDUICGExgy/PuW/Q0UzmWq+YmGvx3slA84d5QzOGpV3t2gyhrouE1QPrZDzO4NGhUR4pZBrParR0uAFpJkUCPLSIHmMOdhEEvKE3I22WjlC55u4oTDpc8PWBc0HIDUn36nmygDIkZ4cIp9eLVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZnBNFMeHC83n5yAIWNIQJJ6T9Llh4/21RCpN9o3uih4=; b=Sp0XUEnAOPaNFSfKzcZx6ctts/dk2mEVFdZBq8n13Pr1PQ0Yy7bXsZU7NFZ6RpJOPpE/EOROsYWLBnFEKHy0qssuUqJPeCKHVL+bit+jKenHogsxFU37rfcypQzqJgzEFzgxAkVczr4dhAsbJcQ+/Nc0SxoxDSoitqoRsq0Wjlsep1FisFzvYLzq0n60DlSu2QlXPs1PfbnYuCpdJhA0K19HOrMzg3X/WUvL86E7n9S/N2vPli6BKws8ukPcSbRSXpBkMDIGgoxLsn4gXPOwHpm47VayFvQoHuREGEp53Ne2oNBXFVi2JjkJ+W5DIvEt1kgEGMUddLTWqZ67s4Jwfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZnBNFMeHC83n5yAIWNIQJJ6T9Llh4/21RCpN9o3uih4=; b=UCAKr3H0HHzUA/hlTjG0b7pNdAIbkw4OKSi1Q1UsEdIKwEeJkWp2LRQ/7CpkmTZohbmkv2+q3S6w+B20YnaZj4uYQu7mqPXDmZEHL2gg5G9G0sU+hRXmM8Q+jMaW5g/lFxBYP5mtSV4s+AE9MIu1v6bxXKtpKCmOCAzVihwaYfg= Received: from BY5PR11MB4497.namprd11.prod.outlook.com (52.132.255.220) by BY5PR11MB4322.namprd11.prod.outlook.com (10.255.89.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10; Fri, 3 Jan 2020 09:49:09 +0000 Received: from BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd]) by BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd%5]) with mapi id 15.20.2602.012; Fri, 3 Jan 2020 09:49:09 +0000 From: To: , , , Subject: [PATCH v2 3/6] i2c: at91: Send bus clear command if SCL is down Thread-Topic: [PATCH v2 3/6] i2c: at91: Send bus clear command if SCL is down Thread-Index: AQHVwhsKlTodLDZUaUCcsTrXKcjnqA== Date: Fri, 3 Jan 2020 09:49:07 +0000 Message-ID: <20200103094821.13185-4-codrin.ciubotariu@microchip.com> References: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [188.25.143.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 48c1ff0e-8d07-407a-ed5b-08d790322df9 x-ms-traffictypediagnostic: BY5PR11MB4322: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0271483E06 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(136003)(39860400002)(396003)(346002)(189003)(199004)(36756003)(478600001)(4326008)(6512007)(6486002)(110136005)(54906003)(316002)(5660300002)(107886003)(186003)(66946007)(66446008)(64756008)(66476007)(66556008)(8676002)(86362001)(6506007)(1076003)(8936002)(76116006)(26005)(81166006)(2906002)(91956017)(71200400001)(81156014)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR11MB4322; H:BY5PR11MB4497.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kIkWpXULEM56jowsxou1tLZTHDNAcKwFEQDpCyv5Wn1qS12iUIcojprBSeREBhDSZmc+mh9GlhYPCxDPdR8M8JuwmoVVR8PuzMKaZd5bjkmIzObpfnLegtPmO2c+73Z84k8qPVsTZgnZj1c+eA8YjDkfoqCboojuhi706ngs8HRPItGZE2pjLcOdVuCVEgnhUVqkcdH0+jzH864v/Le3Pj5PwrbGVzALFx9gAKCb4BqTa07mju15r+dyd/DnvwaW4waOJszWdeTbdMp1oPh9nO7hhICb+9a6C5slS4+7iskCCpOlzzQteyDps86Jpe/F8m5inCw07IpwPOvco2h2VgoDRQhR7lelTeelzX//r4S4BUkaKFTe9hxKCUBFzSgD9DQVDyt5WRO+xhgQFQEdOAzis+HsPxxj9mSJjEjbfwsZYPAkLBHikFkKjqyV8Joz MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 48c1ff0e-8d07-407a-ed5b-08d790322df9 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2020 09:49:07.8119 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZF+hHykKyiPM5al98LRpBzLgIumCVJEa1YdgXfcVEnkdgCh61srtj7XO19CtQOjl2ij1B2b/dk6cTLwgYR1Nq1yH10Ov9WXrD7BYe1BUhHQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4322 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200103_014921_175253_AE7C976D X-CRM114-Status: GOOD ( 12.91 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, alexandre.belloni@bootlin.com, kamel.bouhara@bootlin.com, wsa@the-dreams.de, Ludovic.Desroches@microchip.com, Codrin.Ciubotariu@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org After a transfer timeout, some faulty I2C slave devices might hold down the SCL pin. We can generate a bus clear command, hoping that the slave might release the pins. Signed-off-by: Codrin Ciubotariu --- Changes in v2: - use CLEAR command only if SDA is down; update patch subject to reflect this; - CLEAR command is no longer used for sama5d2, only sam9x60; drivers/i2c/busses/i2c-at91-core.c | 9 ++++++++ drivers/i2c/busses/i2c-at91-master.c | 32 +++++++++++++++++++++++----- drivers/i2c/busses/i2c-at91.h | 7 +++++- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c index e13af4874976..128eafc05adb 100644 --- a/drivers/i2c/busses/i2c-at91-core.c +++ b/drivers/i2c/busses/i2c-at91-core.c @@ -71,6 +71,7 @@ static struct at91_twi_pdata at91rm9200_config = { .has_dig_filtr = false, .has_adv_dig_filtr = false, .has_ana_filtr = false, + .has_clear_cmd = false, }; static struct at91_twi_pdata at91sam9261_config = { @@ -82,6 +83,7 @@ static struct at91_twi_pdata at91sam9261_config = { .has_dig_filtr = false, .has_adv_dig_filtr = false, .has_ana_filtr = false, + .has_clear_cmd = false, }; static struct at91_twi_pdata at91sam9260_config = { @@ -93,6 +95,7 @@ static struct at91_twi_pdata at91sam9260_config = { .has_dig_filtr = false, .has_adv_dig_filtr = false, .has_ana_filtr = false, + .has_clear_cmd = false, }; static struct at91_twi_pdata at91sam9g20_config = { @@ -104,6 +107,7 @@ static struct at91_twi_pdata at91sam9g20_config = { .has_dig_filtr = false, .has_adv_dig_filtr = false, .has_ana_filtr = false, + .has_clear_cmd = false, }; static struct at91_twi_pdata at91sam9g10_config = { @@ -115,6 +119,7 @@ static struct at91_twi_pdata at91sam9g10_config = { .has_dig_filtr = false, .has_adv_dig_filtr = false, .has_ana_filtr = false, + .has_clear_cmd = false, }; static const struct platform_device_id at91_twi_devtypes[] = { @@ -148,6 +153,7 @@ static struct at91_twi_pdata at91sam9x5_config = { .has_dig_filtr = false, .has_adv_dig_filtr = false, .has_ana_filtr = false, + .has_clear_cmd = false, }; static struct at91_twi_pdata sama5d4_config = { @@ -159,6 +165,7 @@ static struct at91_twi_pdata sama5d4_config = { .has_dig_filtr = true, .has_adv_dig_filtr = false, .has_ana_filtr = false, + .has_clear_cmd = false, }; static struct at91_twi_pdata sama5d2_config = { @@ -170,6 +177,7 @@ static struct at91_twi_pdata sama5d2_config = { .has_dig_filtr = true, .has_adv_dig_filtr = true, .has_ana_filtr = true, + .has_clear_cmd = false, /* due to errata, CLEAR cmd is not working */ }; static struct at91_twi_pdata sam9x60_config = { @@ -181,6 +189,7 @@ static struct at91_twi_pdata sam9x60_config = { .has_dig_filtr = true, .has_adv_dig_filtr = true, .has_ana_filtr = true, + .has_clear_cmd = true, }; static const struct of_device_id atmel_twi_dt_ids[] = { diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c index c55e8ff35201..8c4f20317847 100644 --- a/drivers/i2c/busses/i2c-at91-master.c +++ b/drivers/i2c/busses/i2c-at91-master.c @@ -480,7 +480,7 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) unsigned long time_left; bool has_unre_flag = dev->pdata->has_unre_flag; bool has_alt_cmd = dev->pdata->has_alt_cmd; - struct i2c_bus_recovery_info *rinfo = &dev->rinfo; + bool has_clear_cmd = dev->pdata->has_clear_cmd; /* * WARNING: the TXCOMP bit in the Status Register is NOT a clear on @@ -641,10 +641,32 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) AT91_TWI_THRCLR | AT91_TWI_LOCKCLR); } - if (rinfo->get_sda && !(rinfo->get_sda(&dev->adapter))) { - dev_dbg(dev->dev, - "SDA is down; clear bus using gpio\n"); - i2c_recover_bus(&dev->adapter); + /* + * some faulty I2C slave devices might hold SDA down; + * we can send a bus clear command, hoping that the pins will be + * released + */ + if (has_clear_cmd) { + if (!(dev->transfer_status & AT91_TWI_SDA)) { + dev_dbg(dev->dev, + "SDA is down; sending bus clear command\n"); + if (dev->use_alt_cmd) { + unsigned int acr; + + acr = at91_twi_read(dev, AT91_TWI_ACR); + acr &= ~AT91_TWI_ACR_DATAL_MASK; + at91_twi_write(dev, AT91_TWI_ACR, acr); + } + at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_CLEAR); + } + } else { + struct i2c_bus_recovery_info *rinfo = &dev->rinfo; + + if (rinfo->get_sda && !(rinfo->get_sda(&dev->adapter))) { + dev_dbg(dev->dev, + "SDA is down; clear bus using gpio\n"); + i2c_recover_bus(&dev->adapter); + } } return ret; diff --git a/drivers/i2c/busses/i2c-at91.h b/drivers/i2c/busses/i2c-at91.h index eb335b71e775..80f77d523346 100644 --- a/drivers/i2c/busses/i2c-at91.h +++ b/drivers/i2c/busses/i2c-at91.h @@ -36,6 +36,7 @@ #define AT91_TWI_SVDIS BIT(5) /* Slave Transfer Disable */ #define AT91_TWI_QUICK BIT(6) /* SMBus quick command */ #define AT91_TWI_SWRST BIT(7) /* Software Reset */ +#define AT91_TWI_CLEAR BIT(15) /* Bus clear command */ #define AT91_TWI_ACMEN BIT(16) /* Alternative Command Mode Enable */ #define AT91_TWI_ACMDIS BIT(17) /* Alternative Command Mode Disable */ #define AT91_TWI_THRCLR BIT(24) /* Transmit Holding Register Clear */ @@ -69,6 +70,8 @@ #define AT91_TWI_NACK BIT(8) /* Not Acknowledged */ #define AT91_TWI_EOSACC BIT(11) /* End Of Slave Access */ #define AT91_TWI_LOCK BIT(23) /* TWI Lock due to Frame Errors */ +#define AT91_TWI_SCL BIT(24) /* TWI SCL status */ +#define AT91_TWI_SDA BIT(25) /* TWI SDA status */ #define AT91_TWI_INT_MASK \ (AT91_TWI_TXCOMP | AT91_TWI_RXRDY | AT91_TWI_TXRDY | AT91_TWI_NACK \ @@ -81,7 +84,8 @@ #define AT91_TWI_THR 0x0034 /* Transmit Holding Register */ #define AT91_TWI_ACR 0x0040 /* Alternative Command Register */ -#define AT91_TWI_ACR_DATAL(len) ((len) & 0xff) +#define AT91_TWI_ACR_DATAL_MASK GENMASK(15, 0) +#define AT91_TWI_ACR_DATAL(len) ((len) & AT91_TWI_ACR_DATAL_MASK) #define AT91_TWI_ACR_DIR BIT(8) #define AT91_TWI_FILTR 0x0044 @@ -118,6 +122,7 @@ struct at91_twi_pdata { bool has_dig_filtr; bool has_adv_dig_filtr; bool has_ana_filtr; + bool has_clear_cmd; struct at_dma_slave dma_slave; }; From patchwork Fri Jan 3 09:49:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 11316723 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45CD5138C for ; Fri, 3 Jan 2020 09:49:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16AB821734 for ; Fri, 3 Jan 2020 09:49:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="a5D2g1ig"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="jld1yPTV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16AB821734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=efueM+s+a5GeR8Nrl2rRs/hG5wJbpUxgXcJbvm2wXoU=; b=a5D2g1igpXkeh8 e70/LDQ6K711JQUQ9pWXtkQpAHYfIeJ9tBNYCHCoSrQOPVlOrjQ/GkHl+eW7fZbFIm1qWEwWDr9v8 c4tST0mehpv9q1sQel0dO49YHnx+MhxA51jWNzRoaJaMQalXditFhv368NnBuFJtheOQv8Ery1wuV Z0f/g3lNRejokOE34yzeEeGl060+64KbNT3k2UquXBlxVBcvK+GVejRchESGASJZs5cuaYwJ7141i 0nglxUojlQlzAOQqIN6RTrYV7T8KykTkAUvZupc6C1EXS23ibXkcSbAO9R/4pBqchEzYJNS/y9BOq s+Mx4JRhekPPcL7n2jjA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJa1-0008S9-95; Fri, 03 Jan 2020 09:49:17 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJZy-0008QM-7d for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2020 09:49:15 +0000 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Codrin.Ciubotariu@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="Codrin.Ciubotariu@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; spf=Pass smtp.mailfrom=Codrin.Ciubotariu@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: tdklW5nqeBRItvXvioX1YiwWH0NjFoPVgpis2wAKX4f+DgTiC4L9focbjE9qvUEkwMEgVlI3Sj 6kZXqc13OIP5IEQYSdWX6W0lQIG9XP0BZ7agi3t0t5/GGvUVUnWaxoU4J8cpg4KQd4e3RqeTFW tT10S+PDv5FPYqekgvltvHs74D9qRJOD5NmFuQ4EWjj+JUkE1VAlRdHrO07f2UNU7urWk7777x w4/Fm3nV0jXarzjT/LBpgYuxqtCGd0+HkAAg4Hr6yGfUCfy1PuSIlfEpO2+mLDoGPnKHmFi5n8 Npc= X-IronPort-AV: E=Sophos;i="5.69,390,1571727600"; d="scan'208";a="63549989" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Jan 2020 02:49:11 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 3 Jan 2020 02:49:11 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 3 Jan 2020 02:49:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E94XzVKAiboPpc7fUQOdCztqRMGtkV8TGrAMeAeDR4BMTlxFd4ZKYsIiYYoXt9CbF89gvUEu1ebxTy+TGTPNaAvNferORys5fAOGS2me/liGBBoeGMXXe1K29H4qQ3BcAIsWroy0sV402ANjOg+Ek1usPGV77vDXPPOCvUZ6twl2OawpR6L19lfp3rvvMTfLv/tIt3s4IjZq/Trn2OHJW8EGj8xFnSWaB4rDhDSiy5Ddck1d3kpQNmvtB/50SY5sQ7ERWjQh33Xuls+3mUmRSN/HMUHseTFPLSIw/BNe1Dge7NMxfhMbYnpKuHbm9T4hYV3xqrGicNoqobmcNGM/5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S0faNSusnFY0oLWC3QmpbekQ4RtIJOw9yxLif3zF1GM=; b=jiNfHvDaWOBSVxIuKuwFd1Enc8GyLK229fpD5XrS1uzHHoLEvzfyS1ZZasTHQSdkpvEKZui1LDBd0Fd9LOnF8TIIXmXrZznazddpfMkZeNekDP4XUJH7silF64B0i0xyLNKLNXeMYPJOe+mRnELgIDdGUL41sc3k4fUlpcV++ZvB3wph58cS/ud1QPKmvJufjyC7HPfd8lifN9cpzvgY9XnXZmwNxuMuKPbx8h46LO2KA8ovmmMCl7BhK1v8Gk5iVltREJ5+2NBKcstqrjgOGOXLrMA/yS/iF3yhlGkAHqcMVzpTwP2B92AytEPwe928KgLpeoIFmSLjRIKcmCVbXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S0faNSusnFY0oLWC3QmpbekQ4RtIJOw9yxLif3zF1GM=; b=jld1yPTVoAfpSeREMC7TY/l+X/3uuLCZK2937UUGcLMa4HPuwpWXorQmaRtaMVy3LlJU6WNBegmNxT1/0jpC71Cb355p9nVTNyJd7WhaAKMSNaxfQa64gVduMNQzEpslyrXFOzEf3emgc7yajTPorlZhpaK4P+SUhWYBuEpeu1c= Received: from BY5PR11MB4497.namprd11.prod.outlook.com (52.132.255.220) by BY5PR11MB4322.namprd11.prod.outlook.com (10.255.89.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10; Fri, 3 Jan 2020 09:49:09 +0000 Received: from BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd]) by BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd%5]) with mapi id 15.20.2602.012; Fri, 3 Jan 2020 09:49:09 +0000 From: To: , , , Subject: [PATCH v2 4/6] ARM: at91/dt: sama5d3: add i2c gpio pinctrl Thread-Topic: [PATCH v2 4/6] ARM: at91/dt: sama5d3: add i2c gpio pinctrl Thread-Index: AQHVwhsLdxsZpEnI6UWudjXfEFHmNw== Date: Fri, 3 Jan 2020 09:49:08 +0000 Message-ID: <20200103094821.13185-5-codrin.ciubotariu@microchip.com> References: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [188.25.143.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b32bdd86-b601-4170-987b-08d790322e5c x-ms-traffictypediagnostic: BY5PR11MB4322: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1417; x-forefront-prvs: 0271483E06 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(136003)(39860400002)(396003)(346002)(189003)(199004)(36756003)(478600001)(4326008)(6512007)(6486002)(110136005)(54906003)(316002)(5660300002)(186003)(66946007)(66446008)(64756008)(66476007)(66556008)(8676002)(86362001)(6506007)(1076003)(8936002)(76116006)(26005)(81166006)(2906002)(91956017)(71200400001)(81156014)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR11MB4322; H:BY5PR11MB4497.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /gorkqQmQPKyu3PocDb71WlHaHCPtGnPO2wqlT3J7pjSZjDr4DcNaayRoaLsG1wOEA+6txDiMGPIEedMl8vTQWRDVHMTVdORrHldGp16P1B442sA1SBIJgIH/P6ld/1QbzvwTdwPrF9nVXKLpUYfIOZouSapiJj36uSqr5aMlLND2mhw+vTqUNNjEJe6XkPC3VFLuiW+gNSByIzNAdm/2uHjxc4aks/D0b0j72+bHFWMu34p2jG40IeXpsYCaWPC/E2olrGAeFJi6LSlEF+wrZsiT4hsnblAu1m+cKDmUn9CaDZjJbZAlQfzbzp0aozaGZegjdnkn02AC6yUI7SYpD531xxHUA91TzFlMNVZtBochVPHlYr37bJtTTWG85N4+EZQ5jEn6KXFIvtD8uE044MPXctB9a+VblJhxugfH4zceHQgepPCSfBH+3Xw7m10 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b32bdd86-b601-4170-987b-08d790322e5c X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2020 09:49:08.3187 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: I4m8CQeAuJqfZ/LKUK4nGv75rvFfHTDmjVuSxe0+AkUupNpAqDjepN6bu1B27/M+K/TF/mYGtHisMR3zmujMSSfW1xzvqQcdY1Ft0KcYup8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4322 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200103_014914_282083_5214FCBE X-CRM114-Status: UNSURE ( 8.05 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.147.91 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, alexandre.belloni@bootlin.com, kamel.bouhara@bootlin.com, wsa@the-dreams.de, Ludovic.Desroches@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Kamel Bouhara Add the i2c gpio pinctrls to support the i2c bus recovery Signed-off-by: Kamel Bouhara --- Changes in v2: - none; arch/arm/boot/dts/sama5d3.dtsi | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi index f770aace0efd..faf8907d8d7d 100644 --- a/arch/arm/boot/dts/sama5d3.dtsi +++ b/arch/arm/boot/dts/sama5d3.dtsi @@ -159,8 +159,11 @@ dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(7)>, <&dma0 2 AT91_DMA_CFG_PER_ID(8)>; dma-names = "tx", "rx"; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c0>; + pinctrl-1 = <&pinctrl_i2c0_gpio>; + sda-gpios = <&pioA 30 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioA 31 GPIO_ACTIVE_HIGH>; #address-cells = <1>; #size-cells = <0>; clocks = <&twi0_clk>; @@ -174,8 +177,11 @@ dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(9)>, <&dma0 2 AT91_DMA_CFG_PER_ID(10)>; dma-names = "tx", "rx"; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c1>; + pinctrl-1 = <&pinctrl_i2c1_gpio>; + sda-gpios = <&pioC 26 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioC 27 GPIO_ACTIVE_HIGH>; #address-cells = <1>; #size-cells = <0>; clocks = <&twi1_clk>; @@ -357,8 +363,11 @@ dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(11)>, <&dma1 2 AT91_DMA_CFG_PER_ID(12)>; dma-names = "tx", "rx"; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c2>; + pinctrl-1 = <&pinctrl_i2c2_gpio>; + sda-gpios = <&pioA 18 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioA 19 GPIO_ACTIVE_HIGH>; #address-cells = <1>; #size-cells = <0>; clocks = <&twi2_clk>; @@ -639,6 +648,12 @@ ; /* PA31 periph A TWCK0 pin, conflicts with UTXD1, ISI_HSYNC */ }; + + pinctrl_i2c0_gpio: i2c0-gpio { + atmel,pins = + ; + }; }; i2c1 { @@ -647,6 +662,12 @@ ; /* PC27 periph B TWCK1 pin, conflicts with SPI1_NPCS2, ISI_D10 */ }; + + pinctrl_i2c1_gpio: i2c1-gpio { + atmel,pins = + ; + }; }; i2c2 { @@ -655,6 +676,12 @@ ; /* TWCK2 pin, conflicts with LCDDAT19, ISI_D3 */ }; + + pinctrl_i2c2_gpio: i2c2-gpio { + atmel,pins = + ; + }; }; isi { From patchwork Fri Jan 3 09:49:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 11316727 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16D40109A for ; Fri, 3 Jan 2020 09:49:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF80322314 for ; Fri, 3 Jan 2020 09:49:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LxI95nQI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="Rc21yiw5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF80322314 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2A1ww6BEtovyiTHql9SOYvUgs2M/fOyAutiSCtuzf3A=; b=LxI95nQI45AHg+ eXLOunSgcV/UR1n7SvqExCBN2/gYP14Oa11KXigo96EM3RpXdTzuvEmIDix4+19GatxcZC/MMHgOE XlLTZ9ubxrgWRZtRWPqmMXZblpCflStB3xCZRxeEvhySDIIIByIXPM5uFwcgNE49Igbjv6YESPdNW fJ/rEcbpIXl+NVE2FTFmBfqZXi1oH0xYg8W99/hxiUX/epcdAYNHoLMZfw1IEHgE0T4eI2mMoChvs Cl9amzlrFOVUvsSyo4zZzPhB0mJKg72I4yO4JQFbvfVtNEFmoUoBVC+olkTQ/zhY8g1vw9ou/ldyy 4KiBdXfx95KaPHDTh0rw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJaS-0000ST-6e; Fri, 03 Jan 2020 09:49:44 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJZz-0008QM-Kf for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2020 09:49:17 +0000 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Codrin.Ciubotariu@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="Codrin.Ciubotariu@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; spf=Pass smtp.mailfrom=Codrin.Ciubotariu@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: zcTxnuMqBV/VDZlx2YLX4M4AsiU+oy0SrywAOQJ+47ihAH0hnWvyvCEAqwZVEU3nYztAmw7CJA FhSnWZw9goio7KQUQuWMjACiZnP6l/hUV1k3BOdN28ekPkOHpCSPDiuagslljp+2TxrF/EpELC tjarAE6x06onlR6fYztiNKw5ga/+qK88tSfUiNfzKaDtosjoM8Lgj4tP4od1Liy69K+761iLox xWWcTV1aMZpYq0efK1qyNyPQ7aDfvk0IajWMzEboo80DXPbe3Mnwhj6Qhm17AzOAh2elXreSp0 Rzo= X-IronPort-AV: E=Sophos;i="5.69,390,1571727600"; d="scan'208";a="63549992" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Jan 2020 02:49:11 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 3 Jan 2020 02:49:11 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 3 Jan 2020 02:49:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T5/6Ps8cLWAe1V5lt5ELetDSN8swpk9i0rFZ9o/ZoGRy/khJ+pfpMBWR2dVv5UG7iLJz0UiUmSH6GO4wfK1GlqaLouwiMrLSR3OMIxPYE1oflSobTSRc5Qd7oCaUwxGn/GLFwvD7k8zEomA/LHnpfi8cPMK6c3CEh4PZT2EotmDUGitG3JK9X6jrKTqJVMqZZ0+W6y1L6XQ5ON47O0/YPESppTIeraNDfQJ53z0ZGD2El7uJWDddSiRkK/LcfrK9VJTA8yB34yXoh+XIpM4HTqFl9zhM+R0evT+z/mJhY3LD2MVFOVNlL70cik4WCsZ4qGU87r2CiXlPqoSuiaGHpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rNlY4/geJghROeW3WAIqePb9FJ3R0XEowKqPU+31Cz4=; b=abDN0uzl85sz8Buedy+c4lfNnG1J+R/Mchb+0i0mMkrOj+3RefOOtnfq2TGC1qnk8SQ9YbNePt9cHUnAACUJ57MOwWOagmK6ttyyzRyDXcAU5Ygtz108bW40/XAXq/VpAYeV/e1Dur+sMhYiKKh7ze0VyZuaB0OD2s4Ah2e48z9kErqjx517UHdNrmW85dnpv/jyH1TMnWSTCiiOa7sB6/N6jczMFf4PE0lShjjBiYqCWuXc7A2U3Ow4MVZ02/VPANQcR4S0zfbQe3qqwVnKprJNv5+aXzEbTBohI5oGiEokJRtuBDubC5j8VrDzpuYKu3WTzaTCjRMVxUh61XVM9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rNlY4/geJghROeW3WAIqePb9FJ3R0XEowKqPU+31Cz4=; b=Rc21yiw55y2lBBPD4UvHxqmJUvM/Uj1hWzmNdflySrCum4RbQZgfJw0THhfEDGjfJdhaebtJHcZHUhJ6WdDt7cmxONpVv7YPDoVLDp2/9iTZBfDEu+eMhNBZWrCVU6ou7w2TO7w8c1v9Qs/kmyUZy7MflwUCEZX8uaOxkMjPmaI= Received: from BY5PR11MB4497.namprd11.prod.outlook.com (52.132.255.220) by BY5PR11MB4322.namprd11.prod.outlook.com (10.255.89.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10; Fri, 3 Jan 2020 09:49:10 +0000 Received: from BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd]) by BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd%5]) with mapi id 15.20.2602.012; Fri, 3 Jan 2020 09:49:10 +0000 From: To: , , , Subject: [PATCH v2 5/6] ARM: at91/dt: sama5d4: add i2c gpio pinctrl Thread-Topic: [PATCH v2 5/6] ARM: at91/dt: sama5d4: add i2c gpio pinctrl Thread-Index: AQHVwhsLamZuwKYHskigz/jRdMTeAQ== Date: Fri, 3 Jan 2020 09:49:08 +0000 Message-ID: <20200103094821.13185-6-codrin.ciubotariu@microchip.com> References: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [188.25.143.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 31a3c802-fee1-442e-08a7-08d790322ea5 x-ms-traffictypediagnostic: BY5PR11MB4322: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1751; x-forefront-prvs: 0271483E06 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(136003)(39860400002)(396003)(346002)(189003)(199004)(36756003)(478600001)(4326008)(6512007)(6486002)(110136005)(54906003)(316002)(5660300002)(186003)(66946007)(66446008)(64756008)(66476007)(66556008)(8676002)(86362001)(6506007)(1076003)(8936002)(76116006)(26005)(81166006)(2906002)(91956017)(71200400001)(81156014)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR11MB4322; H:BY5PR11MB4497.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9ZsEwlLaRH4ggki1zHIrtvTe8URLGQ3XuebQn0vhWt+PBqNtoqe52QhuBOavbE5GkFORisOKJQhsj7lWad3Pfnx49Jbbz4LRiO4dGn3Kj8MRaKNCcA5FVJv0Ei9hAnlcN/FM1/n4FUi89usCJm5gCBwNWOWqp5b8I2Lurjj3l+ggK10l4sz1p2RjebfcPUQsh2oNx1peAqMvL/1mGkAYw7pNeMcVWcuGGj53TPTmth6gx0gtUQo815UUOqaN1PkA4/P6EuFhvUox02pS6V5A+c8hGw0rOXm8AETH3JbKr4vtdFxObZZTy93emy6jmoIylnBEgZULLus6E8qrhHA0hZcAQAPCRGhjrfl12hsrg91KY+lfq6FQj+mFg6HSOsh6JghOY9VdM0HDMW72l2S1W5bJZaJbyA5HKOd4eXaVG29b0ndVj5X61451h8XeHlrr MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 31a3c802-fee1-442e-08a7-08d790322ea5 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2020 09:49:08.8124 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AUqqcUE0bKx90Lblv5YZ+zbm0HuPmteg27MVPiOVQtOnlm/1V9/p6BeMdH0JaFIKe4UmPedtixeRxbCzSupH47+Xuc4H8T/ybcJMMyVThLw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4322 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200103_014915_691759_E43D3558 X-CRM114-Status: UNSURE ( 7.60 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.147.91 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, alexandre.belloni@bootlin.com, kamel.bouhara@bootlin.com, wsa@the-dreams.de, Ludovic.Desroches@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Kamel Bouhara Add the i2c gpio pinctrls so the i2c bus recovery option can be enabled Signed-off-by: Kamel Bouhara --- Changes in v2: - none; arch/arm/boot/dts/sama5d4.dtsi | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi index 6ab27a7b388d..34351baab985 100644 --- a/arch/arm/boot/dts/sama5d4.dtsi +++ b/arch/arm/boot/dts/sama5d4.dtsi @@ -458,8 +458,11 @@ (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(3))>; dma-names = "tx", "rx"; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c0>; + pinctrl-1 = <&pinctrl_i2c0_gpio>; + sda-gpios = <&pioA 30 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioA 31 GPIO_ACTIVE_HIGH>; #address-cells = <1>; #size-cells = <0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 32>; @@ -477,8 +480,11 @@ (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(5))>; dma-names = "tx", "rx"; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c1>; + pinctrl-1 = <&pinctrl_i2c1_gpio>; + sda-gpios = <&pioE 29 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioE 30 GPIO_ACTIVE_HIGH>; #address-cells = <1>; #size-cells = <0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 33>; @@ -519,8 +525,11 @@ (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(7))>; dma-names = "tx", "rx"; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c2>; + pinctrl-1 = <&pinctrl_i2c2_gpio>; + sda-gpios = <&pioB 29 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioB 30 GPIO_ACTIVE_HIGH>; #address-cells = <1>; #size-cells = <0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 34>; @@ -1122,6 +1131,12 @@ ; }; + + pinctrl_i2c0_gpio: i2c0-gpio { + atmel,pins = + ; + }; }; i2c1 { @@ -1130,6 +1145,12 @@ ; /* TWCK1, conflicts with UART0 TX and DIBN */ }; + + pinctrl_i2c1_gpio: i2c1-gpio { + atmel,pins = + ; + }; }; i2c2 { @@ -1138,6 +1159,12 @@ ; /* TWCK2, conflicts with RF0 */ }; + + pinctrl_i2c2_gpio: i2c2-gpio { + atmel,pins = + ; + }; }; isi { From patchwork Fri Jan 3 09:49:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 11316731 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D4A9138C for ; Fri, 3 Jan 2020 09:50:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52F2622314 for ; Fri, 3 Jan 2020 09:50:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dBNDcEeO"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="Iz0kLaNy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52F2622314 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uEY//+7DqOYXg0kNo4TqWhjqIkxS/RHLijJ99YJgDf0=; b=dBNDcEeONsqJo4 1epx/FB3QX4Zr6TgkSBl5aJo+1ZtwcB5lWDpKw3TO35ksg+liq6IRqvd61fwC5YgonkRJl7G0LeoX clwPRrKM77ew9XGmfQ69jdxJRa4l0LC4ht9jvnj9QjXLKFDmjZVtNbT1DrPcb8XAdIRF5eYZEj6OJ jxRf83BuLH9JUx/RVnukTy7hUyEdWjk98pDYdZ11dFaH8DgVN3SruV4WsDyCjjhdfwBWJkGVPTOet B0fwse0KGlIhJ5lwpZqU6ub/PfT475hyaI3H/MolGHSNF4lzdjtEgx+bNrWCUBRhLRviEHDDJzJE+ mLC8xfnyzGsQM4MKT6pQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJbA-0002De-OO; Fri, 03 Jan 2020 09:50:28 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1inJZy-0008QP-7u for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2020 09:49:17 +0000 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Codrin.Ciubotariu@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="Codrin.Ciubotariu@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Codrin.Ciubotariu@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: QGRPuk8gB/8sMupB7q64mmJk3yuh2lpLS21WykBpz3SQ52ZRhjM8lHko16ERwejTa5mAUKwx50 /0W68Q1IKfazcR7odV491XUep2DTX9b28ZqLRziwwp7M/NJu36hAVSlJuBuxm+8T3FUe4o9Z9p kZLLhDR0Lr0N69D9nwYA64v7TfHiUm4MOdl+09aJq2e16KJHw3U5XcVJ3WADTwd7EVppzDJYS8 0esV2tvwXb7OWPAofQf+3yHEc5dfjpuGvNbpA+J/59MOZplG0zly5cAMsOh+GcpJfUrASst9jF APo= X-IronPort-AV: E=Sophos;i="5.69,390,1571727600"; d="scan'208";a="60069284" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Jan 2020 02:49:13 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 3 Jan 2020 02:49:12 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 3 Jan 2020 02:49:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HnSfnsFAGirEDmN0Fc4V7aXR1HJVSmnW3TqlMR5TiKRSmDRkeNxvnWnEj4dxTVnM1n5wfjyc66rrW+6Ffx++lWNk/AMDglstvogVi3bWGO+IVwMZiJWvdds2jWGVWJ2NKjFveVntOzNNxgVPGoL/wxNz4DqbdmoMGjOfegUM4Ga+rr2kcNhEbMI3PZxKQmYp3zM571L5PO/g+8p649PvKznqoen5h58yc8fQJSVl3AD2q7ngGktlw2hhEKiO2tfEq0F1cfmbNxMRn4p5V3JbOK0kg7nxlAMQBgiUY45pAIdnkyz14bFNveteH/xyujnbbI4VPDbztZccIFBMFk8mBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f6bwmnCiDUsQGEXgrGEXUCfuT+rLtPs6FYZ31p5mIOY=; b=ZqmsCmFEIWkTtyPSKm3WqN9gbH/MT06uQ9/dgqrJdJsRrpRgc5owvih0Ap+ur+PZ9YWeUa3BSJeHV55azYKgNJd2CWc0UYMw+w3y2/i3dXzJmQvEph5xrXigv5cCzHzKLxCBk+fqloRK+enqSfZutQYpt4r5nqH3XuU8cjhw1gqNM1peCzZjEQgUSyB13YpAPqGv4P0osAX01NXaFfMlla7dnYtWVCRV3kRbnPkEEssc/gyDYMnPXv1j7VuchYUXde9+mJjAr6kdAtSw0KTCb7HOJpuEbv1JvWGcc7KD18t5gJudrfEZIcG3WhTLLH9mpjFYZPPX4uh0BZGTLv32Ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f6bwmnCiDUsQGEXgrGEXUCfuT+rLtPs6FYZ31p5mIOY=; b=Iz0kLaNyZhJT8datfs4hmeA5PA8PwuLkQCP+oYqLoQaU4LH3zhWJPA8JfGfmogLZpA9lSWDijeSyEyuSKaLQFdzP4I11AIKN0MYaQWQ5G6NC8mCPytqsR4ytfHMa/1v1arZl3gziBpJAkPSzxot6WPL5+DZM0dQuZRDx+DWuzEA= Received: from BY5PR11MB4497.namprd11.prod.outlook.com (52.132.255.220) by BY5PR11MB4322.namprd11.prod.outlook.com (10.255.89.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10; Fri, 3 Jan 2020 09:49:10 +0000 Received: from BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd]) by BY5PR11MB4497.namprd11.prod.outlook.com ([fe80::6189:c32:b55b:b3fd%5]) with mapi id 15.20.2602.012; Fri, 3 Jan 2020 09:49:10 +0000 From: To: , , , Subject: [PATCH v2 6/6] ARM: at91/dt: sama5d2: add i2c gpio pinctrl Thread-Topic: [PATCH v2 6/6] ARM: at91/dt: sama5d2: add i2c gpio pinctrl Thread-Index: AQHVwhsLFgQ03HwbOEOfeRBM/f7rHw== Date: Fri, 3 Jan 2020 09:49:09 +0000 Message-ID: <20200103094821.13185-7-codrin.ciubotariu@microchip.com> References: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20200103094821.13185-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [188.25.143.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d5fd67e0-952d-430e-0831-08d790322eeb x-ms-traffictypediagnostic: BY5PR11MB4322: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 0271483E06 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(136003)(39860400002)(396003)(346002)(189003)(199004)(36756003)(478600001)(4326008)(6512007)(6486002)(110136005)(54906003)(316002)(5660300002)(186003)(66946007)(66446008)(64756008)(66476007)(66556008)(8676002)(86362001)(6506007)(1076003)(8936002)(76116006)(26005)(81166006)(2906002)(91956017)(71200400001)(81156014)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR11MB4322; H:BY5PR11MB4497.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k8x9WlqxGlivoSvKONm587fmmHlCKPDnGQTxdGQv53xHbv/lLahsP8qRNjHNQtlNeY1Qn0pDbhkVkKeXiDNy0Ymn2WovVNGF9C80HA6S4pIxSlchDVk7TEqOKzKi+uIhV2k6xr3vzqw44FQsHnXA2XggLHt/wotzId5lOu7On8vqLceteMOk4u2MVA7TphjwfTv4jPnUHPivcywivK5giAJcBzD6JUWHb+btEIWJHky0zwk4tpZ/6O3JQawJ84rRlspHcSZZQYQSGK8grzE0inXI5+v+7vt9WYDHsVTYHhYKaU7eU1/JHqNZG1bbxju5sTWNFUZZFLJ+/Xvr6DvOwz7ichhQY2RscWzr1o4+YgN6p8rIIVZZwRgnso7iNq+NVH1htAJkNpuzpZj1Nl7EW86ZGOkzAZrgqxpEV0atbSIF0Y62y9cyoS5qcUyXaGi/ MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d5fd67e0-952d-430e-0831-08d790322eeb X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2020 09:49:09.3501 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pPUfn8DfI9sJCI8j/KwJT/xpRF6DD+BeRp2ci/JsBYiGmzW0Btpq6HLs2KqH9LkFaisN2cJ7JQNJfprlJvU/+FeNdxAOzVWvwHZSGS9QEgU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4322 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200103_014914_318951_3841B0F4 X-CRM114-Status: UNSURE ( 7.59 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, alexandre.belloni@bootlin.com, kamel.bouhara@bootlin.com, wsa@the-dreams.de, Ludovic.Desroches@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Kamel Bouhara Add the i2c gpio pinctrls to support the i2c bus recovery Signed-off-by: Kamel Bouhara --- Changes in v2: - new changes; arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts | 33 +++++++++++++++++++-- arch/arm/boot/dts/at91-sama5d2_xplained.dts | 33 +++++++++++++++++++-- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts index ba7f3e646c26..b3cd651ecda0 100644 --- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts +++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts @@ -180,8 +180,11 @@ i2c0: i2c@f8028000 { dmas = <0>, <0>; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c0_default>; + pinctrl-1 = <&pinctrl_i2c0_gpio>; + sda-gpios = <&pioA PIN_PD21 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioA PIN_PD22 GPIO_ACTIVE_HIGH>; status = "okay"; }; @@ -198,8 +201,11 @@ #address-cells = <1>; #size-cells = <0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 19>; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_flx0_default>; + pinctrl-1 = <&pinctrl_flx0_gpio>; + sda-gpios = <&pioA PIN_PB28 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioA PIN_PB29 GPIO_ACTIVE_HIGH>; atmel,fifo-size = <16>; status = "okay"; }; @@ -226,8 +232,11 @@ i2c1: i2c@fc028000 { dmas = <0>, <0>; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c1_default>; + pinctrl-1 = <&pinctrl_i2c1_gpio>; + sda-gpios = <&pioA PIN_PC6 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioA PIN_PC7 GPIO_ACTIVE_HIGH>; status = "okay"; at24@50 { @@ -244,18 +253,36 @@ bias-disable; }; + pinctrl_flx0_gpio: flx0_gpio { + pinmux = , + ; + bias-pull-up; + }; + pinctrl_i2c0_default: i2c0_default { pinmux = , ; bias-disable; }; + pinctrl_i2c0_gpio: i2c0_gpio { + pinmux = , + ; + bias-pull-up; + }; + pinctrl_i2c1_default: i2c1_default { pinmux = , ; bias-disable; }; + pinctrl_i2c1_gpio: i2c1_gpio { + pinmux = , + ; + bias-pull-up; + }; + pinctrl_key_gpio_default: key_gpio_default { pinmux = ; bias-pull-up; diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts index 9d0a7fbea725..500e49eeb8cc 100644 --- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts +++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts @@ -129,8 +129,11 @@ i2c0: i2c@f8028000 { dmas = <0>, <0>; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c0_default>; + pinctrl-1 = <&pinctrl_i2c0_gpio>; + sda-gpios = <&pioA PIN_PD21 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioA PIN_PD22 GPIO_ACTIVE_HIGH>; i2c-sda-hold-time-ns = <350>; status = "okay"; @@ -331,8 +334,11 @@ #address-cells = <1>; #size-cells = <0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 23>; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_flx4_default>; + pinctrl-1 = <&pinctrl_flx4_gpio>; + sda-gpios = <&pioA PIN_PD12 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioA PIN_PD13 GPIO_ACTIVE_HIGH>; atmel,fifo-size = <16>; i2c-analog-filter; i2c-digital-filter; @@ -343,11 +349,14 @@ i2c1: i2c@fc028000 { dmas = <0>, <0>; - pinctrl-names = "default"; + pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c1_default>; i2c-analog-filter; i2c-digital-filter; i2c-digital-filter-width-ns = <35>; + pinctrl-1 = <&pinctrl_i2c1_gpio>; + sda-gpios = <&pioA PIN_PD4 GPIO_ACTIVE_HIGH>; + scl-gpios = <&pioA PIN_PD5 GPIO_ACTIVE_HIGH>; status = "okay"; at24@54 { @@ -441,18 +450,36 @@ bias-disable; }; + pinctrl_flx4_gpio: flx4_gpio { + pinmux = , + ; + bias-pull-up; + }; + pinctrl_i2c0_default: i2c0_default { pinmux = , ; bias-disable; }; + pinctrl_i2c0_gpio: i2c0_gpio { + pinmux = , + ; + bias-pull-up; + }; + pinctrl_i2c1_default: i2c1_default { pinmux = , ; bias-disable; }; + pinctrl_i2c1_gpio: i2c1_gpio { + pinmux = , + ; + bias-pull-up; + }; + pinctrl_i2s0_default: i2s0_default { pinmux = , ,