mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@zonque.org>
To: Rob Herring <robh+dt@kernel.org>
Cc: zbr@ioremap.net, Mark Rutland <mark.rutland@arm.com>,
	szabolcs.gyurko@tlt.hu, devicetree@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC 0/4] Adding DT functionality to w1 busses
Date: Wed, 27 Jun 2018 21:12:44 +0200	[thread overview]
Message-ID: <31d55df2-b5ba-f37e-7566-c73f58ba9b43@zonque.org> (raw)
In-Reply-To: <CAL_JsqLfzfJC=_NhJy=jFAqEgfi=cvjMcnkjdHdzfM2uhKGBAQ@mail.gmail.com>

On Tuesday, June 26, 2018 11:39 PM, Rob Herring wrote:
> On Tue, Jun 19, 2018 at 3:27 PM, Daniel Mack <daniel@zonque.org> wrote:
>> In order to fully move battery-supplied devices over to devicetree, the
>> onewire subsystem must get some updates.
>>
>> Currently, the w1 bus system works like this. Device families, such as
>> battery controllers etc, are registered to the w1 core. Once a master
>> device is probed, it starts scanning the bus. Slave devices that are
>> revealed through this scan and that match previously registered
>> families are then registered, and their .add_slave() callback is
>> invoked.
>>
>> Some devices, such as the ds2760, use that callback to call
>> platform_device_alloc() at runtime with a fixed device name to
>> instanciate their only user. That user does the actual work, while the
>> slave device merely functions as an I/O proxy. In the user
>> implementation, the w1 slave device is accessible through
>> dev->parent.
> 
> Looks to me like you are letting the driver structure define the DT
> structure. This detail is all irrelevant to DT.
> 
>>
>> Now, for devicetree environments, this has to change a bit. First, slave
>> devices need to have a matching table so they can be listed as sub-nodes
>> of their master bus controller. Second, the core needs to match the
>> entries in these tables against the sub-nodes of the master node.
>> These two are trivial to do.
>>
>> The next question is how the w1 slave device and its user(s) are linked
>> together. I'm proposing a DT layout with the following example:
>>
>>          onewire {
>>                  compatible = "w1-gpio";
>>
>>                  w1_slave: slave@0 {
>>                          compatible = "maxim,w1-ds2760";
>>                  };
>>          };
>>
>>          battery-supply {
>>                  compatible = "maxim,ds2760-supply";
>>                  w1-slave = <&w1_slave>;
>>          };
> 
> This should just be one node and a child of the 1-wire master.

Yeah, you're right. This also makes the patch set much simpler.

Thanks for the feedback - I'll send another round of patches.



Daniel


      reply	other threads:[~2018-06-27 19:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19 21:27 Daniel Mack
2018-06-19 21:27 ` [PATCH RFC 1/4] dt-bindings: w1: document sub-node bindings for DS2760 Daniel Mack
2018-06-26 21:33   ` Rob Herring
2018-06-19 21:27 ` [PATCH RFC 2/4] w1: core: match sub-nodes of bus masters in devicetree Daniel Mack
2018-06-19 21:27 ` [PATCH RFC 3/4] w1: core: provide helper to look up w1 slaves through devicetree nodes Daniel Mack
2018-06-19 21:27 ` [PATCH RFC 4/4] w1: ds2760: add devicetree matching glue Daniel Mack
2018-06-26 21:39 ` [PATCH RFC 0/4] Adding DT functionality to w1 busses Rob Herring
2018-06-27 19:12   ` Daniel Mack [this message]

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=31d55df2-b5ba-f37e-7566-c73f58ba9b43@zonque.org \
    --to=daniel@zonque.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=szabolcs.gyurko@tlt.hu \
    --cc=zbr@ioremap.net \
    /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

all inboxes | Powered by JetHome®