Linux-Devicetree Archive mirror
 help / color / mirror / Atom feed
From: Krishna Yarlagadda <kyarlagadda@nvidia.com>
To: <linux-tegra@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-doc@vger.kernel.org>, <linux-i2c@vger.kernel.org>,
	<linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <thierry.reding@gmail.com>, <jonathanh@nvidia.com>,
	<robh@kernel.org>, <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
	<corbet@lwn.net>, <andi.shyti@kernel.org>,
	<wsa+renesas@sang-engineering.com>, <ulf.hansson@linaro.org>,
	<adrian.hunter@intel.com>, <digetx@gmail.com>,
	<ldewangan@nvidia.com>, <kyarlagadda@nvidia.com>,
	<mkumard@nvidia.com>
Subject: [RFC PATCH 04/11] i2c: dt-bindings: configuration settings
Date: Tue, 7 May 2024 04:21:32 +0530	[thread overview]
Message-ID: <20240506225139.57647-5-kyarlagadda@nvidia.com> (raw)
In-Reply-To: <20240506225139.57647-1-kyarlagadda@nvidia.com>

I2C interface timing registers are configured using config setting
framework. Document available properties for Tegra I2C controllers.

Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
---
 .../bindings/i2c/nvidia,tegra20-i2c.yaml      | 104 ++++++++++++++++++
 1 file changed, 104 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml
index 424a4fc218b6..3b22e75e5aa0 100644
--- a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml
@@ -119,6 +119,96 @@ properties:
       - const: rx
       - const: tx
 
+  config:
+    description: Config settings for I2C devices enlisted with I2C controller.
+      Config setting is the configuration based on chip/board/system
+      characterization on interface/controller settings. This is needed for
+      - making the controller internal configuration to better perform
+      - making the interface to work proper by setting drive strength, slew
+        rates etc
+      - making the low power leakage.
+      There are two types of recommended configuration settings
+      - Controller register specific for internal operation of controller.
+      - Pad control/Pinmux/pincontrol registers for interfacing.
+      These configurations can further be categorized as static and dynamic.
+      - Static config does not change until a controller is reset.
+      - Dynamic config changes based on mode or condition, controller is
+        operating in.
+      I2C has configuration based on clock speed and has below modes.
+      - common is set on all speeds and can be overridden by speed mode.
+      - high is set when clock mode is high speed.
+      - fastplus is set when clock mode is fast plus.
+      - fast is set when clock mode is fast mode.
+      - standard is set when clock mode is standard mode.
+    $ref: /schemas/misc/nvidia,tegra-config-settings.yaml
+    unevaluatedProperties: false
+    properties:
+      nvidia,i2c-clk-divisor-hs-mode:
+        description: I2C clock divisor for HS mode.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-clk-divisor-fs-mode:
+        description: I2C clock divisor for FS mode.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-hs-sclk-high-period:
+        description: I2C high speed sclk high period.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-hs-sclk-low-period:
+        description: I2C high speed sclk low period.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-hs-stop-setup-time:
+        description: I2C high speed stop setup time.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-hs-start-hold-time:
+        description: I2C high speed start hold time.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-hs-start-setup-time:
+        description: I2C high speed start setup time.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-sclk-high-period:
+        description: I2C sclk high period.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-sclk-low-period:
+        description: I2C sclk low period.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-bus-free-time:
+        description: I2C bus free time.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-stop-setup-time:
+        description: I2C stop setup time.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-start-hold-time:
+        description: I2C start hold time.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+      nvidia,i2c-start-setup-time:
+        description: I2C start setup time.
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 0xffff
+
 allOf:
   - $ref: /schemas/i2c/i2c-controller.yaml
   - if:
@@ -189,4 +279,18 @@ examples:
 
         #address-cells = <1>;
         #size-cells = <0>;
+        config {
+            common {
+                nvidia,i2c-hs-sclk-high-period = <0x03>;
+                nvidia,i2c-hs-sclk-low-period = <0x08>;
+            };
+            fast {
+                nvidia,i2c-clk-divisor-fs-mode = <0x3c>;
+                nvidia,i2c-sclk-high-period = <0x02>;
+            };
+            fastplus {
+                nvidia,i2c-clk-divisor-fs-mode = <0x4f>;
+                nvidia,i2c-sclk-high-period = <0x07>;
+            };
+        };
     };
-- 
2.43.2


  parent reply	other threads:[~2024-05-06 22:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 22:51 [RFC PATCH 00/11] Introduce Tegra register config settings Krishna Yarlagadda
2024-05-06 22:51 ` [RFC PATCH 01/11] Documentation: Introduce config settings framework Krishna Yarlagadda
2024-05-06 22:51 ` [RFC PATCH 02/11] soc: tegra: Add config setting framework Krishna Yarlagadda
2024-05-06 22:51 ` [RFC PATCH 03/11] soc: tegra: config settings binding document Krishna Yarlagadda
2024-05-07  6:32   ` Krzysztof Kozlowski
2024-05-24  8:01     ` Thierry Reding
2024-05-06 22:51 ` Krishna Yarlagadda [this message]
2024-05-07  6:34   ` [RFC PATCH 04/11] i2c: dt-bindings: configuration settings Krzysztof Kozlowski
2024-05-07 12:35   ` Rob Herring (Arm)
2024-05-06 22:51 ` [RFC PATCH 05/11] i2c: core: Avoid config node enumeration Krishna Yarlagadda
2024-05-07  6:35   ` Krzysztof Kozlowski
2024-05-06 22:51 ` [RFC PATCH 06/11] i2c: tegra: split clock initialization code Krishna Yarlagadda
2024-05-06 22:51 ` [RFC PATCH 07/11] i2c: tegra: config settings for interface timings Krishna Yarlagadda
2024-05-06 22:51 ` [RFC PATCH 08/11] arm64: tegra: I2C " Krishna Yarlagadda
2024-05-06 22:51 ` [RFC PATCH 09/11] sdhci: dt-bindings: configuration settings Krishna Yarlagadda
2024-05-07  6:37   ` Krzysztof Kozlowski
2024-05-06 22:51 ` [RFC PATCH 10/11] mmc: host: tegra: config settings for timing Krishna Yarlagadda
2024-05-06 22:51 ` [RFC PATCH 11/11] arm64: tegra: SDHCI timing settings Krishna Yarlagadda
2024-05-07  6:38 ` [RFC PATCH 00/11] Introduce Tegra register config settings Krzysztof Kozlowski
2024-05-24  7:52   ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240506225139.57647-5-kyarlagadda@nvidia.com \
    --to=kyarlagadda@nvidia.com \
    --cc=adrian.hunter@intel.com \
    --cc=andi.shyti@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=digetx@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzk+dt@kernel.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mkumard@nvidia.com \
    --cc=robh@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).