From: Pratyush Anand <pratyush.anand@st.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
Mohit KUMAR DCG <Mohit.KUMAR@st.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
spear-devel <spear-devel@list.st.com>
Subject: Re: Query: Phy: How to find consumer device on dt platform
Date: Wed, 29 Jan 2014 19:47:48 +0530 [thread overview]
Message-ID: <20140129141747.GB2287@pratyush-vbox> (raw)
In-Reply-To: <201401291524.36131.arnd@arndb.de>
On Wed, Jan 29, 2014 at 10:24:35PM +0800, Arnd Bergmann wrote:
> On Wednesday 29 January 2014, Pratyush Anand wrote:
> > On Wed, Jan 29, 2014 at 01:41:56PM +0800, Kishon Vijay Abraham I wrote:
> > > >
> > > > I would instead recommend making the mode of the PHY device the
> > > > argument to the phy handle in DT, so that the sata node uses
> > > >
> > > > phys = <&phyA 0>;
> > > >
> > > > and the PCIe node uses
> > > >
> > > > phys = <&phyB 1>;
> > > >
> > > > Then the binding for the phy defines that an argument of '0' means sata mode,
> > > > while '1' means pcie mode, plus you should define all other valid modes.
> >
> > Probably, it may not help in this case. How would *phys* defining as
> > above with PCIe/SATA node help phy driver to decide whether current
> > phy instance is associated with PCIe or SATA. Actually, there is no
> > way to pass information from phy consumer driver(pcie/sata driver in
> > this case) to phy driver.
>
> I don't understand what is unclear about my example where I do just that.
> The argument (0 or 1) gets passed into the driver's xlate function
> when the consumer calls of_phy_get().
May be I did not understand this mechanism earlier.
I got it now.
Will do this way :)
Thanks for explaining it.
Regards
Pratyush
>
> > > Anyway phyA and phyB points to different nodes and just from phyA and phyB we
> > > should be able to tell whether it is sata or pcie.
> >
> > We have multiple instances (say 3) of same phy, which can be
> > programmed either for pcie or for sata. We have multiple instances of
> > ahci and pcie controller. phy_n will be connected to either ahci_n or
> > pcie_n.
> >
> > What Kishon has suggested here is exactly what I was thinking.
> > I think, we should go with this.
>
> I still find it highly inconsistent.
>
> Arnd
next prev parent reply other threads:[~2014-01-29 14:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 14:13 Query: Phy: How to find consumer device on dt platform Pratyush Anand
2014-01-28 14:28 ` Kishon Vijay Abraham I
2014-01-28 21:26 ` Arnd Bergmann
2014-01-29 5:41 ` Kishon Vijay Abraham I
2014-01-29 9:50 ` Pratyush Anand
2014-01-29 14:24 ` Arnd Bergmann
2014-01-29 14:17 ` Pratyush Anand [this message]
2014-01-29 13:39 ` Arnd Bergmann
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=20140129141747.GB2287@pratyush-vbox \
--to=pratyush.anand@st.com \
--cc=Mohit.KUMAR@st.com \
--cc=arnd@arndb.de \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=spear-devel@list.st.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