From patchwork Mon Feb 13 19:16:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alain Volmat X-Patchwork-Id: 56497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2536106wrn; Mon, 13 Feb 2023 11:39:50 -0800 (PST) X-Google-Smtp-Source: AK7set/KBECu+v5ARC8bigbT9lQrBsyd0dBwoN6yqoZ7tK3mVz0wBk4PhR0f2PbvtUNNWJYrHsme X-Received: by 2002:a17:906:6450:b0:8af:514f:1078 with SMTP id l16-20020a170906645000b008af514f1078mr89012ejn.31.1676317190328; Mon, 13 Feb 2023 11:39:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676317190; cv=none; d=google.com; s=arc-20160816; b=p1uzlplrNuUKKteSIWvHNaVGr+M8RmSKMcEKOjsfRmNOb5cd1i3HCVzhyQCLcnQ8xb PTcvtHXyaEUjKNJqclQGtBxjgDyS1Iu/dnQVJEHgB2EaYu0kBBXmDGCv49qsjPJ7hnpR mMfY8SG7KISIrdPr1q9/6LN4qznpj/c2TBfemVj8RVyMogNFdOxZYOQSAZv94ciD0Gyu HzM7RxmCW853+XNQdL7CY4OpLKxeteS63N2m5MCpu6DxWQI7YhbRlDxlXcMGLfnf8YhQ trcvM6SZaDURPfmKGHsC3sePPr6TsNAe+7g1xCXBjIeMgsR6caDLfeansc3doYNKdm4X Mx9w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=94QVu5Tfy3DmqCZaQaWg7r71d7hRwU3vPlEYm2d3Mnc=; b=kb8Ebtme+RcHCZ76I1BsXOjDVuyh/Mvs6PSNp7IDCq2BeTFwyKm6SSKR33A5tgI/IZ Ru9oiQjn9sg7tMbxnFgphf/tvtZV0CTVBwFA1I9UD/AL6MO74I/umuGRi797v9wBI5dc pfnPEIhfS+yVo2tMsqTvTP6p5qmi4Rd3j/bpjnZRx0SaM3AjYbBMqB5+OGWD0OOQe4lp uBjKjqtlAcs0kenTN0/570RoJgEpXHD5WV28YdMlSC3eO0OZh1eg9M2NQ0mzEHbLlDOk l0PiUzxSxNWDmrTYhJvUXYCk1KPRooxSRSlF0+dAmRFacCKRX9Cke7+BFP1SV75ZYX3O LjLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@me.com header.s=1a1hai header.b=LgZk1QNJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=me.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id we12-20020a170907234c00b00880823a20a3si13967620ejb.120.2023.02.13.11.39.27; Mon, 13 Feb 2023 11:39:50 -0800 (PST) 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=@me.com header.s=1a1hai header.b=LgZk1QNJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=me.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbjBMTQm (ORCPT + 99 others); Mon, 13 Feb 2023 14:16:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230271AbjBMTQl (ORCPT ); Mon, 13 Feb 2023 14:16:41 -0500 Received: from pv50p00im-hyfv10021501.me.com (pv50p00im-hyfv10021501.me.com [17.58.6.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF59320065 for ; Mon, 13 Feb 2023 11:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1676315799; bh=94QVu5Tfy3DmqCZaQaWg7r71d7hRwU3vPlEYm2d3Mnc=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=LgZk1QNJ/UiWOgnqruOGOH0kv2kAtdELG07iE44qxruUk4sgNq2i0Nmockdags1Gi +Zf+fQuwrdXNIeU3TJKUnTBx6c/Tm6TsWiuKCdULS+vY7XQI6iRX2GWvjoHpKx35/F XSJXdgLAA0sFIYkvgHvoLNcf6sEeRiPB3SnGI3T9/Wi5NHpqJ095ifnmvo3J8OsZVq +t159LURESMXFrFK9jOuvIk/JKp5q6Bt3vAycN1NBxySIQWBeyWU1V5Z2ddtSNMxHj ++nfniLsXFlcGnW86t1nY0oK4OfjIcXQDTbut9UC22HLLjkF4VvXtGKio6BbJYbcC8 6YYGmVMFZ73hQ== Received: from localhost (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-hyfv10021501.me.com (Postfix) with ESMTPSA id CA5B32C06D8; Mon, 13 Feb 2023 19:16:37 +0000 (UTC) From: Alain Volmat To: Rob Herring , Krzysztof Kozlowski , Patrice Chotard Cc: Alain Volmat , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2] dt-bindings: i2c: i2c-st: convert to DT schema Date: Mon, 13 Feb 2023 20:16:06 +0100 Message-Id: <20230213191608.16503-1-avolmat@me.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Proofpoint-GUID: nyxaLUKxyx6gp-HUlanc6pvKg0T8pPsL X-Proofpoint-ORIG-GUID: nyxaLUKxyx6gp-HUlanc6pvKg0T8pPsL X-Proofpoint-Virus-Version: =?utf-8?q?vendor=3Dfsecure_engine=3D1=2E1=2E170-?= =?utf-8?q?22c6f66c430a71ce266a39bfe25bc2903e8d5c8f=3A6=2E0=2E138=2C18=2E0?= =?utf-8?q?=2E572=2C17=2E11=2E64=2E514=2E0000000_definitions=3D2020-02-14=5F?= =?utf-8?q?11=3A2020-02-14=5F02=2C2020-02-14=5F11=2C2022-02-23=5F01_signatur?= =?utf-8?q?es=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxscore=0 clxscore=1015 mlxlogscore=999 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2302130168 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1757745974075315544?= X-GMAIL-MSGID: =?utf-8?q?1757745974075315544?= Convert i2c-st.txt into st,sti-i2c.yaml for the i2c-st driver. Signed-off-by: Alain Volmat Reviewed-by: Krzysztof Kozlowski --- v2: correct subject / commit log add default clock-frequency remove maxItems for st,i2c-min-scl-pulse-width-us & st,i2c-min-sda-pulse-width-us remove extra spaces within example .../devicetree/bindings/i2c/i2c-st.txt | 41 ----------- .../devicetree/bindings/i2c/st,sti-i2c.yaml | 71 +++++++++++++++++++ MAINTAINERS | 2 +- 3 files changed, 72 insertions(+), 42 deletions(-) delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-st.txt create mode 100644 Documentation/devicetree/bindings/i2c/st,sti-i2c.yaml diff --git a/Documentation/devicetree/bindings/i2c/i2c-st.txt b/Documentation/devicetree/bindings/i2c/i2c-st.txt deleted file mode 100644 index 4c26fda3844a..000000000000 --- a/Documentation/devicetree/bindings/i2c/i2c-st.txt +++ /dev/null @@ -1,41 +0,0 @@ -ST SSC binding, for I2C mode operation - -Required properties : -- compatible : Must be "st,comms-ssc-i2c" or "st,comms-ssc4-i2c" -- reg : Offset and length of the register set for the device -- interrupts : the interrupt specifier -- clock-names: Must contain "ssc". -- clocks: Must contain an entry for each name in clock-names. See the common - clock bindings. -- A pinctrl state named "default" must be defined to set pins in mode of - operation for I2C transfer. - -Optional properties : -- clock-frequency : Desired I2C bus clock frequency in Hz. If not specified, - the default 100 kHz frequency will be used. As only Normal and Fast modes - are supported, possible values are 100000 and 400000. -- st,i2c-min-scl-pulse-width-us : The minimum valid SCL pulse width that is - allowed through the deglitch circuit. In units of us. -- st,i2c-min-sda-pulse-width-us : The minimum valid SDA pulse width that is - allowed through the deglitch circuit. In units of us. -- A pinctrl state named "idle" could be defined to set pins in idle state - when I2C instance is not performing a transfer. -- A pinctrl state named "sleep" could be defined to set pins in sleep state - when driver enters in suspend. - - - -Example : - -i2c0: i2c@fed40000 { - compatible = "st,comms-ssc4-i2c"; - reg = <0xfed40000 0x110>; - interrupts = ; - clocks = <&clk_s_a0_ls CLK_ICN_REG>; - clock-names = "ssc"; - clock-frequency = <400000>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_i2c0_default>; - st,i2c-min-scl-pulse-width-us = <0>; - st,i2c-min-sda-pulse-width-us = <5>; -}; diff --git a/Documentation/devicetree/bindings/i2c/st,sti-i2c.yaml b/Documentation/devicetree/bindings/i2c/st,sti-i2c.yaml new file mode 100644 index 000000000000..08f9c1e446fd --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/st,sti-i2c.yaml @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/st,sti-i2c.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: I2C controller embedded in STMicroelectronics STi platform + +maintainers: + - Patrice Chotard + +allOf: + - $ref: /schemas/i2c/i2c-controller.yaml# + +properties: + compatible: + enum: + - st,comms-ssc-i2c + - st,comms-ssc4-i2c + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + maxItems: 1 + + clock-frequency: + enum: [ 100000, 400000 ] + default: 100000 + + st,i2c-min-scl-pulse-width-us: + description: + The minimum valid SCL pulse width that is allowed through the + deglitch circuit. In units of us. + + st,i2c-min-sda-pulse-width-us: + description: + The minimum valid SDA pulse width that is allowed through the + deglitch circuit. In units of us. + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + +unevaluatedProperties: false + +examples: + - | + #include + #include + i2c@fed40000 { + compatible = "st,comms-ssc4-i2c"; + reg = <0xfed40000 0x110>; + interrupts = ; + clocks = <&clk_s_a0_ls CLK_ICN_REG>; + clock-names = "ssc"; + clock-frequency = <400000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c0_default>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 06d5be2c713c..2e32eb8d44f5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2925,7 +2925,7 @@ M: Patrice Chotard L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Maintained W: http://www.stlinux.com -F: Documentation/devicetree/bindings/i2c/i2c-st.txt +F: Documentation/devicetree/bindings/i2c/st,sti-i2c.yaml F: arch/arm/boot/dts/sti* F: arch/arm/mach-sti/ F: drivers/ata/ahci_st.c