From patchwork Fri Sep 13 10:37:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wojciech Siudy \(Nokia\)" X-Patchwork-Id: 829095 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2043.outbound.protection.outlook.com [40.107.104.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD8E780B; Fri, 13 Sep 2024 10:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726223857; cv=fail; b=Fxx8uFRui2X9WSF2cioh/PORQmlx9VSyEc3D5jFEWvct9/LauGR+fmqvHA0Z2T+T/cnFyZuLXV+BHWSfN0GuyVPMey1zNMXkNzJMbkqAfEORb0b0oZL61wl1a3PeTdnKKDYnQ4ZQVTJ6Evqx05AB+uC77T7RpQRVDm81+AEq3jQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726223857; c=relaxed/simple; bh=B6rVBiHEre5aw3k00IOynDZyCjkwj8pNUcpe4HHhXW0=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=u8XAif4EPaN7VWEyIY+a137kheLC78bDRZWFPz/1E2PhlM0GEafz7J8M1sZEemzn1y/EwLcAawPtw8/bhwKKMbsBA/ou4X5ZKOvboNCre62xcDYMw20qfQUrey/vg5dy1gapnv/MbiPZsY78H9nPNbZuGOmXKxJqG43k2xn/wdY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nokia.com; spf=fail smtp.mailfrom=nokia.com; dkim=pass (2048-bit key) header.d=nokia.com header.i=@nokia.com header.b=el3sPBs1; arc=fail smtp.client-ip=40.107.104.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nokia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nokia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nokia.com header.i=@nokia.com header.b="el3sPBs1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lpkb/xfZ2U01XIRkNiH14tGjgvNFvmjWna67SJVKSVJ6qtipAfCp8CUDp2Eg8D5ozA/DXQTQzF8jXyFSp7lPR+K7mNV/c5EFdm4tJITdFRsJma4HAppD1Z4OYx76pmsRovIK5KiuxcaWKJC384+JAwPSTn5RloSOWwAYl2l3hmxkn5+1SfzbF+lOEg6ZQYWnmFVGVVs7uWLtBK61xBLh4cq8Y46z5D7DKvfF9B2H3T8Nil3df+upDeQN6ajYxhXdr8A6NSJkF7qUYfTNYvWXQRBvz7apj1SfKAn8OZYRL8Se452lUcGYgAsCZODMYxVuQ2HMmoqJNPRUQrxb9sQJtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DBWD1K4+3RfYOz6ml5XAu+I43C6yVC4FsoCZR6m1a4I=; b=HsEwP5147sMH1JLwuwUa6S7SjuD8gcWePyfj+fkqwsVqwzMqu4viTyd3r5Zt1kP5ydnaIzz6FAuUg+g3go1MnWMBZCuRZ+e+5ayuU0bLXPfXOBwhLLsaP7XTpjoB6LTZfHd4EjCNiVUykbi54LdYd5U5FqFkVA5i3kFWnwItj4fbUqyX06nJE1JYzq7Rx6jSwVjSZV0JONuMb5LYGAQbw/wMMNLlxuyj/kCu5ZowTbjpDqkw6d+GNOEw+9IrTDL68Gt+qzBtzSXeVOQTVsU6CLdDiupRJH1fNx4+Da0wKo3EKTn4dfiv/dUozLcWRNz8NokHK1je//iAM6C6HZsbQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DBWD1K4+3RfYOz6ml5XAu+I43C6yVC4FsoCZR6m1a4I=; b=el3sPBs1VeCIdJC3CrClpj9sMNHspsF3hhvCb8H4comCe3Q8XeqzH94ih/qT3gjgXraX/W/amyTkTMBhuK5xIL191y0vb2CS7ZwkrOLSREf/cEwkfsl6TZAxpvZ93M4ugBPVub+wkHQnmkbmsi1+Iwy2oB9nzmPm/gZQf8/F7wJ52FFth5zDoSA4pfQoORvUpqLYCcKaAbdMtiTm7nm8mFUB6apneJUHiQVbONXE+L5zLJfwroPOwcvjXSX/nT22h0aSnQtn1eoFFmNt7LdHQl2LYnZoOG5ppun9OKSRwcmBSJ3ugz/hUsmbvJxQH2kwouklrm1jYEC8Cu5VSnggvQ== Received: from DB6PR07MB3509.eurprd07.prod.outlook.com (2603:10a6:6:21::16) by VI1PR07MB9408.eurprd07.prod.outlook.com (2603:10a6:800:1c3::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.17; Fri, 13 Sep 2024 10:37:30 +0000 Received: from DB6PR07MB3509.eurprd07.prod.outlook.com ([fe80::5484:a966:1322:f78b]) by DB6PR07MB3509.eurprd07.prod.outlook.com ([fe80::5484:a966:1322:f78b%6]) with mapi id 15.20.7962.017; Fri, 13 Sep 2024 10:37:30 +0000 From: "Wojciech Siudy (Nokia)" To: "linux-i2c@vger.kernel.org" , "devicetree@vger.kernel.org" CC: Peter Rosin , Andi Shyti , "laurent.pinchart@ideasonboard.com" Subject: [PATCH v4 1/2] dt-bindings: i2c: pca954x: Add timeout reset property Thread-Topic: [PATCH v4 1/2] dt-bindings: i2c: pca954x: Add timeout reset property Thread-Index: AQHbBcjQ3MHOkSAFhkWJk/Sp2JYEzA== Date: Fri, 13 Sep 2024 10:37:30 +0000 Message-ID: Accept-Language: pl-PL, en-US Content-Language: pl-PL X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DB6PR07MB3509:EE_|VI1PR07MB9408:EE_ x-ms-office365-filtering-correlation-id: 8a6149e2-9181-4a9d-2ed8-08dcd3e011b1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-2?q?BbFkpTWiK59j7ZresLUjN+UsQx?= =?iso-8859-2?q?zylUYtWLgP9Aa9Sl+SQnV3ZODu3/iz5M6rdKEhtlGjFErQ1rJOAfjH3h3iIq?= =?iso-8859-2?q?Zyuy/nOqr9D8VcQ8+/lLLX8cXM9ZQmKvH5BvWfo/akoEynFjvWHGlJv27E33?= =?iso-8859-2?q?U7vEHIuGJ6wL3M/SAfUCuGYjY8BoIi644nYwVIjoA/lyGq+OLCShcnndWRsb?= =?iso-8859-2?q?YAMd9Vc7JzVav7Hv67JlQazaIkwumySnD24eSB1sKGW6rAZZvRwtx1ewn5Cc?= =?iso-8859-2?q?8pZq4F69A1tTNS8b8zcZA2SMJitHYQRbq4pHM1DpJsNXl9XOf9m6NnuJpjtA?= =?iso-8859-2?q?jD/iutljmnVnfeG5YM595/oXJxxGy6SpJZCmkmZn5r4BFmZgNuXSSWmj3i2O?= =?iso-8859-2?q?c1TokvSoujGNu8lGULOFPITG+18VmjYZZPHnfzxspOc5PJdH1An+9L/7DMkh?= =?iso-8859-2?q?PicloKLANq0hOmX760PAVfyVb81DaHIqG+OnZIoTEx2Z/5i4ltRzPzqwtPuU?= =?iso-8859-2?q?ze41GeIgLEXPmpCdlPb0pWzHzRrfBg84k5HTLz0y1AsK581CszPWiC527udX?= =?iso-8859-2?q?Dhud7zJ8YdJjI8wsUZ93gN+SuN6IfpKen7VaYsvVpl2hhzjV2nlVj9xQgR2o?= =?iso-8859-2?q?QnuJWX53mewY07oeVXPOklx3NY64hO3ttYlRSMXj8tj9RqQqPevG7HqWERva?= =?iso-8859-2?q?kuVmdMchF7LhB+3O20UHZ0cMbkS1DBPw+uVpElUQis9e1QZzENzZcBt7gND6?= =?iso-8859-2?q?JbtRkvH2ClCp4Nne72E8OH3UYzlYkCSLenTHcAfufEEvuBPsUUUNO1k4wLoN?= =?iso-8859-2?q?RZX6yff2j2del/vPpFqCvTpmg7HZ60/wsxekZSFUe0IXXQHqdIteJCqdRtgJ?= =?iso-8859-2?q?dqkb0FSqq+GIkicOM5tk6zXpYGrJtMwsk52y9s22Rpb7EDjyZW798wreU4UI?= =?iso-8859-2?q?iZqf7AHZ8PmJYxS0kTSe9fV32LdcOcPMEbE1OWUQDvDthUttvs/Yylue2kmO?= =?iso-8859-2?q?8yqP3o+z73Aq2ylZaKBY4nc0I5uCZOf1AxZJsJh8f78GWaNSmEAdnWSAVh/c?= =?iso-8859-2?q?+gJ5RxUS75L9ql13kTkIVgVg5iVMT0Ejjo0jawLVXYv+GUIxgH4YnC8Wy7Xo?= =?iso-8859-2?q?alVs6/ApyOPhkA824rbjZ/h9IMuLwzIMhMCGbtKHhz8R5cGn/PiH38HZQH2d?= =?iso-8859-2?q?WDFXGseDUtLfZrX2ZH+Li3S6UmL+ho8bYdbLv8SySpYpiL6mEvKuSfhrHojO?= =?iso-8859-2?q?53dGQx52E4RvuYAdgld0moE/+BLn+BEzAbe/qqhJOdpUol9ZCF1i+I6z+0ow?= =?iso-8859-2?q?fuoJCNMOcJSximPSqfxXChEi/1YGyudM1HnnVXvfCTAjmQTZV8hUOxsnukEH?= =?iso-8859-2?q?Ue6fTBOczhZnPuQFuvUQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR07MB3509.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-2?q?QsyDaAtJNXNOZa9gC6jAVr6?= =?iso-8859-2?q?hDpIMjDtWZxOSpNJCjV0bdfrb8YNIcaqiLvsJpZqbC1/Oi3BqOEY5+pEZCkR?= =?iso-8859-2?q?lOz/XnExNXOFUTWUAJNx8F9IBJqlrb9+Y4ImqEghm1bTEoWZ4J/u8mjy0ipx?= =?iso-8859-2?q?VuiPIC+KwLeCO9qJJXQMd/HMzbiuZ1yVV0l72NhOmAtvIWbhnXKqFkBNTPGQ?= =?iso-8859-2?q?4oSethlGRQCu9lHOoTdBG7bCsPoX6mNluqijzn0LPv/L7NudTQ5qY21+J6UW?= =?iso-8859-2?q?zSqIGgYH4udYpSvmKJz0Esn3wYU1RUmSnfDQcgpICZXaQcm68hCOGCNIVuQw?= =?iso-8859-2?q?XerPvRmYfvefbNMaTCSSdsOOfLeTevn7jH7p7Nejl7VXinbEbS6Loeic+sIl?= =?iso-8859-2?q?m/AHYuo/e0dwRitsxHzLyPzS6j9/7+6K9yCzz+zZLWK9CAVY0J6++IvCRXu7?= =?iso-8859-2?q?q5YdDTROqZzsPuOWboko6X51XXaXEWw6svi19D/F7CnT1A4oZZLdY6tqxvCT?= =?iso-8859-2?q?prV4EDrIBOpScpd6nv/gSdFNLDlB1mcoJI5J/OxNDCayU8WP0YpWNCfARzVl?= =?iso-8859-2?q?n+/X2oifgK7buGBd3YTObFkIVP7LHLWpYgk+ySgtRPghDC8kKECvCL3SIrLI?= =?iso-8859-2?q?ElZA1Bpl6SJM2qWcyNtdcGL0x51eZ0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?= =?iso-8859-2?q?u+5BH9MM2GaYACEI2BnnwK3ahtTkmSoF3GRzQ4p2keDSNWPkzzzcLtQzRSRy?= =?iso-8859-2?q?9YqHmqISuDCnKLD3r?= Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB6PR07MB3509.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a6149e2-9181-4a9d-2ed8-08dcd3e011b1 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2024 10:37:30.2284 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EOARj+p+gDS+FnpKYR16PlzTzWtsoZ9syneSldSTKXuklz0uenoUFRaQdpTo+gBm7GsN1JN8hBNp1n2lLxn4ky8zu+bkQSH85hMFMOJ5bvI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB9408 From: Wojciech Siudy For cases when the mux shares reset line with other chips we cannot use it when channel selection or deselection times out, because it could break them without proper init/probe. Signed-off-by: Wojciech Siudy --- .../devicetree/bindings/i2c/i2c-mux-pca954x.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml index 9aa0585200c9..872be72da965 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml @@ -63,6 +63,12 @@ properties: necessary for example, if there are several multiplexers on the bus and the devices behind them use same I2C addresses. + i2c-mux-timeout-reset: + type: boolean + description: Sends reset pulse if channel selection or deselection times + out. Works only if reset GPIO provided. Do not use if other chips share + the same reset line. + idle-state: description: if present, overrides i2c-mux-idle-disconnect $ref: /schemas/mux/mux-controller.yaml#/properties/idle-state @@ -146,6 +152,8 @@ examples: interrupt-parent = <&ipic>; interrupts = <17 IRQ_TYPE_LEVEL_LOW>; interrupt-controller; + i2c-mux-idle-disconnect; + i2c-mux-timeout-reset; #interrupt-cells = <2>; i2c@2 { From patchwork Fri Sep 13 10:38:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wojciech Siudy \(Nokia\)" X-Patchwork-Id: 828388 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2085.outbound.protection.outlook.com [40.107.241.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51BCA1D88B4; Fri, 13 Sep 2024 10:38:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726223916; cv=fail; b=A/gxQI3q9Hl8pDmQhzg2ZFsKTTzopyqe8/Iem1f1I1FSH4XMWVSAffYJVa5IbHgbORMa9+P7EiHeYvtnsNIYfaQrnKPSBXAd6xIo1FQS1jiLwz9c0G/o6W6RkrWZe/K2ILNBCQklr/cR+8qlwl8xq0mSia/NzQOGqJ6m/zs0o2w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726223916; c=relaxed/simple; bh=tRJ2UTlAGm5BrqdzK7SMKu7N9PGcYcsgemuhPIj9PFc=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=awJa9J8E9ucsmuCREDYDUjlWFtBZq5Koos7ls3st+ANM/NjmDpAkWLdIF67v17C5Q6iyl5534Qxmz+/ZxZqzvEBH6WhmohL7AqRWWjMg6r5QcMwGPORJlU81OnjbOysR5RLSgr7cIzcDxpjr5TdplhRKtmk5l/QbzPjGLkQ/KS4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nokia.com; spf=fail smtp.mailfrom=nokia.com; dkim=pass (2048-bit key) header.d=nokia.com header.i=@nokia.com header.b=DBGFgInS; arc=fail smtp.client-ip=40.107.241.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nokia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nokia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nokia.com header.i=@nokia.com header.b="DBGFgInS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tKGgi/IdiDk+bWObrG7H9KUU6d5vHCRhYzzEn6HS8ISmVh5iH7m0NuqM19ro7bVmme5P9y6SINP+ZYwez+JqUE0fuWQUGe8nmsgcs9lQoTUEFN9RDipEnJZCIgVQIdMNhkKhHzUUnUZ5tvn3xkM3/RKpYLxe72uLxhTmX3NY6PDAE1kDsQ98olr2bexOaaLs14Vqxfv281Vhq+edjpaJ9bGMFaY4ebBC0TN0MLR6aD6tkth9Nx8A8oHutGiq90JoBGqN9/6rMU2Q/dNJnPdZ7pH8tKBW0R1jtcvObHF4j+5g+Ic3EHIkz3Fm+Qu0dZZSJy7JQb0H37UMw701cLBpfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wzT9tw9W5dxzE7PdMajy/+vF/6QCaliNKemlLeDwevc=; b=JeAPrxxU1o69sSWxDi7XVV12xrrFxd4S7uythfLOvBwaBo7yh9xfAsWWGbrC3agOxW5iN6ACM522CJ/6cwxAoBiyMh0Me5CM+3c5vo6ppGPwjy6x1jCScMISjkH0obBHmufCHBLJVw4QQFbw1VVu11SY0uh088xm4MPgLlB4jKr24yfXdwoEJzXX9mKeWw7WALyX9/pVSk0PXyiy4O4reGGgWrpAZxUTYWqbGDHWTIz6QPOxR/Nsi+Mb/LB10i/8iMFoK1euKO/Z86qHg58ApWc+ahnx3NWJ4fFliCcg5rkiWtKsBWiiVCowVc8ItyZ079/XNPPl+0/JW2OZJ3qCsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wzT9tw9W5dxzE7PdMajy/+vF/6QCaliNKemlLeDwevc=; b=DBGFgInSXTdsHslt+pAnj3s3orSSA/7fq+9o1OUEpEJc/8gzxHPnaNtr5IQe9ao8j9iT9zvJXFxXd0MPpiagI1piE/O23WINBzHbuVrAWNZYwTpF21kS80c5zsaOugZllugCD1UuHDX23QTVEZxig5y2raObUGsZydMU1uo/PHwLGc/yoRYzoRnjNvZAZIuSWWsChtPUWz6zeutMG4fxjr4Gy0GCvukO+tHP6OGFMKYWDOK5Lsv7jlv6aenafFyt5zhZYDfpEF+eSYW71/UHFJDVsQHeU9G1rhBy3kbiXiGAPKt68GssCuRWNvoT8JBKmBEJqAko4LQVds1fK9VN3g== Received: from DB6PR07MB3509.eurprd07.prod.outlook.com (2603:10a6:6:21::16) by VI1PR07MB9923.eurprd07.prod.outlook.com (2603:10a6:800:1d6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.18; Fri, 13 Sep 2024 10:38:30 +0000 Received: from DB6PR07MB3509.eurprd07.prod.outlook.com ([fe80::5484:a966:1322:f78b]) by DB6PR07MB3509.eurprd07.prod.outlook.com ([fe80::5484:a966:1322:f78b%6]) with mapi id 15.20.7962.017; Fri, 13 Sep 2024 10:38:30 +0000 From: "Wojciech Siudy (Nokia)" To: "linux-i2c@vger.kernel.org" , "devicetree@vger.kernel.org" CC: Peter Rosin , Andi Shyti , "laurent.pinchart@ideasonboard.com" Subject: [PATCH v4 2/2] pca954x: Reset if channel select fails Thread-Topic: [PATCH v4 2/2] pca954x: Reset if channel select fails Thread-Index: AQHbBcjsUOspQbnJY0u72i1KC5m03Q== Date: Fri, 13 Sep 2024 10:38:30 +0000 Message-ID: Accept-Language: pl-PL, en-US Content-Language: pl-PL X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DB6PR07MB3509:EE_|VI1PR07MB9923:EE_ x-ms-office365-filtering-correlation-id: 2bc3298b-68f0-4aef-77a9-08dcd3e03587 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-2?q?dZd6q71qy7Ce459qnafObR/yUU?= =?iso-8859-2?q?qRKFGNplOUKeMZ9WEDOTZ8C8VzvzKq8e3szSfsU1sNqc0TSqg3wa+fIzA1u/?= =?iso-8859-2?q?w1rKHEUWpWrOqVDoy/BNKLjDrfYTgvk1Zu5NVjO/+UoBb7+6EMOnRiQgSeWb?= =?iso-8859-2?q?zHnem6vQvo/WRSHJEQa0TWnlejU/X29wsvHh9zeNMFDqHvZB+CrwXy7etZSA?= =?iso-8859-2?q?raTDOipaHdhVodrb1qnAxkCCjsgyhrzRT/t6A3amaxjdPeo9QlaPOm3ZpTkF?= =?iso-8859-2?q?O5rBm5+SPi2PaRCVg7uZudYmIGi05hUxqeF8mzOmmiAPK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GxEFRACQERh3sln0gRnE2mfH+hw5LxwD6UEecJDpu6oG+rxpUy0q/QvHaZPU?= =?iso-8859-2?q?t2m2XfWyNrn70NJDoamOeQpkuj5k6fGw08h/7M+h/+BXb810igcDl2RA5RnJ?= =?iso-8859-2?q?fw3HuT506GLRwkiroBpQFdm7obEzIZ6x4ukToOyzyaUO8UxQN9eGc56gmAYn?= =?iso-8859-2?q?/hvYjpwG3GnilmX1FtGD6nXDrUywniP4tXuYrL0UM5CdXMlr0ewPm6tTzyPj?= =?iso-8859-2?q?R12ujzSgKNOo8XHNoeiMnLeA=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR07MB3509.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-2?q?1ErMnH7RbUwuZtiPthftN9k?= =?iso-8859-2?q?h7Rrd3WtGjjSPvsZPecL2PHVkrf/5WcUa4AjhiqQfwZQTR9bKxU1jHL++zFU?= =?iso-8859-2?q?yWbTzQB/JL01fRp/xqHPhzmbO5mW/tBOS9nZce57kkkQFdy62pGe/5mGiDqZ?= =?iso-8859-2?q?t7CyWS/YNloKSlVIPaU1YbyeWfeQOp4+ufaIgQlDXVzBvvksyfqCIb6Vl6FE?= =?iso-8859-2?q?Ad7SuqtDi6YE/Rcfv5OlMTgQ2SQ7uPXTyHh9i9m/rY4ack+g/jEYcVOUiCQz?= =?iso-8859-2?q?2qMDAVw7gPSdc4oE1SOVvJe2QnYACOMJQYqM4GsPASdVLv3Hi/PJBoFs8aO+?= =?iso-8859-2?q?5rwUZdYTz2Kwa4mI4nY+0u1QUM/5GW0Ss+4F6ywJXXjI7vgPKR7R8b7pO5HT?= =?iso-8859-2?q?bsI8h81IDl5CJBb8q3OTVQvySy37zujT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5q?= =?iso-8859-2?q?0SXWPqIrYMi9rv9IhOTYlV3y1KhV9CIRMb3Y369YjABxD3cx9UZfdBUiAGVu?= =?iso-8859-2?q?2IB3NZBy9oMBOp7U3Hmodc1qagnVG55turVD8pe50ioYJ0z7rvlE71SvEO8q?= =?iso-8859-2?q?XZ1AmO23HEekmgJweuedRkJAgQDRwPbtZHXewNTKJLxb4myDfs0dEVdnRxkj?= =?iso-8859-2?q?Zlx8+2PS1B+YVwpSZkz4BAwHIQkdvHa+CrAAt2mVR8B9iEdenXjqJR3T+qP4?= =?iso-8859-2?q?YIK1VfLbOQlhNjzeKQuHi5/DngX5fQkkw6aubpEzshbDZO0YXumwqiV3N9ix?= =?iso-8859-2?q?iNjgHVk2NVGX3Mau4?= Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB6PR07MB3509.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2bc3298b-68f0-4aef-77a9-08dcd3e03587 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2024 10:38:30.3405 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eFeh+qDZvc0gKKO4pDOnhzH+iwqwL92zt3opl4DhT1XZlr3oQS6+NWy1NsRuCdgkPT1kewMRdNCOLKcTQDY8vhVti6dE8Se1WtFOMYqTBF4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB9923 From: Wojciech Siudy If the channel selection or deselection times out, it indicates a failure in the mux's I2C subsystem. Without sending a reset pulse, a power-on-reset of the entire device would be required to restore communication. The datasheet specifies a minimum hold time of 4 ns for the reset pulse, but due to the path's capacitance and themux having its own clock, it is recommended to extend this to approximately 1 us. This option can be enabled using the i2c-mux-timeout-reset property in the device tree and should only be used if the reset line is not shared with other devices. Signed-off-by: Wojciech Siudy --- Changelog: v2: * Removed mail header from the commit log * Decreased reset pulse hold time from 10 to 1 ms v3: * Make this functionality enabled by appropriate property in devicetree v4: * Fix missing condition check from devicetree --- drivers/i2c/muxes/i2c-mux-pca954x.c | 51 ++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index 6f84018258c4..316048b0011d 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -110,6 +110,7 @@ struct pca954x { u8 last_chan; /* last register value */ /* MUX_IDLE_AS_IS, MUX_IDLE_DISCONNECT or >= 0 for channel */ s32 idle_state; + u8 timeout_reset; struct i2c_client *client; @@ -316,6 +317,30 @@ static u8 pca954x_regval(struct pca954x *data, u8 chan) return 1 << chan; } +static void pca954x_reset_deassert(struct pca954x *data) +{ + if (data->reset_cont) + reset_control_deassert(data->reset_cont); + else + gpiod_set_value_cansleep(data->reset_gpio, 0); +} + +static void pca954x_reset_assert(struct pca954x *data) +{ + if (data->reset_cont) + reset_control_assert(data->reset_cont); + else + gpiod_set_value_cansleep(data->reset_gpio, 1); +} + +static void pca954x_reset_mux(struct pca954x *data) +{ + dev_warn(&data->client->dev, "resetting the device\n"); + pca954x_reset_assert(data); + udelay(1); + pca954x_reset_deassert(data); +} + static int pca954x_select_chan(struct i2c_mux_core *muxc, u32 chan) { struct pca954x *data = i2c_mux_priv(muxc); @@ -329,6 +354,9 @@ static int pca954x_select_chan(struct i2c_mux_core *muxc, u32 chan) ret = pca954x_reg_write(muxc->parent, client, regval); data->last_chan = ret < 0 ? 0 : regval; } + if (ret == -ETIMEDOUT && (data->reset_cont || data->reset_gpio) && + data->timeout_reset) + pca954x_reset_mux(data); return ret; } @@ -338,6 +366,7 @@ static int pca954x_deselect_mux(struct i2c_mux_core *muxc, u32 chan) struct pca954x *data = i2c_mux_priv(muxc); struct i2c_client *client = data->client; s32 idle_state; + int ret = 0; idle_state = READ_ONCE(data->idle_state); if (idle_state >= 0) @@ -347,13 +376,16 @@ static int pca954x_deselect_mux(struct i2c_mux_core *muxc, u32 chan) if (idle_state == MUX_IDLE_DISCONNECT) { /* Deselect active channel */ data->last_chan = 0; - return pca954x_reg_write(muxc->parent, client, - data->last_chan); + ret = pca954x_reg_write(muxc->parent, client, data->last_chan); + if (ret == -ETIMEDOUT && + (data->reset_cont || data->reset_gpio) && + data->timeout_reset) + pca954x_reset_mux(data); } /* otherwise leave as-is */ - return 0; + return ret; } static ssize_t idle_state_show(struct device *dev, @@ -543,14 +575,6 @@ static int pca954x_get_reset(struct device *dev, struct pca954x *data) return 0; } -static void pca954x_reset_deassert(struct pca954x *data) -{ - if (data->reset_cont) - reset_control_deassert(data->reset_cont); - else - gpiod_set_value_cansleep(data->reset_gpio, 0); -} - /* * I2C init/probing/exit functions */ @@ -625,6 +649,11 @@ static int pca954x_probe(struct i2c_client *client) data->idle_state = MUX_IDLE_DISCONNECT; } + if (device_property_read_bool(dev, "i2c-mux-timeout-reset")) + data->timeout_reset = 1; + else + data->timeout_reset = 0; + /* * Write the mux register at addr to verify * that the mux is in fact present. This also