From patchwork Sun Mar 12 14:55:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 662856 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A002DC74A5B for ; Sun, 12 Mar 2023 14:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229822AbjCLO42 (ORCPT ); Sun, 12 Mar 2023 10:56:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbjCLO4Y (ORCPT ); Sun, 12 Mar 2023 10:56:24 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22BA94D2A0; Sun, 12 Mar 2023 07:56:23 -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 sin.source.kernel.org (Postfix) with ESMTPS id 1E3FECE0B49; Sun, 12 Mar 2023 14:56:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 397E8C433EF; Sun, 12 Mar 2023 14:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678632978; bh=Y/oVmiKiguf3cH10Ap6pc0Y9scvYwzwdpgy/O2vWpoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LnoitOiwa4CdiDJ7UKVW2iX3U2fqvvyU4cNdn0FJbUj0C0ohTu/TwxnwZbbiv3bTZ cLE5gziNTQUGFYeaiem7sqkbCN7WfxKvjGZSzr/JFwhONSEMdrqQFnzVk3myB9CDMZ n6KhBS7mGzxBEbpchwlZIJ/tYGhnK89dpqjGN7a2wZqf2S1ATitPgHdFgqcecqz8XB DSXMgDrCIqjLNKiiolTNueynODoqYEyXlSsuwRYpcaZMeGZ1wLlIaxq7yz0r5lm6fb 0ohexcmnsHEACH/4b6UCN5OmAV2M6kEo0RPijzHtVHObPHFLLPtNY4s0gqRWlFRXfN oOZ+nmuvSq6Kw== 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 v2 1/2] dt-bindings: i2c: mpc: Mark "fsl,timeout" as deprecated Date: Sun, 12 Mar 2023 15:55:45 +0100 Message-Id: <20230312145546.262492-2-andi.shyti@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312145546.262492-1-andi.shyti@kernel.org> References: <20230312145546.262492-1-andi.shyti@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Now we have the i2c-scl-clk-low-timeout-ms property defined in the i2c schema. Mark "fsl,timeout" as deprecated and update the example. Signed-off-by: Andi Shyti --- Documentation/devicetree/bindings/i2c/i2c-mpc.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml b/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml index 018e1b944424..bd2dd82471c1 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml +++ b/Documentation/devicetree/bindings/i2c/i2c-mpc.yaml @@ -43,6 +43,7 @@ properties: fsl,timeout: $ref: /schemas/types.yaml#/definitions/uint32 + deprecated: true description: | I2C bus timeout in microseconds @@ -95,6 +96,6 @@ examples: interrupts = <43 2>; interrupt-parent = <&mpic>; clock-frequency = <400000>; - fsl,timeout = <10000>; + i2c-scl-clk-low-timeout-ms = <10000>; }; ... From patchwork Sun Mar 12 14:55:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 662569 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21B0DC6FA99 for ; Sun, 12 Mar 2023 14:56:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229837AbjCLO40 (ORCPT ); Sun, 12 Mar 2023 10:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjCLO4X (ORCPT ); Sun, 12 Mar 2023 10:56:23 -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 5F84148E07; Sun, 12 Mar 2023 07:56:22 -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 EE94460F51; Sun, 12 Mar 2023 14:56:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0694AC433EF; Sun, 12 Mar 2023 14:56:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678632981; bh=wgu+IozaOTOe7y4MByQPBw6wOnEqP6STQSs//ZM1rZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n7zOYxnquvIRwVU3Pg9SA1ylBU93E73LafFKYVn9AHKRxamZhaV+zEB6K7nAAlmAP C3sRaR5M6/mz1zNBHFM0qVF+XFF7XCB/CzvPLGnaVwc1okEZyAxEgsImznD8cePOsv vxPlsMRH0kDT1IICy/ZEqEIf1bqMZnDVseVQQqTgPStpPSZbhCE1gb7fCVtE95PzlQ bE3/EDqPu3rT1LXifBLX7TrkQImD1XmPl9hfaZa2O4f0Lq8PfnQLZXEI/Yb4hVvfft oN3mka2PbqYcLYxyxBXG9s7EHYdvLl3E4gxL3ZdVkWRZ/amFh8kMM95T9tE0Z39c46 jaJ9kvVdan0xw== 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 v2 2/2] i2c: mpc: Use i2c-scl-clk-low-timeout-ms i2c property Date: Sun, 12 Mar 2023 15:55:46 +0100 Message-Id: <20230312145546.262492-3-andi.shyti@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312145546.262492-1-andi.shyti@kernel.org> References: <20230312145546.262492-1-andi.shyti@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org "fsl,timeout" is marked as deprecated and replaced by the "i2c-scl-clk-low-timeout-ms" i2c property. Use this latter and, in case it is missing, for back compatibility, check whether we still have "fsl,timeout" defined. Signed-off-by: Andi Shyti --- drivers/i2c/busses/i2c-mpc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 81ac92bb4f6f..fe6279a353c6 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -846,7 +846,16 @@ static int fsl_i2c_probe(struct platform_device *op) mpc_i2c_setup_8xxx(op->dev.of_node, i2c, clock); } - prop = of_get_property(op->dev.of_node, "fsl,timeout", &plen); + prop = of_get_property(op->dev.of_node, + "i2c-scl-clk-low-timeout-ms", &plen); + + /* + * ensuring back compatibility as + * "fsl,timeout" is marked as deprecated + */ + if (!prop) + prop = of_get_property(op->dev.of_node, "fsl,timeout", &plen); + if (prop && plen == sizeof(u32)) { mpc_ops.timeout = *prop * HZ / 1000000; if (mpc_ops.timeout < 5)