devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Aswath Govindraju <a-govindraju@ti.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>, Nishanth Menon <nm@ti.com>,
	Rob Herring <robh+dt@kernel.org>,
	Wolfgang Grandegger <wg@grandegger.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Vinod Koul <vkoul@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-can@vger.kernel.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH RFC v3 3/4] mux: Add support for reading mux enable state from DT
Date: Tue, 30 Nov 2021 09:11:57 +0100	[thread overview]
Message-ID: <3c62744a-3d12-81d3-3270-f9496addfa61@axentia.se> (raw)
In-Reply-To: <81e5d8e2-d91a-1832-1854-2eacb60df7d6@ti.com>

On 2021-11-30 06:58, Aswath Govindraju wrote:
> On 30/11/21 11:14 am, Aswath Govindraju wrote:
>> On 25/11/21 7:22 pm, Peter Rosin wrote:
>>> With the suggested binding in my comment for patch 1/4, you'd need to do
>>> either
>>>
>>> 	ret = of_parse_phandle_with_args(np,
>>> 					 "mux-controls", "#mux-control-cells",
>>> 					 index, &args);
>>>
>>> or
>>>
>>> 	ret = of_parse_phandle_with_args(np,
>>> 					 "mux-states", "#mux-state-cells",
>>> 					 index, &args);
>>>
>>> depending on if the mux_get helper gets a NULL (enable_)state pointer or a "real"
>>> address, and then...
>>>
>>
>>
>> Sorry, while trying to implement the above method, I came across one
>> more question. So, in a given consumer DT node we will be either having
>> only mux-states or mux-controls right? How would we take care of the
>> condition when we would want to set the state of a given line in the
>> controller. Especially when a single mux chip is used by multiple
>> consumers each using a different line. Wouldn't we require both
>> mux-controls and mux-states in that case? So, shouldn't the
>> implementation be such that we need to first read mux-controls and then
>> based whether the enable_state is NULL, we read mux-states?
>>
>> Just to add more clarity, if we go about this method then we would have
>> both mux-controls and mux-states in the consumer DT node when we want to
>> specify the state.
>>
> 
> I now understood the implementation that you described. mux-states will
> be similar to the mux-controls after this patch is applied. mux-states
> can have 2 arguments(mux line and state) whereas mux-controls can have
> only one argument(mux line).
> 
> Sorry, for the inconvenience.

No trouble at all. And thanks for tackling this! I think it can open up
the mux subsystem to more uses.

I'm not sure if the devicetree folks like the concept though, there has
been no comment from that direction yet. Because it does feel a bit
unusual to potentially have both #mux-control-cells and #mux-state-cells
in a single mux provider node, especially when they are as related as
they are. But sharing a mux control between several consumer is perhaps
not the most common usage, so it will probably be the exception to
require both in actual usage. But I think all that will be clearer
when/if we see the actual binding patches.

Cheers,
Peter

  reply	other threads:[~2021-11-30  8:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23  8:12 [PATCH RFC v3 0/4] MUX: Add support for reading enable state from DT Aswath Govindraju
2021-11-23  8:12 ` [PATCH RFC v3 1/4] dt-bindings: mux: Increase the number of arguments in mux-controls Aswath Govindraju
2021-11-25 13:35   ` Peter Rosin
2021-11-29  4:36     ` Aswath Govindraju
2021-11-29  8:15       ` Peter Rosin
2021-11-29  9:31         ` Aswath Govindraju
2021-11-29 12:28           ` Peter Rosin
2021-11-29 12:55             ` Aswath Govindraju
2021-11-23  8:12 ` [PATCH RFC v3 2/4] dt-bindings: phy: ti,tcan104x-can: Document mux-controls property Aswath Govindraju
2021-11-23  8:12 ` [PATCH RFC v3 3/4] mux: Add support for reading mux enable state from DT Aswath Govindraju
2021-11-25 13:52   ` Peter Rosin
2021-11-29  4:44     ` Aswath Govindraju
2021-11-29  8:36       ` Peter Rosin
2021-11-30  5:44     ` Aswath Govindraju
2021-11-30  5:58       ` Aswath Govindraju
2021-11-30  8:11         ` Peter Rosin [this message]
2021-11-23  8:12 ` [PATCH RFC v3 4/4] phy: phy-can-transceiver: Add support for setting mux Aswath Govindraju
2021-11-25 14:07   ` Peter Rosin
2021-11-29  4:51     ` Aswath Govindraju

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=3c62744a-3d12-81d3-3270-f9496addfa61@axentia.se \
    --to=peda@axentia.se \
    --cc=a-govindraju@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=mkl@pengutronix.de \
    --cc=nm@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=vigneshr@ti.com \
    --cc=vkoul@kernel.org \
    --cc=wg@grandegger.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 NNTP newsgroup(s).