All of lore.kernel.org
 help / color / mirror / Atom feed
From: hdegoede@redhat.com (Hans de Goede)
To: linux-arm-kernel@lists.infradead.org
Subject: [linux-sunxi] Re: [PATCH v2 2/2] ehci-platform: Add support for clks and phy passed through devicetree
Date: Thu, 09 Jan 2014 18:45:32 +0100	[thread overview]
Message-ID: <52CEE03C.3090804@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1401091043380.1493-100000@iolanthe.rowland.org>

Hi,

On 01/09/2014 04:47 PM, Alan Stern wrote:
> On Thu, 9 Jan 2014, Hans de Goede wrote:
>
>>>> +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 at 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?
>>
>> Then it needs its own driver. This is intended as a binding for a
>> *generic* driver, which is meant to cover simple straight forward
>> non-pci ohci cases. For more complex cases a separate driver will
>> need to be written.
>>
>> I must say I'm becoming a bit unhappy with how the reviews of devicetree
>> bindings are being done. In one case it is not generic enough (ahci-sunxi).
>>
>> If I then try to make it more generic in a case where that can actually
>> be done as the hardware is pretty straight forward, it is not specific enough.
>> You can simply not have both!
>>
>>> Or wants to cut one but not the other for any reason?
>>
>> This is another example of non generic behavior, requiring a separate
>> (small using the existing ohci core) platform glue driver, like the *19* we
>> already have.
>
> Would DT allow ehci-platform.c to access the clocks by their index in
> the array, rather than by name?  After all, you don't really care about
> the names at all, since the driver knows nothing about the clocks'
> functions.

Yes, actually I've been discussing this with Maxime on irc and I'm
just done preparing a v3 doing exactly that. I was just checking mail
for any more review comments before pushing out v3 :)

> The same is true of the phy entry.

The phy entry must have a name, this is specified in the phy bindings
in Documentation/devicetree/bindings/phy/phy-bindings.txt:

"""
PHY user node
=============

Required Properties:
phys : the phandle for the PHY device (used by the PHY subsystem)
phy-names : the names of the PHY corresponding to the PHYs present in the
             *phys* phandle
"""

Now that I've dropped the clock-names, I've changed the ugly "phy0" name
to "usb" as the phy pointed to is supposed to be an usb phy.

Regards,

Hans

WARNING: multiple messages have this Message-ID (diff)
From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Cc: Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@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>
Subject: Re: Re: [PATCH v2 2/2] ehci-platform: Add support for clks and phy passed through devicetree
Date: Thu, 09 Jan 2014 18:45:32 +0100	[thread overview]
Message-ID: <52CEE03C.3090804@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1401091043380.1493-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>

Hi,

On 01/09/2014 04:47 PM, Alan Stern wrote:
> On Thu, 9 Jan 2014, Hans de Goede wrote:
>
>>>> +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?
>>
>> Then it needs its own driver. This is intended as a binding for a
>> *generic* driver, which is meant to cover simple straight forward
>> non-pci ohci cases. For more complex cases a separate driver will
>> need to be written.
>>
>> I must say I'm becoming a bit unhappy with how the reviews of devicetree
>> bindings are being done. In one case it is not generic enough (ahci-sunxi).
>>
>> If I then try to make it more generic in a case where that can actually
>> be done as the hardware is pretty straight forward, it is not specific enough.
>> You can simply not have both!
>>
>>> Or wants to cut one but not the other for any reason?
>>
>> This is another example of non generic behavior, requiring a separate
>> (small using the existing ohci core) platform glue driver, like the *19* we
>> already have.
>
> Would DT allow ehci-platform.c to access the clocks by their index in
> the array, rather than by name?  After all, you don't really care about
> the names at all, since the driver knows nothing about the clocks'
> functions.

Yes, actually I've been discussing this with Maxime on irc and I'm
just done preparing a v3 doing exactly that. I was just checking mail
for any more review comments before pushing out v3 :)

> The same is true of the phy entry.

The phy entry must have a name, this is specified in the phy bindings
in Documentation/devicetree/bindings/phy/phy-bindings.txt:

"""
PHY user node
=============

Required Properties:
phys : the phandle for the PHY device (used by the PHY subsystem)
phy-names : the names of the PHY corresponding to the PHYs present in the
             *phys* phandle
"""

Now that I've dropped the clock-names, I've changed the ugly "phy0" name
to "usb" as the phy pointed to is supposed to be an usb phy.

Regards,

Hans

  reply	other threads:[~2014-01-09 17:45 UTC|newest]

Thread overview: 18+ 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
2014-01-08 16:30 ` Hans de Goede
2014-01-08 16:30 ` [PATCH v2 1/2] ohci-platform: Add support for devicetree instantiation Hans de Goede
2014-01-08 16:30   ` Hans de Goede
2014-01-08 20:36   ` Florian Fainelli
2014-01-08 20:36     ` Florian Fainelli
2014-01-09 13:32     ` Hans de Goede
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
2014-01-08 16:30   ` Hans de Goede
2014-01-08 18:16   ` Maxime Ripard
2014-01-08 18:16     ` Maxime Ripard
2014-01-09 13:26     ` Hans de Goede
2014-01-09 13:26       ` Hans de Goede
2014-01-09 15:47       ` Alan Stern
2014-01-09 15:47         ` Alan Stern
2014-01-09 17:45         ` Hans de Goede [this message]
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=52CEE03C.3090804@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.