[03/20] mmc: mmci: Update DT documentation

Message ID 1395404057-27835-4-git-send-email-ulf.hansson@linaro.org
State New
Headers show

Commit Message

Ulf Hansson March 21, 2014, 12:14 p.m.
Document how to configure the regulator supplies and add an example of
a typical mmci DT node.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 Documentation/devicetree/bindings/mmc/mmci.txt |   35 ++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

Comments

Rob Herring March 21, 2014, 3:03 p.m. | #1
On Fri, Mar 21, 2014 at 7:14 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> Document how to configure the regulator supplies and add an example of
> a typical mmci DT node.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>  Documentation/devicetree/bindings/mmc/mmci.txt |   35 ++++++++++++++++++++++--
>  1 file changed, 33 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt
> index 2b584ca..d167562 100644
> --- a/Documentation/devicetree/bindings/mmc/mmci.txt
> +++ b/Documentation/devicetree/bindings/mmc/mmci.txt
> @@ -9,7 +9,38 @@ by mmc.txt and the properties used by the mmci driver.
>  Required properties:
>  - compatible             : contains "arm,pl18x", "arm,primecell".
>  - arm,primecell-periphid : contains the PrimeCell Peripheral ID.

This should not be required. This is only for if the peripheral ID is
wrong in the h/w.

> +- vmmc-supply            : phandle to the regulator device tree node.

You cannot add new required properties as that breaks the ABI. The
exception is if you *know* it is okay to break all users of this
binding.

>  Optional properties:
> -- mmc-cap-mmc-highspeed  : indicates whether MMC is high speed capable
> -- mmc-cap-sd-highspeed   : indicates whether SD is high speed capable
> +- mmc-cap-mmc-highspeed  : indicates whether MMC is high speed capable.
> +- mmc-cap-sd-highspeed   : indicates whether SD is high speed capable.
> +- vqmmc-supply           : phandle to the regulator device tree node.

Is this a standard property? If not, explain what vmmc and vgmmc are
for and what the difference is.

> +
> +Example:
> +
> +sdi0_per1@80126000 {
> +       compatible = "arm,pl18x", "arm,primecell";
> +       arm,primecell-periphid = <0x10480180>;

Drop this from the example.

> +       reg = <0x80126000 0x1000>;
> +       interrupts = <0 60 IRQ_TYPE_LEVEL_HIGH>;
> +
> +       dmas = <&dma 29 0 0x2>, /* Logical - DevToMem */
> +              <&dma 29 0 0x0>; /* Logical - MemToDev */
> +       dma-names = "rx", "tx";
> +
> +       clocks = <&prcc_kclk 1 5>, <&prcc_pclk 1 5>;
> +       clock-names = "sdi", "apb_pclk";
> +
> +       max-frequency = <100000000>;
> +       bus-width = <4>;
> +       mmc-cap-sd-highspeed;
> +       mmc-cap-mmc-highspeed;
> +       cd-gpios  = <&gpio2 31 0x4>; // 95
> +
> +       vmmc-supply = <&ab8500_ldo_aux3_reg>;
> +       vqmmc-supply = <&vmmci>;
> +
> +       pinctrl-names = "default", "sleep";
> +       pinctrl-0 = <&sdi0_default_mode>;
> +       pinctrl-1 = <&sdi0_sleep_mode>;
> +};
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson March 24, 2014, 9:03 a.m. | #2
On 21 March 2014 16:03, Rob Herring <robherring2@gmail.com> wrote:
> On Fri, Mar 21, 2014 at 7:14 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> Document how to configure the regulator supplies and add an example of
>> a typical mmci DT node.
>>
>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>> ---
>>  Documentation/devicetree/bindings/mmc/mmci.txt |   35 ++++++++++++++++++++++--
>>  1 file changed, 33 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt
>> index 2b584ca..d167562 100644
>> --- a/Documentation/devicetree/bindings/mmc/mmci.txt
>> +++ b/Documentation/devicetree/bindings/mmc/mmci.txt
>> @@ -9,7 +9,38 @@ by mmc.txt and the properties used by the mmci driver.
>>  Required properties:
>>  - compatible             : contains "arm,pl18x", "arm,primecell".
>>  - arm,primecell-periphid : contains the PrimeCell Peripheral ID.
>
> This should not be required. This is only for if the peripheral ID is
> wrong in the h/w.

You are right, I will move it to the optional section and add better
comment for it.

>
>> +- vmmc-supply            : phandle to the regulator device tree node.
>
> You cannot add new required properties as that breaks the ABI. The
> exception is if you *know* it is okay to break all users of this
> binding.

