linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manish Varma <varmam@google.com>
To: Wolfram Sang <wsa@kernel.org>, Rob Herring <robh+dt@kernel.org>
Cc: linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@android.com,
	Manish Varma <varmam@google.com>
Subject: [PATCH v1 1/2] dt-bindings: i2c: add "dev-name" property to assign specific device name
Date: Wed,  7 Apr 2021 11:50:38 -0700	[thread overview]
Message-ID: <20210407185039.621248-2-varmam@google.com> (raw)
In-Reply-To: <20210407185039.621248-1-varmam@google.com>

I2C devices currently are named dynamically using
<adapter_id>-<device_address> convention, unless they are instantiated
through ACPI.

This means the device name may vary for the same device across different
systems, infact even on the same system if the I2C bus enumeration order
changes, i.e. because of device tree modifications.

By adding an optional "dev-name" property, it provides a mechanism to
set consistent and easy to recognize names for I2C devices.

Signed-off-by: Manish Varma <varmam@google.com>
---
 Documentation/devicetree/bindings/i2c/i2c.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c.txt b/Documentation/devicetree/bindings/i2c/i2c.txt
index df41f72afc87..6fb03f464b81 100644
--- a/Documentation/devicetree/bindings/i2c/i2c.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c.txt
@@ -130,6 +130,11 @@ wants to support one of the below features, it should adapt these bindings.
 - wakeup-source
 	device can be used as a wakeup source.
 
+- dev-name
+	Name of the device.
+	Overrides the default device name which is in the form of
+	<busnr>-<addr>.
+
 Binding may contain optional "interrupts" property, describing interrupts
 used by the device. I2C core will assign "irq" interrupt (or the very first
 interrupt if not using interrupt names) as primary interrupt for the slave.
-- 
2.31.1.295.g9ea45b61b8-goog


  reply	other threads:[~2021-04-07 18:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 18:50 [PATCH v1 0/2] Override device name using DT "dev-name" property Manish Varma
2021-04-07 18:50 ` Manish Varma [this message]
2021-04-09 18:34   ` [PATCH v1 1/2] dt-bindings: i2c: add "dev-name" property to assign specific device name Rob Herring
2021-04-19 23:21     ` Manish Varma
2021-04-07 18:50 ` [PATCH v1 2/2] i2c: use "dev-name" device tree property to override " Manish Varma

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=20210407185039.621248-2-varmam@google.com \
    --to=varmam@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel-team@android.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=wsa@kernel.org \
    /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 NNTP newsgroup(s).