diff mbox

[U-Boot,V2,3/6] power: regulator: update comments for regulator-name

Message ID 1438666331-26325-4-git-send-email-Peng.Fan@freescale.com
State Superseded
Delegated to: Przemyslaw Marczak
Headers show

Commit Message

Peng Fan Aug. 4, 2015, 5:32 a.m. UTC
We do not need that "regulator-name" property must be provided in dts.
If "regulator-name" property is not provided in dts, node name
will chosen for settings '.name' field of uc_pdata.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Cc: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
---

Changes v2:
 New patch. Update comments for regulator-name property.

 doc/device-tree-bindings/regulator/regulator.txt | 19 ++++++++-----------
 include/power/regulator.h                        |  8 +++++---
 2 files changed, 13 insertions(+), 14 deletions(-)

Comments

Przemyslaw Marczak Aug. 4, 2015, 1:10 p.m. UTC | #1
Hello Peng,

On 08/04/2015 07:32 AM, Peng Fan wrote:
> We do not need that "regulator-name" property must be provided in dts.
> If "regulator-name" property is not provided in dts, node name
> will chosen for settings '.name' field of uc_pdata.
>
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> Cc: Przemyslaw Marczak <p.marczak@samsung.com>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>
> Changes v2:
>   New patch. Update comments for regulator-name property.
>
>   doc/device-tree-bindings/regulator/regulator.txt | 19 ++++++++-----------
>   include/power/regulator.h                        |  8 +++++---
>   2 files changed, 13 insertions(+), 14 deletions(-)
>
> diff --git a/doc/device-tree-bindings/regulator/regulator.txt b/doc/device-tree-bindings/regulator/regulator.txt
> index 68b02a8..2cf4b9d 100644
> --- a/doc/device-tree-bindings/regulator/regulator.txt
> +++ b/doc/device-tree-bindings/regulator/regulator.txt
> @@ -15,15 +15,8 @@ For the node name e.g.: "prefix[:alpha:]num { ... }":
>
>   Example the prefix "ldo" will pass for: "ldo1", "ldo@1", "LDO1", "LDOREG@1"...
>
> -Required properties:
> -- regulator-name: a string, required by the regulator uclass
> -
> -Note
> -The "regulator-name" constraint is used for setting the device's uclass
> -platform data '.name' field. And the regulator device name is set from
> -it's node name.
> -
>   Optional properties:
> +- regulator-name: a string, required by the regulator uclass
>   - regulator-min-microvolt: a minimum allowed Voltage value
>   - regulator-max-microvolt: a maximum allowed Voltage value
>   - regulator-min-microamp: a minimum allowed Current value
> @@ -31,6 +24,12 @@ Optional properties:
>   - regulator-always-on: regulator should never be disabled
>   - regulator-boot-on: enabled by bootloader/firmware
>
> +Note
> +The "regulator-name" constraint is used for setting the device's uclass
> +platform data '.name' field. And the regulator device name is set from
> +it's node name. If "regulator-name" is not provided in dts, node name
> +is chosen for setting the device's uclass platform data '.name' field.
> +
>   Other kernel-style properties, are currently not used.
>
>   Note:
> @@ -41,10 +40,8 @@ For the regulator autoset from constraints, the framework expects that:
>
>   Example:
>   ldo0 {
> -	/* Mandatory */
> -	regulator-name = "VDDQ_EMMC_1.8V";
> -
>   	/* Optional */
> +	regulator-name = "VDDQ_EMMC_1.8V";
>   	regulator-min-microvolt = <1800000>;
>   	regulator-max-microvolt = <1800000>;
>   	regulator-min-microamp = <100000>;
> diff --git a/include/power/regulator.h b/include/power/regulator.h
> index 0152290..2198664 100644
> --- a/include/power/regulator.h
> +++ b/include/power/regulator.h
> @@ -34,7 +34,7 @@
>    * regulator constraints, like in the example below:
>    *
>    * ldo1 {

When using node name, then it's automatically unique, otherwise not. So 
I would like to keep this information here.

> - *      regulator-name = "VDD_MMC_1.8V";     (must be unique for proper bind)
> + *      regulator-name = "VDD_MMC_1.8V";     (optional)
>    *      regulator-min-microvolt = <1000000>; (optional)
>    *      regulator-max-microvolt = <1000000>; (optional)
>    *      regulator-min-microamp = <1000>;     (optional)
> @@ -44,8 +44,10 @@
>    * };
>    *
>    * Note: For the proper operation, at least name constraint is needed, since
> - * it can be used when calling regulator_get_by_platname(). And the mandatory
> - * rule for this name is, that it must be globally unique for the single dts.
> + * it can be used when calling regulator_get_by_platname(). If regulator-name
> + * property is not provided, node name will be chosen for platname. And the
> + * mandatory rule for this name is, that it must be globally unique for the
> + * single dts.
>    *
>    * Regulator bind:
>    * For each regulator device, the device_bind() should be called with passed
>

Best regards,
Peng Fan Aug. 4, 2015, 1:12 p.m. UTC | #2
Hello Przemyslaw,
On Tue, Aug 04, 2015 at 03:10:22PM +0200, Przemyslaw Marczak wrote:
>Hello Peng,
>
>On 08/04/2015 07:32 AM, Peng Fan wrote:
>>We do not need that "regulator-name" property must be provided in dts.
>>If "regulator-name" property is not provided in dts, node name
>>will chosen for settings '.name' field of uc_pdata.
>>
>>Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
>>Cc: Przemyslaw Marczak <p.marczak@samsung.com>
>>Cc: Simon Glass <sjg@chromium.org>
>>---
>>
>>Changes v2:
>>  New patch. Update comments for regulator-name property.
>>
>>  doc/device-tree-bindings/regulator/regulator.txt | 19 ++++++++-----------
>>  include/power/regulator.h                        |  8 +++++---
>>  2 files changed, 13 insertions(+), 14 deletions(-)
>>
>>diff --git a/doc/device-tree-bindings/regulator/regulator.txt b/doc/device-tree-bindings/regulator/regulator.txt
>>index 68b02a8..2cf4b9d 100644
>>--- a/doc/device-tree-bindings/regulator/regulator.txt
>>+++ b/doc/device-tree-bindings/regulator/regulator.txt
>>@@ -15,15 +15,8 @@ For the node name e.g.: "prefix[:alpha:]num { ... }":
>>
>>  Example the prefix "ldo" will pass for: "ldo1", "ldo@1", "LDO1", "LDOREG@1"...
>>
>>-Required properties:
>>-- regulator-name: a string, required by the regulator uclass
>>-
>>-Note
>>-The "regulator-name" constraint is used for setting the device's uclass
>>-platform data '.name' field. And the regulator device name is set from
>>-it's node name.
>>-
>>  Optional properties:
>>+- regulator-name: a string, required by the regulator uclass
>>  - regulator-min-microvolt: a minimum allowed Voltage value
>>  - regulator-max-microvolt: a maximum allowed Voltage value
>>  - regulator-min-microamp: a minimum allowed Current value
>>@@ -31,6 +24,12 @@ Optional properties:
>>  - regulator-always-on: regulator should never be disabled
>>  - regulator-boot-on: enabled by bootloader/firmware
>>
>>+Note
>>+The "regulator-name" constraint is used for setting the device's uclass
>>+platform data '.name' field. And the regulator device name is set from
>>+it's node name. If "regulator-name" is not provided in dts, node name
>>+is chosen for setting the device's uclass platform data '.name' field.
>>+
>>  Other kernel-style properties, are currently not used.
>>
>>  Note:
>>@@ -41,10 +40,8 @@ For the regulator autoset from constraints, the framework expects that:
>>
>>  Example:
>>  ldo0 {
>>-	/* Mandatory */
>>-	regulator-name = "VDDQ_EMMC_1.8V";
>>-
>>  	/* Optional */
>>+	regulator-name = "VDDQ_EMMC_1.8V";
>>  	regulator-min-microvolt = <1800000>;
>>  	regulator-max-microvolt = <1800000>;
>>  	regulator-min-microamp = <100000>;
>>diff --git a/include/power/regulator.h b/include/power/regulator.h
>>index 0152290..2198664 100644
>>--- a/include/power/regulator.h
>>+++ b/include/power/regulator.h
>>@@ -34,7 +34,7 @@
>>   * regulator constraints, like in the example below:
>>   *
>>   * ldo1 {
>
>When using node name, then it's automatically unique, otherwise not.
>So I would like to keep this information here.

Ok. Will keep "regulator-name = "VDD_MMC_1.8V" (must be unique for proper bind)"

Regards,
Peng.
>
>>- *      regulator-name = "VDD_MMC_1.8V";     (must be unique for proper bind)
>>+ *      regulator-name = "VDD_MMC_1.8V";     (optional)
>>   *      regulator-min-microvolt = <1000000>; (optional)
>>   *      regulator-max-microvolt = <1000000>; (optional)
>>   *      regulator-min-microamp = <1000>;     (optional)
>>@@ -44,8 +44,10 @@
>>   * };
>>   *
>>   * Note: For the proper operation, at least name constraint is needed, since
>>- * it can be used when calling regulator_get_by_platname(). And the mandatory
>>- * rule for this name is, that it must be globally unique for the single dts.
>>+ * it can be used when calling regulator_get_by_platname(). If regulator-name
>>+ * property is not provided, node name will be chosen for platname. And the
>>+ * mandatory rule for this name is, that it must be globally unique for the
>>+ * single dts.
>>   *
>>   * Regulator bind:
>>   * For each regulator device, the device_bind() should be called with passed
>>
>
>Best regards,
>-- 
>Przemyslaw Marczak
>Samsung R&D Institute Poland
>Samsung Electronics
>p.marczak@samsung.com
diff mbox

Patch

diff --git a/doc/device-tree-bindings/regulator/regulator.txt b/doc/device-tree-bindings/regulator/regulator.txt
index 68b02a8..2cf4b9d 100644
--- a/doc/device-tree-bindings/regulator/regulator.txt
+++ b/doc/device-tree-bindings/regulator/regulator.txt
@@ -15,15 +15,8 @@  For the node name e.g.: "prefix[:alpha:]num { ... }":
 
 Example the prefix "ldo" will pass for: "ldo1", "ldo@1", "LDO1", "LDOREG@1"...
 
-Required properties:
-- regulator-name: a string, required by the regulator uclass
-
-Note
-The "regulator-name" constraint is used for setting the device's uclass
-platform data '.name' field. And the regulator device name is set from
-it's node name.
-
 Optional properties:
+- regulator-name: a string, required by the regulator uclass
 - regulator-min-microvolt: a minimum allowed Voltage value
 - regulator-max-microvolt: a maximum allowed Voltage value
 - regulator-min-microamp: a minimum allowed Current value
@@ -31,6 +24,12 @@  Optional properties:
 - regulator-always-on: regulator should never be disabled
 - regulator-boot-on: enabled by bootloader/firmware
 
+Note
+The "regulator-name" constraint is used for setting the device's uclass
+platform data '.name' field. And the regulator device name is set from
+it's node name. If "regulator-name" is not provided in dts, node name
+is chosen for setting the device's uclass platform data '.name' field.
+
 Other kernel-style properties, are currently not used.
 
 Note:
@@ -41,10 +40,8 @@  For the regulator autoset from constraints, the framework expects that:
 
 Example:
 ldo0 {
-	/* Mandatory */
-	regulator-name = "VDDQ_EMMC_1.8V";
-
 	/* Optional */
+	regulator-name = "VDDQ_EMMC_1.8V";
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
 	regulator-min-microamp = <100000>;
diff --git a/include/power/regulator.h b/include/power/regulator.h
index 0152290..2198664 100644
--- a/include/power/regulator.h
+++ b/include/power/regulator.h
@@ -34,7 +34,7 @@ 
  * regulator constraints, like in the example below:
  *
  * ldo1 {
- *      regulator-name = "VDD_MMC_1.8V";     (must be unique for proper bind)
+ *      regulator-name = "VDD_MMC_1.8V";     (optional)
  *      regulator-min-microvolt = <1000000>; (optional)
  *      regulator-max-microvolt = <1000000>; (optional)
  *      regulator-min-microamp = <1000>;     (optional)
@@ -44,8 +44,10 @@ 
  * };
  *
  * Note: For the proper operation, at least name constraint is needed, since
- * it can be used when calling regulator_get_by_platname(). And the mandatory
- * rule for this name is, that it must be globally unique for the single dts.
+ * it can be used when calling regulator_get_by_platname(). If regulator-name
+ * property is not provided, node name will be chosen for platname. And the
+ * mandatory rule for this name is, that it must be globally unique for the
+ * single dts.
  *
  * Regulator bind:
  * For each regulator device, the device_bind() should be called with passed