diff mbox

[PATCH/RFC,v8,11/14] DT: Add documentation for the mfd Maxim max77693

Message ID 1417166286-27685-12-git-send-email-j.anaszewski@samsung.com
State Superseded, archived
Headers show

Commit Message

Jacek Anaszewski Nov. 28, 2014, 9:18 a.m. UTC
This patch adds device tree binding documentation for
the flash cell of the Maxim max77693 multifunctional device.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: SangYoung Son <hello.son@smasung.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Bryan Wu <cooloney@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: <devicetree@vger.kernel.org>
---
 Documentation/devicetree/bindings/mfd/max77693.txt |   74 ++++++++++++++++++++
 1 file changed, 74 insertions(+)

Comments

Pavel Machek Nov. 29, 2014, 7:26 p.m. UTC | #1
Hi!

> diff --git a/Documentation/devicetree/bindings/mfd/max77693.txt b/Documentation/devicetree/bindings/mfd/max77693.txt
> index 01e9f30..50a8dad 100644
> --- a/Documentation/devicetree/bindings/mfd/max77693.txt
> +++ b/Documentation/devicetree/bindings/mfd/max77693.txt
> @@ -41,6 +41,62 @@ Optional properties:
>  	 To get more informations, please refer to documentaion.
>  	[*] refer Documentation/devicetree/bindings/pwm/pwm.txt
>  
> +- led-flash : the LED submodule device node
> +
> +There are two led outputs available - fled1 and fled2. Each of them can
> +control a separate led or they can be connected together to double
> +the maximum current for a single connected led. One led is represented
> +by one child node.
> +
> +Required properties:
> +- compatible : must be "maxim,max77693-flash"
> +
> +Optional properties:
> +- maxim,fleds : array of current outputs in order: fled1, fled2
> +	Note: both current outputs can be connected to a single led
> +	Possible values:
> +		0 - the output is left disconnected,
> +		1 - a diode is connected to the output.

Is this one needed? Just ommit child note if it is not there.

> +- maxim,trigger-type : Array of trigger types in order: flash, torch
> +	Possible trigger types:
> +		0 - Rising edge of the signal triggers the flash/torch,
> +		1 - Signal level controls duration of the flash/torch.
> +- maxim,trigger : Array of flags indicating which trigger can activate given led
> +	in order: fled1, fled2
> +	Possible flag values (can be combined):
> +		1 - FLASH pin of the chip,
> +		2 - TORCH pin of the chip,
> +		4 - software via I2C command.

Is it good idea to have bitfields like this?

Make these required properties of the subnode?
     									Pavel
Lee Jones Dec. 1, 2014, 11:15 a.m. UTC | #2
On Fri, 28 Nov 2014, Jacek Anaszewski wrote:

> This patch adds device tree binding documentation for
> the flash cell of the Maxim max77693 multifunctional device.
> 
> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: SangYoung Son <hello.son@smasung.com>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Bryan Wu <cooloney@gmail.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Pawel Moll <pawel.moll@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
> Cc: Kumar Gala <galak@codeaurora.org>
> Cc: <devicetree@vger.kernel.org>
> ---
>  Documentation/devicetree/bindings/mfd/max77693.txt |   74 ++++++++++++++++++++
>  1 file changed, 74 insertions(+)

This definitely requires a DT Ack.

> diff --git a/Documentation/devicetree/bindings/mfd/max77693.txt b/Documentation/devicetree/bindings/mfd/max77693.txt
> index 01e9f30..50a8dad 100644
> --- a/Documentation/devicetree/bindings/mfd/max77693.txt
> +++ b/Documentation/devicetree/bindings/mfd/max77693.txt
> @@ -41,6 +41,62 @@ Optional properties:
>  	 To get more informations, please refer to documentaion.
>  	[*] refer Documentation/devicetree/bindings/pwm/pwm.txt
>  
> +- led-flash : the LED submodule device node
> +
> +There are two led outputs available - fled1 and fled2. Each of them can
> +control a separate led or they can be connected together to double
> +the maximum current for a single connected led. One led is represented
> +by one child node.
> +
> +Required properties:
> +- compatible : must be "maxim,max77693-flash"

