devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Viresh Kumar <viresh.kumar@st.com>,
	"cjb@laptop.org" <cjb@laptop.org>,
	"patches@linaro.org" <patches@linaro.org>,
	"devicetree-discuss@lists.ozlabs.org"
	<devicetree-discuss@lists.ozlabs.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	Anton Vorontsov <anton.vorontsov@linaro.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	"ben-linux@fluff.org" <ben-linux@fluff.org>,
	"kgene.kim@samsung.com" <kgene.kim@samsung.com>,
	Lee Jones <lee.jones@linaro.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v3 6/6] mmc: sdhci-s3c: Add device tree support
Date: Fri, 30 Mar 2012 09:48:16 -0600	[thread overview]
Message-ID: <4F75D5C0.5050307@wwwdotorg.org> (raw)
In-Reply-To: <201203301136.05038.arnd@arndb.de>

On 03/30/2012 05:36 AM, Arnd Bergmann wrote:
> On Friday 30 March 2012, Viresh Kumar wrote:
>> On 3/27/2012 9:49 PM, Arnd Bergmann wrote:
>>> These bindings came up in a discussion IRC today. I think it's rather bad that
>>> we can't agree on a common way to name the properties for mmc. We have
>>> bindings being proposed or already included from Anton, Stephen, Shawn,
>>> Rajendra, Viresh, Lee and Thomas. Almost all of them define GPIO pins
>>> for card detect and write protect, as well properties to define the bus
>>> width and high-speed modes, but we seem to have almost as many different
>>> definitions of these as we have drivers.
>>>
>>> Can we please come up with a common binding for these?
>>
>> Is there any progress on this? Sorry i wasn't following all mails.
>> How should i progress for sdhci-spear?
> 
> No progress so far. I would suggest we apply the patch below to unify
> the bindings we have. I tried to minimize the impact by picking the most
> common version for each property, but if we know about devices that would
> get broken by this, we may have to be more careful.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt
> @@ -0,0 +1,25 @@
> +These properties are common to multiple MMC host controllers. Any host
> +that requires the respective functionality should implement them using
> +these definitions.
> +
> +Required properties:
> +- bus-width: Number of data lines, can be <1>, <4>, or <8>

That property looks very reasonable.

Question: This would be a non-backwards-compatible change to the binding
definition. How should this be handled? In the past, I believe it's been
stated that new kernels need to run against old device trees, and hence
once a DT binding was defined and in use, it couldn't change except in a
backwards-compatible way. However, more recently, Grant has said that
his opinion is that (some or all?) bindings are currently considered
experimental and subject to change. And besides, the .dts files are
contained in the kernel tree at present... Some generally stated and
agreed upon policy here might be useful.

> +Optional properties:
> +- cd-gpios : Specify GPIOs for card detection, see gpio binding
> +- wp-gpios : Specify GPIOs for write protection, see gpio binding

> +- cd-inverted: when present, polarity on the wp gpio line is inverted
> +- wp-inverted: when present, polarity on the wp gpio line is inverted

I'm not sure about those two: Some of the GPIO bindings have flags in
the GPIO specifier (Tegra, ARM PL061, gpio.txt mentions the possibility
of polarity being in the specifier), and bit 0 of the flags is used to
indicate inversion. I think that either we should rely on GPIO
specifiers having such flags and remove these xxx-inverted properties
from the MMC binding, or remove that flag bit from the GPIO bindings.

Note that anything using of_gpio_simple_xlate() is going to end up using
the GPIO flag definitions from <linux/of_gpio.h> in their GPIO
specifier, and there a number of active users of this feature; grep for
OF_GPIO_ACTIVE_LOW.

The rather begs the question why of_get_named_gpio() exists; surely
of_get_named_gpio_flags() should always be used so that consumers know
whether the GPIO value should be inverted, or are the GPIO flags
supposed to be processed by the OF/GPIO core or GPIO driver somehow, and
act transparently to GPIO consumers?

> diff --git a/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt
...
> -- interrupts : Should contain SD/MMC interrupt
> +- interrupt  : Should contain SD/MMC interrupt

Isn't that usually pluralized, so interrupts?

> +- bus-width : Number of data lines, can be <1>, <4>, or <8>

For the device-specific binding documentation, rather than repeating the
core bindings, shouldn't we say something like:

