From patchwork Fri Sep 13 06:50:08 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: 1985007 X-Patchwork-Delegate: andi.shyti@kernel.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nokia.com header.i=@nokia.com header.a=rsa-sha256 header.s=selector2 header.b=G8egewWL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=139.178.88.99; helo=sv.mirrors.kernel.org; envelope-from=linux-i2c+bounces-6665-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X4lLP0c93z1y2H for ; Fri, 13 Sep 2024 16:50:21 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BCB59287A4E for ; Fri, 13 Sep 2024 06:50:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32B051AD9FD; Fri, 13 Sep 2024 06:50:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nokia.com header.i=@nokia.com header.b="G8egewWL" X-Original-To: linux-i2c@vger.kernel.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2055.outbound.protection.outlook.com [40.107.20.55]) (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 AB7F9143C40; Fri, 13 Sep 2024 06:50:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726210213; cv=fail; b=ZI/sAYQssvyzDDmmWHTAuAJaT8w5CClkf6D2ruRFTDWptxIlzFy2IALK/wIyIwpquTAejZGlrE5/SjW1k1HKHHXpLFE/QmQc84sBt872kkjKPW1Lye0IlR3ik9Gpo9pywsvCncRMprIl69HNzYls4bf1tZY2qc5EwAEbTYHoEsk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726210213; c=relaxed/simple; bh=ERBr0vLc1hK/tbiacYuQzwV1sOtdrDN+rSQ3A0oMbDg=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=d9BBkQ81Co5SknePd8XZpqp751y9OOGdn1ExH2tJnYzbB6+eT5mJCVg8w535lghn30CqTD7b7m9IhFDBt0iC9isQ2NRuSFg77DZVH4OUBiT3NW7J99PCnbv1Kx1YLoCvn/UCvaiHL2k1wfLbXbyw6PNxy/rqGUG7Wg6CNqz/TzY= 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=G8egewWL; arc=fail smtp.client-ip=40.107.20.55 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uLSZP9zV7QOAtEa/o+/a0ilDvDjNxU23yK8Zg3PXZhb9zMDKcWqfpoG6PMJpguCrHLp99r5RoEq1laGAgKR/XO2SypkQZMpQvMm1c6Ci2892tet1usVoCron08F2NdObkSlm+M84JB+88GyHwfItnhB1O7E57HRM+Lkn/6zBGItYCFDhp9aZCKo925QDLqBo93cD83kugHQzZMvVLO88L3zVg8Ot/sDtbO6i3AknWLm4Zdwor2xeoNOdoSrybcOsrMCHs0Z+CSDCd2HRgXZYJq1vlR1Ryb87EvWEVlRTr0a2jlJg3hbI/mxHywWSQJGsOYGSUaCriZOni1RJ+yAwCw== 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=js5aXiJxNBYAn7z9NDXDWNmK5mP5evUn/qxY4Fvegaw=; b=cbyy/uJ0IflJ1UPd3f/joAGoYeb1OGtqxMyp4bIcPt+Jh6ZRaV/R2lTofFZQ3pQ/lNhvuRnwQxJqF0Rvxbzy+wsvVv7tqQagQdtQGUQXbWJV0ZhwaZlKLOTVq3KTR6OYHFxZbOU8v2BPDWg8Wkwk+bbIaq9ftvQj2ICnWJrEjrDMVaLlBH2brU64tdx2VOu0eYmGe3O52NRhQ4Lk9r3CD/Efij+J6Qb47X6XuvdEQIPK/5LNt5svviaJfUsGQcQ5yJRExIx6rC20Vek6qiFgN6f6gB5HNb/48JlXFkM3/WG3fmumE3v2DYqZ4uzIn1/SNilOsIvqAep8Q/uccGReJw== 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=js5aXiJxNBYAn7z9NDXDWNmK5mP5evUn/qxY4Fvegaw=; b=G8egewWLT3Nb0X3HdwM+0scyz9Sjo0o2xZf3+0LIvE+wdx3FZaGFxp66T1OGjP4BUi2NoFCdkdyaC/uiq+K6L3ICqJ3QI2caz3Sn0FksIf902NJ0VDh7hyfyCbgIhnk8UVLyrh2oUNEh9ZjgqB/QdjJJNVeTyEtEk9r3PuJTU2cJG3FEjOa0ZLUT/YJfj/fyS458qqI1UcJkMTaoQZGrsxjMiYAxCFysT8GlKWZVLI2CUIB/RRGOdAP9elfjAM+5Kt7iEWDMPNE+xan3PwGALqp8WxTW5M7cEu+cZ2PMqms8OyzukKvcd8OWBvzG6GToezq2k4Vpe2pnk3TmS3ak/g== Received: from DB6PR07MB3509.eurprd07.prod.outlook.com (2603:10a6:6:21::16) by PA4PR07MB8389.eurprd07.prod.outlook.com (2603:10a6:102:2a0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.19; Fri, 13 Sep 2024 06:50:08 +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 06:50:08 +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 v3 1/2] dt-bindings: i2c: pca954x: Add timeout reset property Thread-Topic: [PATCH v3 1/2] dt-bindings: i2c: pca954x: Add timeout reset property Thread-Index: AQHbBajz1wdACRqEV06/8jXM7GSbPQ== Date: Fri, 13 Sep 2024 06:50:08 +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_|PA4PR07MB8389:EE_ x-ms-office365-filtering-correlation-id: 8035b477-1242-4153-ac05-08dcd3c04ea0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-2?q?lPU9q7kkDEk6/dJbRmcwpzhZYR?= =?iso-8859-2?q?QSW7jkRf30o7NsAkCsEKYYLjyydGZemsdMPaGkhZH6zCarFpR6TGA9WFnavR?= =?iso-8859-2?q?EHxefVPGTHzi8Pn1eQ1yIJ4Sjqr2JI5CS3lyKNBHLnFUkcfJ8suEd1a68/Na?= =?iso-8859-2?q?nYjnZAfzD4k/10hx0mz14kXHJFCtfCq91IMtBf20ZrTnTuz6mml7NW6YETBd?= =?iso-8859-2?q?f9YaD8u4+JhRB/TRNWF1/iDiftPZZIeObz96fw/SsorRWaGuwCwPyfkN6swD?= =?iso-8859-2?q?0riYi5msmsUXdvNcZVnA8dErbbJ6TpfO3qvoN4hj2zOcI5gU0D7QXUEYNHRY?= =?iso-8859-2?q?mP6WnY8JtmsgHQkUkg6P83NLJqdVWiTw/X7GZ301bR4QqtQ2VRItOW/q3dLl?= =?iso-8859-2?q?s8/KJulnXdKXDOQKIIkaZ93qy2FSwCdsnvsixrMRZQKHtIkBscyi/vIDGPFJ?= =?iso-8859-2?q?6Mwo6pQP1O0KcSeUsFa73nSSmYIQosQmByKXFoEh1qwX5ObKlnQskyeoKi4Y?= =?iso-8859-2?q?zMbRKrgpGrzZ35D/w/itDHy0XpGaQpFPkREnq928Daft2D0VOegkrEjFNm9l?= =?iso-8859-2?q?z00XYkBHvO3Olt2U6TPN1D/UrVZBe3qbiQ+SoVh6Jz3jFTzfbPlVxU9fezJm?= =?iso-8859-2?q?euh1w/M6ueJk4g3QKIgzIKKNJ79xV0yOG6uUmDa/cfWOUw5WUnv2kpgSMDQq?= =?iso-8859-2?q?9R/SXzuRpxMmAffEfCPAdwyG51nwOHa5SvG30sU8vFF40K5bqYJRv53OKYsI?= =?iso-8859-2?q?SfGrrg210iWgKC4JjPgELmzjNTEXQqg2V5g2vZVlKuaZj54EoarjYh3XxMIv?= =?iso-8859-2?q?2ObUXy+R52LLUgK0mMhqN948QLyQ+xAPlccZhRbDc6dNto8Tm6rxSAC1eLFs?= =?iso-8859-2?q?yFnzNH2J5vAOrPXwEQWvS3p4W2Mcr7KPEVcz48btav1EEdfVFiBMIgS/fpNo?= =?iso-8859-2?q?ywOQ9xHtS3HprY0TPwtPj7eVyUEKjGNX38oE4jQ9cS4m1rr5cIBIxMsvjz8x?= =?iso-8859-2?q?bHTzuTBkk/BSt6fzT3bcrCqUnVl8ji/NHA0wR45/8CAtpWMBuWXFz/Gu6UQP?= =?iso-8859-2?q?ZxN2rbK9D3s9Xk7bpBR32Jx8K4Y3apE8sF/yzbg/Fvc2sqCMgak5q7chTVj/?= =?iso-8859-2?q?BQ7M6PXEWD+n+JqWt9I3mks2knxquBWeGEbzT1nW2M0BDyvfaX4rdUtLuQg+?= =?iso-8859-2?q?Gmf4b9+NFDN3m/J3HnfxZWTZPfQevctkHeYEsuFaTZn73iq22GR1MfnKJ2vV?= =?iso-8859-2?q?MFmWZHmb9RazWHk9uQZcbkADQZY0gMVfCqoeIfYMrq6EPVZTEUCC1gV/o2iY?= =?iso-8859-2?q?r1+H0cGecN6axYRzL5l33AC/5hG5Kv4CAn//PaKyJKsjX0hnIdDPiXXv7GE8?= =?iso-8859-2?q?yioZuIU9phmaFpfGOLew=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)(366016)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-2?q?PBY9n0lE1UksRFEosmg+lHm?= =?iso-8859-2?q?MxSct+Ekb3w4m4yO4dRct3rQPJ+0A2AJE0P+f0uMofDachi//2uJkoyysQrY?= =?iso-8859-2?q?VyQzJ8FFYkqJyoMnakn1AfR8xTrKs0kh8exrw3PA+9F16w4n5APbJ6KBNnK8?= =?iso-8859-2?q?/Oe86JKGb2sjlJ7ns1HktjTHwOryHWp5fFMaQhUek8gRIsXszcqizg6QOd4x?= =?iso-8859-2?q?76rSQC+PbE8mKUitDfUol6X8LDOELOlQGGdfgQtKfJA+Z5SOWJIBkq3wWUpU?= =?iso-8859-2?q?uucJZ1SraRHfPOqRCybMshGQpv31kC1/OjUT5p8wlZULWH7oSWMXL13VGnXm?= =?iso-8859-2?q?/cWhBwrv+sMxlCZTixAW1AnitHktmFPLcdnAJPzV45zbcaaXQSWCweQuCZpo?= =?iso-8859-2?q?V5ACJUJgBWOqIdejRagNcfHlhJIv5ZFYmINFVtJkAuNJDArNs0t8epTRRgMx?= =?iso-8859-2?q?nbtWV+KInyBNXPvKn23qbagPUBuug+zn24ICdVGs5wb+z1XQGsRJfsUKCdwN?= =?iso-8859-2?q?fIRQDvZzEgHQS32y5rv8jFxSpxGHYhcwMRkIA7cItFuIit/ZeImsTKBO7coR?= =?iso-8859-2?q?W8BqLLp3q8+w5zi1g5/KD5s1HvgmqJPezi9riShYORMoeEJWZgoSGFHOc1vf?= =?iso-8859-2?q?IOE5GJBQBoPsxYH76CQh4ct3/DBkWGZQvjhl/QMCnW7bW1tlvb+0mrcx3NVZ?= =?iso-8859-2?q?5vBP3JmCdR/C3pmyCGmMWJy0fROK75mprw2NMGjTtiyNMzJ2pBi9QvIBFhKV?= =?iso-8859-2?q?y/xyHA4zGXAmqUQdn0XzHomIThBwk3I++l9XPt3C/DCGbxmQBPwykhOg7FKN?= =?iso-8859-2?q?5uNLHV/UsD2pZ2CBIaqghoJj+PoO1cR1Uh9NwKCxlP8npx1CpdVWk1cSaEn1?= =?iso-8859-2?q?cpxLcbNZQlrJBe10rMUUc80ADel54BrHBYOpfkOPqJTkKYK+2sLdmAeuU1Pt?= =?iso-8859-2?q?5MSUUEU3SDgt9Kw3oyMZosDUC+vdCu+af2/BqMk9FhaXAzrf8uZO19p2+XcQ?= =?iso-8859-2?q?H9VByBijdBYH8L6rxeS7q1gaVJ1Jw76loY+nURF6ellcRu//Tsi9tR8z30zS?= =?iso-8859-2?q?nm0xV7fg0gq4hia4VrUTQnQjTlZUhcQNc9VIVWXyMP1/rGHy79m0vACW5SEh?= =?iso-8859-2?q?5XJoB3YF7u8CZPhfClsHbw95wgqbAqNxiZQzBK22BadVb80nW3tqa3SpzpL+?= =?iso-8859-2?q?kVPyVAfPqJg1gzQeyQkspjMxME12rjSTnS1/0a+v/0y63jsppmPqKQMtZ9ih?= =?iso-8859-2?q?I3huhKOfQ0TUbG0j5QFKzhI8b+61AYTRWvpqkzRqdA3xZXmZv6kuOcG3sEdO?= =?iso-8859-2?q?z66jNLCJjQFKGrSA/IDGDqjkpnlJuVLXqm3FphSNP9LIund+lwthLSldwhhb?= =?iso-8859-2?q?j4/hXhf4Pj6lu/A6AJHaHseUWoTFUcu5lSn3kENf4+P6iYfWrj79HigmCwM6?= =?iso-8859-2?q?4viYjSE9a4PdEzwxqzTMfe8dS8nZ2Z0gJxSPkP6kCUf2K/qJKAp0xF7/RFYM?= =?iso-8859-2?q?y5LxqfZvjRpeVjXSAKY7HifhaP2tta2YeS78PxvqozQePr4VmO1m/SueCaoQ?= =?iso-8859-2?q?n0RypRrB6FDiU2p0pY+2qL2eVAvvrn1WQj4UoGZ4hYcUN7s+G4x5GuNzzEUt?= =?iso-8859-2?q?oloVIICjmxNIgvoBU?= 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: 8035b477-1242-4153-ac05-08dcd3c04ea0 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2024 06:50:08.5741 (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: qWy1Q61Sx3Le1aC0dks/s+WQ14DI0q+CNLkm1Wx0mkLsoaKcg5L0SQaskyrzB4Jd9K+gOF2mfwY9FEp770XhWlrNdg9OVOndxayAtCpJqU8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB8389 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 06:51:16 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: 1985009 X-Patchwork-Delegate: andi.shyti@kernel.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nokia.com header.i=@nokia.com header.a=rsa-sha256 header.s=selector2 header.b=Rczl38sz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:4601:e00::3; helo=am.mirrors.kernel.org; envelope-from=linux-i2c+bounces-6666-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [IPv6:2604:1380:4601:e00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X4lMg740Jz1y2H for ; Fri, 13 Sep 2024 16:51:27 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5B0B81F25A48 for ; Fri, 13 Sep 2024 06:51:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CE451B9B33; Fri, 13 Sep 2024 06:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nokia.com header.i=@nokia.com header.b="Rczl38sz" X-Original-To: linux-i2c@vger.kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2064.outbound.protection.outlook.com [40.107.22.64]) (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 EAD7D143C40; Fri, 13 Sep 2024 06:51:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726210281; cv=fail; b=q9aaQDq2aaPUB8dS/4qVbLOvbX06K8W4Zqt9mq7NPQdbPDfRoM1McIAKXCZKB7/7GAo91mfkqkTb8d0sCCmnGfxmlVImGdRW3p5krQO6yRp7GvuNWl2V6l9WckwokMonQ8HCx4McnKXCw0cxHCX9oIJa0qFiqiDQfUM5JnMk9O0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726210281; c=relaxed/simple; bh=XijObxYKpViX/FYJIkOJQgsO6XAgOLcvV6WB+2B2j7Y=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=rFo2YFptrpnmiGp+eg58jWVu7DpDjbOZUBiA3Dw+TJFGI5qisMWjcbKcn4hzRMgP5LZS5MS4XMFFfd1QqLVzqL9E0luYokSt4cyWV1CoVLGyFaN68UHrSW77bpjmsJJHa4c1GmHEdD1QddTnBHKqyrMzU+KYAEnbBdrg5dwjan8= 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=Rczl38sz; arc=fail smtp.client-ip=40.107.22.64 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IFfQmkj5KFRshuogHxwMTHnhGh/wo7Rhwd6JlgIv4COlF54LZOqo9TgAXbdxq3ovVGFv3pHsomZSYW9ZcU/7o/UsX/5KZrUKp68oFYRXZUIkXqtvIAWHN+o5BLS0xELl0OGzg//bmw7edcLo96Qz0QR42dpfSIjZVLJEmBtLCQADuuDxdhwmkOLsCGp78Dl4nfU/wwwxwHzP8dDQ9F7uBgGNQ53fjflmxhBx1R2oaxWPOyqQY6BjO+ibHfQqpBl7SkyRC+OO7VqDwTHkvvs2sgrnS7jNh047UHvOdGQlOWrAoZj10QoHKr/d3yF5+pRTbkOVwhsLHHKZokRgr93Ccg== 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=4muBqgwpc+a4z5zH5aZ38iY0RdBI2H3bvcBnTChOaIk=; b=A+U2B09Rch/LH1jbGJrSSppqOWyPsN6oQQ7SWpoR8kLwBU4NvmKNPZpTHDLO3Xqbd6bVvs8Gvj/XXJH/ty7e1Z7ccr3jm0n1/vW+LAgPIAf6sP68FlQMapd5eh/71wOecME1S332aiqZR34x5QAKFs1ykuKKiUKD7pwX6WA06iyKDSwlmrUF/3eRQf0A/DfSHWx8zXFLpWUperKpxLtUWG7iPER9L9qV++oYv9gX941VYFvq6kyFeEoowKOjBhMZlMx2R9VnX//DLyjmYZm8ZFhDZkp24zWsS8PZv2VWu/D4iPOMVaTdeszRF0xoW9g/ruYCk281NCylY4cECQscjw== 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=4muBqgwpc+a4z5zH5aZ38iY0RdBI2H3bvcBnTChOaIk=; b=Rczl38szBE4sOeEadEsxNoqsI4ppxSF8NLOG0N2jiKesqecUSE6rUfqXVfnUHsctG2UE/2PF/uTQftzzbtBfWy3Zu6cwR41deAdr7TVJ+Lg9HscoTNLw8bmDaQsSGcAX4sLerSYqz++vabJJHlu+Dbp4SYC09j5YIIfyQx0npEZ3oje4NYEwbuwF1IBzZy/dG2DlQgZw+tefsjn+MInwtiLM3K05fIp01nIwwZaICd3C+lsehk0UelkQhi10EaqeC8U4hAdB+9yMstMDva5yNcfoEybuY6ZTh8nk6+4D7pm/g9LEHr6U+Amm8vzXCYDNUFc354x9LbqnFszNDm6vVg== Received: from DB6PR07MB3509.eurprd07.prod.outlook.com (2603:10a6:6:21::16) by PA4PR07MB8389.eurprd07.prod.outlook.com (2603:10a6:102:2a0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.19; Fri, 13 Sep 2024 06:51:17 +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 06:51:16 +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 v3 2/2] pca954x: Reset if channel select fails Thread-Topic: [PATCH v3 2/2] pca954x: Reset if channel select fails Thread-Index: AQHbBakvQJCOfWHDv0+K266wlnTGWw== Date: Fri, 13 Sep 2024 06:51:16 +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_|PA4PR07MB8389:EE_ x-ms-office365-filtering-correlation-id: d906e9f5-e771-4830-a434-08dcd3c0775a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-2?q?ba8Gj28x0Xsv8f1QVV4CIYXi1x?= =?iso-8859-2?q?gz29xvUw5BE/la+6+x2aRHpTDsI6ET9CScYlSD0FyOz7jEUISB1N2CzHUp+Z?= =?iso-8859-2?q?UdnPODydGFFr1y2pxK28O3n+QaORN2aLX5I5RA0pQHWwA4wnyHztFoyC4geM?= =?iso-8859-2?q?lItlSFS86Vo7VHHtkpBpxVUqPjvOQigZmprzGqePn49UVymB7bMQwwBCABCk?= =?iso-8859-2?q?EfD9GEJoFOIN8le40M6e0ANvowy7br01HUP2GuU+RN/vzSSPnRreOE44zwVj?= =?iso-8859-2?q?HnlBwsbqOqj59NbmGRWEmah87+5lcVtrLjqxWkGvLPtaW4tC/jlh8bhLLuIk?= =?iso-8859-2?q?ruLDn0YOY6rL5QjAUroiCWpHZlH8bABppPoxKCMkqcxLuAUCOYXSDYi3gqgZ?= =?iso-8859-2?q?ap0aFgoSYtC8+Q2AbUTASEY1OQRVbOmwaIywdRYOP6S1Cpo7drcXiOm7I6vv?= =?iso-8859-2?q?pSl+1/a1xI3KnXcNo8keO+G8F+fetjA36woaFEHYlkZE8X2pdMsuFp+IeWGL?= =?iso-8859-2?q?tvn8b3LNmKFWTk4gs96iWvsJDvZqH54KIcr9tA7BAIuoqA/WsnlYHbuWHqAk?= =?iso-8859-2?q?dpYYYAkLLCsVYi9Zixoa0/ocnmqDAUChz0/0q4JzXy2XiEEM2PGTBaGTyJuN?= =?iso-8859-2?q?JSq/Cgkxxy9tojVtvE4Ebw/g/UnsgZsPx4GhqykYPkUti2/GzElKGzgChzNS?= =?iso-8859-2?q?rXc1ltPoon7qD2OJZLsm2/2DPxuN3io3+w8xEBAKq7RvTmwk4VFad+hXn/E/?= =?iso-8859-2?q?zDXh3U3eA8gcKYQDD8InJZX8BabZOVqo7KxBlmKYAxigqV+UfwLYOHwzX8Pp?= =?iso-8859-2?q?aM64qhO3B2rYVoWMclnKoUMvgHn0I1R8XeQGitwKiJFIuH/0+ImbTFA2iPOp?= =?iso-8859-2?q?+yPLR8w9bpQApJd55HnDuSoFdQYCGIZ+ePEfJZoIG7pZ7XI8A6RKqvwkrT5e?= =?iso-8859-2?q?PHkO0aaAQqtNKVSD4m19SnzEXfVX45JTG6yJwXVsZYE3Rige0EYz62Sirhdu?= =?iso-8859-2?q?vEyXZhtdctcTT78YLmWor6x5tXYFDJqQcMOJPTCt1M/68z8QCaLysS3N3Ghu?= =?iso-8859-2?q?u1CHHZXlm6/BGdBILYC+XApSq8k5Px79uuxNWC26L2OkBKVoo/MxR2QbWorv?= =?iso-8859-2?q?jDTNxbf7nM0977wMJcpBI4CKJezhs+vEK9Vpm5V3QR9C62RtrqJu487LCXPI?= =?iso-8859-2?q?0E2LfArDTBrsCs9f7jmPXLe0SaKxIOesPdznkAwaEE2rPo9XfGTsXNzfSx2h?= =?iso-8859-2?q?am9Ip0VNhKmTNG761WczPj4E6vsX/GKSIwt70/34wuq4/h15k8UHuPyjCJK2?= =?iso-8859-2?q?8wUq0KMqLd8dAl9caUj1KlC7vYRAoyS7ot+cux4raLN1q6edCmFUNLIEYZFB?= =?iso-8859-2?q?cpIbzr9qbloAUAxZN+jA=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)(366016)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-2?q?tPCv5iEqtPOGtVHIl12E1us?= =?iso-8859-2?q?ZKa4nFjX7fMxwvAFUG757k/91TLfEu/xFmzGkiitfFeRb6MMIgwqVh/V4V5+?= =?iso-8859-2?q?nt+wr1SifMGqKBfqmd4//1QZK7DrOE1aN+hpBMvISBigJQ9ir1wSl4OHvg9Y?= =?iso-8859-2?q?r8WJw+dG64zghDK/QOuE+q+xeV9WxYclDCmrwxoItoiqyoCjPSQfbM6qVMWr?= =?iso-8859-2?q?CoOg7+fj5D2vTvEbbtbviT4ijiYk5wYLRYq1Gvm7ul9bDKZx8LH5HlGFlzyK?= =?iso-8859-2?q?r1BjCXsfi4Q68BSnit/aJ/0KZX8TMCItAunzWEOovgByk2pyEahUJmPm3/ky?= =?iso-8859-2?q?KzRNsL8pfSuCraVL24mQIK40oHrFjxv53yr/SKX7RE0y0OJpV9Mhbmw5vf/H?= =?iso-8859-2?q?BJgHh//N9eHQsi96fBheQKRvujI6tMTdsDgmi5lFxBJCK+9YE4Ne4pc17evU?= =?iso-8859-2?q?w+uNjst+pqtiJNZ8/D9PfPAYzz1iAGO5vNFtQMz+Ajx6eFVNJqZLakBVB5/W?= =?iso-8859-2?q?O4xN1aqxU/7tSXem3M56hOjTBVoa2LEo9TYPXtUWy6bDLRvM+QB77BAmMddA?= =?iso-8859-2?q?mO2lVF4eSQs2sdZUUG8LWEBwNIzqeMKDahHgblqqiiBjjLtfJoSwQM8cxbg1?= =?iso-8859-2?q?v8x8XICH2i8pLQ6hQSfdIFdFL34stVnb62/du+Cg5LdN5aELVxMAYXY9stBK?= =?iso-8859-2?q?wIbxGFUwD9zviTHqh4J+41Lya16AQPeVFi9jcMVBxPm3EYxaxxBp7CY1wPGv?= =?iso-8859-2?q?0TeUdIr1v4XbBVrlH/SwY7nJXomZF+G3Lq15lHJi3wTI6XJZTgWf4hp/aQdc?= =?iso-8859-2?q?ZiLUDTTdsI8lnK1qRYKl6N6unnJSOHtCSwP1yT7ul5MNm/ZZiO75UdKtLo7K?= =?iso-8859-2?q?n+sbXCPadpuJGtsn0h6UU/uLk43yRmlOTiNZyiV2ebeGO9aP+ybkJLGXOxn5?= =?iso-8859-2?q?AQKw3UniuSNyf8TR8EKgW8dG3Pmy0VBswVsTjt2jq4iDyqdFtSIG02d08GaM?= =?iso-8859-2?q?/A9hDgokmejsrLCUWXu18lZ66YkOJ6j2FjQqbCRBp4ZTSIfa++T2evP4cmRs?= =?iso-8859-2?q?VtMjHsdhTqu3eV9Zy2eNkqkNDFsyiTVRL+QhkTk2K/qtojn8iDr6bwxyKszb?= =?iso-8859-2?q?KhR4wzSlowjzc9Im5LSZm1vAhHv4yOieIdAeFyPPsig9CnbHzyDCPi9jaF9t?= =?iso-8859-2?q?BJrBe/MALKTYtRKFUIWj9/5TUau0gn16ZEEBK0ziP7DBWJe4pIAvEgtxf5+s?= =?iso-8859-2?q?YVR8+ExLvSTHmROL1HTaXDSUpvZoA7260+2KRf67zibL2AnDDyKPzYDIjdz1?= =?iso-8859-2?q?5dh86weIrOJQ3uBo1pD2Q4ZwvNFah6vkYY1WhVOK43K6yDPH7ZRi6PZz3qrr?= =?iso-8859-2?q?43wovhF00ehd4PuQFxWaO0Yi8Oe5q7XY/teopjkD3SmylN3zgFJiS67SwQRv?= =?iso-8859-2?q?kd+MM4VejjW2KSKag4v+KkCwyltwEZSvY9DOcTGJV/ZtPA469fR8oix05r2D?= =?iso-8859-2?q?VLQrOr9iWbTb4IBDtUiQ54TcDNxSL3gQJJT1CvKBcF0kx5i7B1kW+X3kbqMJ?= =?iso-8859-2?q?1KfZdB8XZd2LAeZHWjK0dmxI8ezt14gJAffewgz9kPFsSmUx0lmdRUMT7pQs?= =?iso-8859-2?q?Q1LW0Q/aiBMbdlTAm?= 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: d906e9f5-e771-4830-a434-08dcd3c0775a X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2024 06:51:16.8831 (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: mIcARrNaB1MpFpN+9lOz0A/NGJallFc66C2EpF3MDaW3FQ/ntkD5yoN9MmTcSb3r+La41t31Xcz7Zx0YDP7uPze8G+xa8CRVNLOtnBrCLjo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB8389 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 the mux 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 --- drivers/i2c/muxes/i2c-mux-pca954x.c | 48 ++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index 6f84018258c4..c9ac0f9c9408 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,8 @@ 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)) + pca954x_reset_mux(data); return ret; } @@ -338,6 +365,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 +375,14 @@ 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)) + pca954x_reset_mux(data); } /* otherwise leave as-is */ - return 0; + return ret; } static ssize_t idle_state_show(struct device *dev, @@ -543,14 +572,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 +646,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