I'm not sure this compatible string is suitable.  It looks like
NOR/NAND Flash to me.  Perhaps 'fled', or just 'led' would be better.

> +Optional properties:
> +- maxim,fleds : array of current outputs in order: fled1, fled2

Nit: Sentences start with an uppercase character.

This is true for all other occurrences.

> +	Note: both current outputs can be connected to a single led
> +	Possible values:
> +		0 - the output is left disconnected,
> +		1 - a diode is connected to the output.
> +- maxim,trigger-type : Array of trigger types in order: flash, torch
> +	Possible trigger types:
> +		0 - Rising edge of the signal triggers the flash/torch,
> +		1 - Signal level controls duration of the flash/torch.
> +- maxim,trigger : Array of flags indicating which trigger can activate given led
> +	in order: fled1, fled2
> +	Possible flag values (can be combined):
> +		1 - FLASH pin of the chip,
> +		2 - TORCH pin of the chip,
> +		4 - software via I2C command.
> +- maxim,boost-mode :
> +	In boost mode the device can produce up to 1.2A of total current
> +	on both outputs. The maximum current on each output is reduced
> +	to 625mA then. If there are two child led nodes defined then boost
> +	is enabled by default.
> +	Possible values:
> +		0 - no boost,
> +		1 - adaptive mode,
> +		2 - fixed mode.
> +- maxim,boost-vout : Output voltage of the boost module in millivolts.
> +- maxim,vsys-min : Low input voltage level in millivolts. Flash is not fired
> +	if chip estimates that system voltage could drop below this level due
> +	to flash power consumption.
> +
> +A child node must be defined per sub-led.
> +
> +Required properties of the LED child node:
> +- label : see Documentation/devicetree/bindings/leds/common.txt
> +- maxim,fled_id : identifier of the fled output the led is connected to:
> +		1 - FLED1,
> +		2 - FLED2.

Better to define all of these random numbers in include/dt-bindings.

> +Optional properties of the LED child node:
> +- max-microamp : see Documentation/devicetree/bindings/leds/common.txt
> +		Range: 15625 - 250000
> +- flash-max-microamp : see Documentation/devicetree/bindings/leds/common.txt
> +		Range: 15625 - 1000000
> +- flash-timeout-microsec : see Documentation/devicetree/bindings/leds/common.txt
> +		Range: 62500 - 1000000
> +
>  Example:
>  	max77693@66 {
>  		compatible = "maxim,max77693";
> @@ -73,4 +129,22 @@ Example:
>  			pwms = <&pwm 0 40000 0>;
>  			pwm-names = "haptic";
>  		};
> +
> +		led_flash: led-flash {

Should both be underscore.  I believe the second portion here should
be more generic "led" for instance.

> +			compatible = "maxim,max77693-flash";
> +			maxim,fleds = <1 0>;
> +			maxim,trigger = <7 0>;
> +			maxim,trigger-type = <0 1>;
> +			maxim,boost-mode = <0>;
> +			maxim,boost-vout = <5000>;
> +			maxim,vsys-min = <2400>;

These will all have to be signed off by a DT maintainer.

> +			camera-flash {
> +				maxim,fled_id = <1>
> +				label = "max77693-flash";
> +				max-microamp = <250000>;
> +				flash-max-microamp = <1000000>;
> +				flash-timeout-microsec = <1000000>;
> +			}

Missing ';'

You should probably test your example code.

> +		};
>  	};
Jacek Anaszewski Dec. 1, 2014, 12:58 p.m. UTC | #3
Hi Pavel,

Thanks for the review.

