From patchwork Sun Mar 12 13:19:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 68327 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp717340wrd; Sun, 12 Mar 2023 06:30:44 -0700 (PDT) X-Google-Smtp-Source: AK7set86aKl+A+v4OTbqsxomSPwhWWmXS4E8/aBUofRm+GoC6xTS3fFKRIKtiPcLAJqIih8w2TmW X-Received: by 2002:a17:902:ee46:b0:19e:3725:8fc6 with SMTP id 6-20020a170902ee4600b0019e37258fc6mr28006071plo.20.1678627844435; Sun, 12 Mar 2023 06:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678627844; cv=none; d=google.com; s=arc-20160816; b=S5+c1ZsifPWYQ13V2d9NBa8R3OxBi9FQ81r0/raUY6ihu/HIa20m5S9JKT873VKjth cdE7GXStIsyX3p75MuH4MsknvKFQ7LKZgrYnOgKXfO4kCLV2UYJ2dP7TdRQ/dNFKX6Xu KabgeMV0WdtyMS1rW5w/xLEmrDWrZzuYwSnw4Q3LpBvjzNkEQztOEGAD1sVnsWLJJp+S zRhJTwNG95CIjrhWzH3p4/UsbdkEuek7ZZBbO/+6jlWBB/p1LgG4xV16uAqwK9jHNe3+ AfJIpx3egu0tNh072rfUkYF/UZmkcC+uN4h/C96wEXTd2T8ItAAQYCTVayOHb1IP13gs 6eOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W1QL8yxfrOIpsRQ9E83wBn7w/lbFzZM+ok8A5JN6MzE=; b=ZJcalRQ0pXohxUCgexS5ACvBPoNTxaHOtzYqvYzShnXttn4i9I8CVbHL4Fi1c22mO3 gpez7XDxPQBwUy4sSQes/rJSPxEDY1yaLEVAWmsRqx626MgSRyFmcMVcwP1Ymqog8Aqr ApNzZ4YulDjhiEd0rnBKVnsDOOYwQdjciHgC/Aw2Ru+33SmaEZpoM4rZXg2yoM4qvXhC AM4jJxDVicAg/auCcMNSktMBC9SG2++uG/SuO1vvAhDumVKn0WtguPIuHo6OuzX8dDRI X7yXw5gGvF1DBUvH4ZI47T28hISmq35JFFsNo0+H+EELj3SrWel3Sm9sGL3lchrSlz7o pu4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ImlVBCqA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lh15-20020a170903290f00b0019aba9c49a5si4260815plb.588.2023.03.12.06.30.29; Sun, 12 Mar 2023 06:30:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ImlVBCqA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230135AbjCLNWP (ORCPT + 99 others); Sun, 12 Mar 2023 09:22:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbjCLNWO (ORCPT ); Sun, 12 Mar 2023 09:22:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1B50974A; Sun, 12 Mar 2023 06:21:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C7DC360EBA; Sun, 12 Mar 2023 13:19:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9070C433EF; Sun, 12 Mar 2023 13:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678627191; bh=FqCJ2YcWNJ19nY3MTswZdQnYgovepeDjwKAJl8ifYG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ImlVBCqAA3koQAyaeTLiD70vTyDpyN2uEKpbLRl44nvbK43xDNAKd0gj+HWAew0yd 9dOXwsPcgP4gaoXTnPFDN0pfdp4NljKTDZ08AQl9UdyE845IEeQswEuRlN4uj8RneG CgCh1/FFJQWMOMWtp2yBvosv9xLgrrPhk1Xw4cOiQ83H39nLCZ7yKghxjPavzJSJU5 RamnaPfujM6I0lVQRCrSSgSZR0Isx5c1yoQbW8jDWohLhSIAsOfim/JXNspDtGyb2q RWpOehA7fiX8Sle5tak5RDzliCH8UmMyu1xW0qq/c5iZ4ZDACF+StNmomEcmDyFgoG 3C/uGaXPZr/ew== From: Andi Shyti To: linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wolfram Sang , Rob Herring , Krzysztof Kozlowski , Chris Packham , Ryan Chen , Andi Shyti Subject: [PATCH 1/2] dt-bindings: i2c: Add the clock stretching property Date: Sun, 12 Mar 2023 14:19:32 +0100 Message-Id: <20230312131933.248715-2-andi.shyti@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312131933.248715-1-andi.shyti@kernel.org> References: <20230312131933.248715-1-andi.shyti@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760168870265846164?= X-GMAIL-MSGID: =?utf-8?q?1760168870265846164?= The I2C specification allows for the clock line to be held low for a specified timeout to force the slave device into a 'wait' mode. This feature is known as 'Clock stretching' and is optional. In the NXP I2C specification, clock stretching is described as the process of pausing a transaction by holding the SCL line LOW. The transaction can only continue when the line is released HIGH again.[*] However, most target devices do not include an SCL driver and are therefore unable to stretch the clock. Add the following properties: - i2c-scl-clk-low-timeout-ms: This property specifies the duration, in milliseconds, for which the clock is kept low and a client needs to detect a forced waiting state. - i2c-scl-has-clk-low-timeout: This property specifies whether the I2C controller implements the clock stretching property. It's important to note that this feature should not be confused with the SMBUS clock timeout, which serves a similar function but specifies a timeout of 25-35ms. The I2C specification does not recommend any specific timeout. [*] NXP, UM10204 - I2C-bus specification and user manual Rev. 7.0, 1 October 2021, chapter 3.1.9. Signed-off-by: Andi Shyti --- Documentation/devicetree/bindings/i2c/i2c.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c.txt b/Documentation/devicetree/bindings/i2c/i2c.txt index fc3dd7ec0445..12c311f0e831 100644 --- a/Documentation/devicetree/bindings/i2c/i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c.txt @@ -45,6 +45,15 @@ wants to support one of the below features, it should adapt these bindings. Number of nanoseconds the SCL signal takes to rise; t(r) in the I2C specification. +- i2c-scl-clk-low-timeout-ms + Number of miliseconds the clock line needs to be pulled down in order + to force a waiting state. + +- i2c-scl-has-clk-low-timeout + Boolean value that indicates whether the controller implements the + feature of wait induction through SCL low, with the timeout being + implemented internally by the controller. + - i2c-sda-falling-time-ns Number of nanoseconds the SDA signal takes to fall; t(f) in the I2C specification.