It's okay, this is already supported by the users.

>
>>  Optional properties:
>> -- mmc-cap-mmc-highspeed  : indicates whether MMC is high speed capable
>> -- mmc-cap-sd-highspeed   : indicates whether SD is high speed capable
>> +- mmc-cap-mmc-highspeed  : indicates whether MMC is high speed capable.
>> +- mmc-cap-sd-highspeed   : indicates whether SD is high speed capable.
>> +- vqmmc-supply           : phandle to the regulator device tree node.
>
> Is this a standard property? If not, explain what vmmc and vgmmc are
> for and what the difference is.

Currently both vqmmc and vmmc are handled through an API provided by
the mmc core. It's up to each mmc host driver to use it. So, yes -
this is a standard mmc binding, but it depends on the host if it's
supported.

I suppose I could add it as an optional binding for the generic mmc
bindings and then keep them here for mmci as well?

>
>> +
>> +Example:
>> +
>> +sdi0_per1@80126000 {
>> +       compatible = "arm,pl18x", "arm,primecell";
>> +       arm,primecell-periphid = <0x10480180>;
>
> Drop this from the example.
>
>> +       reg = <0x80126000 0x1000>;
>> +       interrupts = <0 60 IRQ_TYPE_LEVEL_HIGH>;
>> +
>> +       dmas = <&dma 29 0 0x2>, /* Logical - DevToMem */
>> +              <&dma 29 0 0x0>; /* Logical - MemToDev */
>> +       dma-names = "rx", "tx";
>> +
>> +       clocks = <&prcc_kclk 1 5>, <&prcc_pclk 1 5>;
>> +       clock-names = "sdi", "apb_pclk";
>> +
>> +       max-frequency = <100000000>;
>> +       bus-width = <4>;
>> +       mmc-cap-sd-highspeed;
>> +       mmc-cap-mmc-highspeed;
>> +       cd-gpios  = <&gpio2 31 0x4>; // 95
>> +
>> +       vmmc-supply = <&ab8500_ldo_aux3_reg>;
>> +       vqmmc-supply = <&vmmci>;
>> +
>> +       pinctrl-names = "default", "sleep";
>> +       pinctrl-0 = <&sdi0_default_mode>;
>> +       pinctrl-1 = <&sdi0_sleep_mode>;
>> +};
>> --
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe devicetree" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Thanks for reviewing!

Kind regards
Ulf Hansson
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt
index 2b584ca..d167562 100644
--- a/Documentation/devicetree/bindings/mmc/mmci.txt
+++ b/Documentation/devicetree/bindings/mmc/mmci.txt
@@ -9,7 +9,38 @@  by mmc.txt and the properties used by the mmci driver.
 Required properties:
 - compatible             : contains "arm,pl18x", "arm,primecell".
 - arm,primecell-periphid : contains the PrimeCell Peripheral ID.
+- vmmc-supply            : phandle to the regulator device tree node.
 
 Optional properties:
-- mmc-cap-mmc-highspeed  : indicates whether MMC is high speed capable
-- mmc-cap-sd-highspeed   : indicates whether SD is high speed capable
+- mmc-cap-mmc-highspeed  : indicates whether MMC is high speed capable.
+- mmc-cap-sd-highspeed   : indicates whether SD is high speed capable.
+- vqmmc-supply           : phandle to the regulator device tree node.
+
+Example:
+
+sdi0_per1@80126000 {
+	compatible = "arm,pl18x", "arm,primecell";
+	arm,primecell-periphid = <0x10480180>;
+	reg = <0x80126000 0x1000>;
+	interrupts = <0 60 IRQ_TYPE_LEVEL_HIGH>;
+
+	dmas = <&dma 29 0 0x2>, /* Logical - DevToMem */
+	       <&dma 29 0 0x0>; /* Logical - MemToDev */
+	dma-names = "rx", "tx";
+
+	clocks = <&prcc_kclk 1 5>, <&prcc_pclk 1 5>;
+	clock-names = "sdi", "apb_pclk";
+
+	max-frequency = <100000000>;
+	bus-width = <4>;
+	mmc-cap-sd-highspeed;
+	mmc-cap-mmc-highspeed;
+	cd-gpios  = <&gpio2 31 0x4>; // 95
+
+	vmmc-supply = <&ab8500_ldo_aux3_reg>;
+	vqmmc-supply = <&vmmci>;
+
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&sdi0_default_mode>;
+	pinctrl-1 = <&sdi0_sleep_mode>;
+};