On 11/29/2014 08:26 PM, Pavel Machek wrote:
> Hi!
>
>> diff --git a/Documentation/devicetree/bindings/mfd/max77693.txt b/Documentation/devicetree/bindings/mfd/max77693.txt
>> index 01e9f30..50a8dad 100644
>> --- a/Documentation/devicetree/bindings/mfd/max77693.txt
>> +++ b/Documentation/devicetree/bindings/mfd/max77693.txt
>> @@ -41,6 +41,62 @@ Optional properties:
>>   	 To get more informations, please refer to documentaion.
>>   	[*] refer Documentation/devicetree/bindings/pwm/pwm.txt
>>
>> +- led-flash : the LED submodule device node
>> +
>> +There are two led outputs available - fled1 and fled2. Each of them can
>> +control a separate led or they can be connected together to double
>> +the maximum current for a single connected led. One led is represented
>> +by one child node.
>> +
>> +Required properties:
>> +- compatible : must be "maxim,max77693-flash"
>> +
>> +Optional properties:
>> +- maxim,fleds : array of current outputs in order: fled1, fled2
>> +	Note: both current outputs can be connected to a single led
>> +	Possible values:
>> +		0 - the output is left disconnected,
>> +		1 - a diode is connected to the output.
>
> Is this one needed? Just ommit child note if it is not there.

It is needed because you can have one led connected two both
outputs. This allows to describe such a design.

>> +- maxim,trigger-type : Array of trigger types in order: flash, torch
>> +	Possible trigger types:
>> +		0 - Rising edge of the signal triggers the flash/torch,
>> +		1 - Signal level controls duration of the flash/torch.
>> +- maxim,trigger : Array of flags indicating which trigger can activate given led
>> +	in order: fled1, fled2
>> +	Possible flag values (can be combined):
>> +		1 - FLASH pin of the chip,
>> +		2 - TORCH pin of the chip,
>> +		4 - software via I2C command.
>
> Is it good idea to have bitfields like this?
>
> Make these required properties of the subnode?

This is related to a single property: trigger. I think that splitting
it to three properties would make unnecessary noise in the
binding.

Best Regards,
Jacek Anaszewski

--
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
Pavel Machek Dec. 1, 2014, 1:02 p.m. UTC | #4
Hi!

> >Is this one needed? Just ommit child note if it is not there.
> 
> It is needed because you can have one led connected two both
> outputs. This allows to describe such a design.

Ok.

> >>+- maxim,trigger-type : Array of trigger types in order: flash, torch
> >>+	Possible trigger types:
> >>+		0 - Rising edge of the signal triggers the flash/torch,
> >>+		1 - Signal level controls duration of the flash/torch.
> >>+- maxim,trigger : Array of flags indicating which trigger can activate given led
> >>+	in order: fled1, fled2
> >>+	Possible flag values (can be combined):
> >>+		1 - FLASH pin of the chip,
> >>+		2 - TORCH pin of the chip,
> >>+		4 - software via I2C command.
> >
> >Is it good idea to have bitfields like this?
> >
> >Make these required properties of the subnode?
> 
> This is related to a single property: trigger. I think that splitting
> it to three properties would make unnecessary noise in the
> binding.

Well, maybe it is not that much noise, and you'll have useful names
(not a bitfield).

Should these properties move to the LED subnode?
									Pavel
Jacek Anaszewski Dec. 1, 2014, 1:43 p.m. UTC | #5
Hi Pavel,

On 12/01/2014 02:02 PM, Pavel Machek wrote:
> Hi!
>
>>> Is this one needed? Just ommit child note if it is not there.
>>
>> It is needed because you can have one led connected two both
>> outputs. This allows to describe such a design.
>
> Ok.
>
>>>> +- maxim,trigger-type : Array of trigger types in order: flash, torch
>>>> +	Possible trigger types:
>>>> +		0 - Rising edge of the signal triggers the flash/torch,
>>>> +		1 - Signal level controls duration of the flash/torch.
>>>> +- maxim,trigger : Array of flags indicating which trigger can activate given led
>>>> +	in order: fled1, fled2
>>>> +	Possible flag values (can be combined):
>>>> +		1 - FLASH pin of the chip,
>>>> +		2 - TORCH pin of the chip,
>>>> +		4 - software via I2C command.
>>>
>>> Is it good idea to have bitfields like this?
>>>
>>> Make these required properties of the subnode?
>>
>> This is related to a single property: trigger. I think that splitting
>> it to three properties would make unnecessary noise in the
>> binding.
>
> Well, maybe it is not that much noise, and you'll have useful names
> (not a bitfield).

