From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Alan Stern
<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
Tony Prisk <linux-ci5G2KO2hbZ+pU9mqzGVBQ@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-usb <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: [PATCH v2 2/2] ehci-platform: Add support for clks and phy passed through devicetree
Date: Wed, 8 Jan 2014 19:16:32 +0100 [thread overview]
Message-ID: <20140108181632.GG2941@lukather> (raw)
In-Reply-To: <1389198608-24339-3-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3176 bytes --]
On Wed, Jan 08, 2014 at 05:30:08PM +0100, Hans de Goede wrote:
> Currently ehci-platform is only used in combination with devicetree when used
> with some via socs. By extending it to (optionally) get clks and a phy from
> devicetree, and enabling / disabling those on power_on / off, it can be used
> more generically. Specifically after this commit it can be used for the
> ehci controller on Allwinner sunxi SoCs.
>
> Somehow we've ended up with 2 device-bindings documents for ehci-platform.c,
> this patch renames and updates one to platform-ehci.txt to reflect that this
> is a generic platform driver, and removes the other.
>
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> .../devicetree/bindings/usb/platform-ehci.txt | 25 ++++
> .../devicetree/bindings/usb/via,vt8500-ehci.txt | 15 ---
> .../devicetree/bindings/usb/vt8500-ehci.txt | 12 --
> drivers/usb/host/ehci-platform.c | 126 +++++++++++++++++----
> 4 files changed, 131 insertions(+), 47 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/usb/platform-ehci.txt
> delete mode 100644 Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt
> delete mode 100644 Documentation/devicetree/bindings/usb/vt8500-ehci.txt
>
> diff --git a/Documentation/devicetree/bindings/usb/platform-ehci.txt b/Documentation/devicetree/bindings/usb/platform-ehci.txt
> new file mode 100644
> index 0000000..56c478d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/platform-ehci.txt
> @@ -0,0 +1,25 @@
> +Generic Platform EHCI controller
> +
> +Required properties:
> +- compatible : "via,vt8500-ehci" or "wm,prizm-ehci"
> +- reg : ehci controller register range (address and length)
> +- interrupts : ehci controller interrupt
> +
> +Optional properties:
> +- clocks : a list of phandle + clock specifier pairs, one for each entry
> + in clock-names.
> +- clock-names : "clk0", "clk1", ...
> +- phys : phy
> +- phy-names : "phy0"
> +
> +Example:
> +
> + ehci@d8007900 {
> + compatible = "via,vt8500-ehci";
> + reg = <0xd8007900 0x200>;
> + interrupts = <43>;
> + clocks = <&usb_clk 6>, <&ahb_gates 2>;
> + clock-names = "clk0", "clk1";
I'm really not convinced by this either. It prevents you from doing
anything useful out of these clocks, and the only thing you can
actually do with it is calling clk_get, and that's pretty much it.
What if you some platform needs to adjust the rate of one of the two?
Or wants to cut one but not the other for any reason? You're just
screwed, and you can do anything about it, because you have no way of
telling what "clk0" is used for.
Especially, since what you really want is to access the clocks by
index, that you can do with of_clk_get.
Calling it "bus" and "phy" or whatever it's used for both provide a
way of differentiating the two, yet being rather generic. And if we
need to add a third one, I'm pretty sure we will be able to come up
with a generic name then.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-01-08 18:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 16:30 [PATCH v2 0/2] ohci and ehci-platform clks, phy and dt support Hans de Goede
[not found] ` <1389198608-24339-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-08 16:30 ` [PATCH v2 1/2] ohci-platform: Add support for devicetree instantiation Hans de Goede
[not found] ` <1389198608-24339-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-08 20:36 ` Florian Fainelli
2014-01-09 13:32 ` Hans de Goede
2014-01-08 16:30 ` [PATCH v2 2/2] ehci-platform: Add support for clks and phy passed through devicetree Hans de Goede
[not found] ` <1389198608-24339-3-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-08 18:16 ` Maxime Ripard [this message]
2014-01-09 13:26 ` Hans de Goede
[not found] ` <52CEA386.6060103-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-09 15:47 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1401091043380.1493-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-01-09 17:45 ` Hans de Goede
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=20140108181632.GG2941@lukather \
--to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-ci5G2KO2hbZ+pU9mqzGVBQ@public.gmane.org \
--cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.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).