This binding is based on the core MMC bindings documented in mmc.txt.
This file only documents additions or changes to those bindings.

... and then remove any of the common properties from the individual files?

> diff --git a/arch/arm/boot/dts/tegra-cardhu.dts b/arch/arm/boot/dts/tegra-cardhu.dts
...
> @@ -66,5 +67,6 @@
>  
>  	sdhci@78000400 {
>  		support-8bit;
> +		bus-width = <8>;
>  	};
>  };

Ah OK, so the first phase is to add all the new standardize properties,
then later remove all the legacy properties once the drivers have been
updated.

You've missed additions of "non-removable", but I can add them later. or
provide you an incremental patch or something.

> diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c

This doesn't seem to decode cd-inverted, or do anything with the
bus-width property value that it reads. Was that intentional?

  reply	other threads:[~2012-03-30 15:48 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 17:56 [PATCH v3 0/6] mmc: sdhci-s3c: Rework platform data and add device tree support Thomas Abraham
2012-01-31 17:56 ` [PATCH v3 1/6] mmc: sdhci-s3c: Remove usage of clk_type member in platform data Thomas Abraham
2012-01-31 17:56 ` [PATCH v3 2/6] arm: exynos4: use 'exynos4-sdhci' as device name for sdhci controllers Thomas Abraham
2012-01-31 17:56 ` [PATCH v3 3/6] arm: samsung: remove all uses of clk_type member in sdhci platform data Thomas Abraham
2012-01-31 17:56 ` [PATCH v3 4/6] mmc: sdhci-s3c: derive transfer width host capability from max_width in " Thomas Abraham
2012-01-31 19:12   ` Sergei Shtylyov
2012-01-31 17:56 ` [PATCH v3 5/6] mmc: sdhci-s3c: Keep a copy of platform data and use it Thomas Abraham
2012-01-31 17:56 ` [PATCH v3 6/6] mmc: sdhci-s3c: Add device tree support Thomas Abraham
2012-01-31 20:08   ` Grant Likely
2012-02-01 18:21   ` Karol Lewandowski
2012-03-27 16:15   ` Arnd Bergmann
2012-03-27 16:19   ` Arnd Bergmann
2012-03-30  6:33     ` Viresh Kumar
2012-03-30 11:36       ` Arnd Bergmann
2012-03-30 15:48         ` Stephen Warren [this message]
2012-03-30 18:45           ` Arnd Bergmann
     [not found]             ` <201203301845.07534.arnd-r2nGTMty4D4@public.gmane.org>
2012-04-01 11:29               ` Mark Brown
2012-05-13  4:14           ` [PATCH v2] mmc: dt: Consolidate DT bindings Chris Ball
2012-05-13 19:29             ` Guennadi Liakhovetski
     [not found]             ` <871umou38f.fsf_-_-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>
2012-05-13 19:46               ` Arnd Bergmann
2012-05-13 20:10                 ` Chris Ball
2012-05-14 19:53                   ` Arnd Bergmann
2012-04-09 14:48         ` [PATCH v3 6/6] mmc: sdhci-s3c: Add device tree support Chris Ball
2012-04-10 21:37         ` Chris Ball
2012-02-09 13:42 ` [PATCH v3 0/6] mmc: sdhci-s3c: Rework platform data and add " Kukjin Kim
2012-02-11 21:37   ` Chris Ball
2012-02-16 13:04     ` Kukjin Kim
2012-02-16 13:08       ` Chris Ball
2012-02-21 11:37         ` Kukjin Kim
2012-02-21 13:17           ` Chris Ball
2012-02-22 12:58             ` Mark Brown
2012-03-02 20:40               ` Chris Ball
2012-03-03  0:44                 ` Kukjin Kim
2012-03-27 15:50             ` Chris Ball
2012-03-28  9:54               ` Mark Brown
2012-03-29  3:15                 ` Kukjin Kim
2012-04-01  1:12                   ` Chris Ball
2012-04-02 19:08                     ` Kukjin Kim

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=4F75D5C0.5050307@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=anton.vorontsov@linaro.org \
    --cc=arnd@arndb.de \
    --cc=ben-linux@fluff.org \
    --cc=cjb@laptop.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=kgene.kim@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rob.herring@calxeda.com \
    --cc=viresh.kumar@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;
as well as URLs for NNTP newsgroup(s).