I think we'd need an opinion of at least one more person :)

> Should these properties move to the LED subnode?

I would leave them device specific.

Regards,
Jacek
--
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
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/mfd/max77693.txt b/Documentation/devicetree/bindings/mfd/max77693.txt
index 01e9f30..50a8dad 100644
--- a/Documentation/devicetree/bindings/mfd/max77693.txt
+++ b/Documentation/devicetree/bindings/mfd/max77693.txt
@@ -41,6 +41,62 @@  Optional properties:
 	 To get more informations, please refer to documentaion.
 	[*] refer Documentation/devicetree/bindings/pwm/pwm.txt
 
+- led-flash : the LED submodule device node
+
+There are two led outputs available - fled1 and fled2. Each of them can
+control a separate led or they can be connected together to double
+the maximum current for a single connected led. One led is represented
+by one child node.
+
+Required properties:
+- compatible : must be "maxim,max77693-flash"
+
+Optional properties:
+- maxim,fleds : array of current outputs in order: fled1, fled2
+	Note: both current outputs can be connected to a single led
+	Possible values:
+		0 - the output is left disconnected,
+		1 - a diode is connected to the output.
+- maxim,trigger-type : Array of trigger types in order: flash, torch
+	Possible trigger types:
+		0 - Rising edge of the signal triggers the flash/torch,
+		1 - Signal level controls duration of the flash/torch.
+- maxim,trigger : Array of flags indicating which trigger can activate given led
+	in order: fled1, fled2
+	Possible flag values (can be combined):
+		1 - FLASH pin of the chip,
+		2 - TORCH pin of the chip,
+		4 - software via I2C command.
+- maxim,boost-mode :
+	In boost mode the device can produce up to 1.2A of total current
+	on both outputs. The maximum current on each output is reduced
+	to 625mA then. If there are two child led nodes defined then boost
+	is enabled by default.
+	Possible values:
+		0 - no boost,
+		1 - adaptive mode,
+		2 - fixed mode.
+- maxim,boost-vout : Output voltage of the boost module in millivolts.
+- maxim,vsys-min : Low input voltage level in millivolts. Flash is not fired
+	if chip estimates that system voltage could drop below this level due
+	to flash power consumption.
+
+A child node must be defined per sub-led.
+
+Required properties of the LED child node:
+- label : see Documentation/devicetree/bindings/leds/common.txt
+- maxim,fled_id : identifier of the fled output the led is connected to:
+		1 - FLED1,
+		2 - FLED2.
+
+Optional properties of the LED child node:
+- max-microamp : see Documentation/devicetree/bindings/leds/common.txt
+		Range: 15625 - 250000
+- flash-max-microamp : see Documentation/devicetree/bindings/leds/common.txt
+		Range: 15625 - 1000000
+- flash-timeout-microsec : see Documentation/devicetree/bindings/leds/common.txt
+		Range: 62500 - 1000000
+
 Example:
 	max77693@66 {
 		compatible = "maxim,max77693";
@@ -73,4 +129,22 @@  Example:
 			pwms = <&pwm 0 40000 0>;
 			pwm-names = "haptic";
 		};
+
+		led_flash: led-flash {
+			compatible = "maxim,max77693-flash";
+			maxim,fleds = <1 0>;
+			maxim,trigger = <7 0>;
+			maxim,trigger-type = <0 1>;
+			maxim,boost-mode = <0>;
+			maxim,boost-vout = <5000>;
+			maxim,vsys-min = <2400>;
+
+			camera-flash {
+				maxim,fled_id = <1>
+				label = "max77693-flash";
+				max-microamp = <250000>;
+				flash-max-microamp = <1000000>;
+				flash-timeout-microsec = <1000000>;
+			}
+		};
 	};