dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] backlight: lm3630a: add functionality to change boost converter frequency
@ 2023-06-14 19:08 Maximilian Weigand
  2023-06-14 19:08 ` [PATCH 1/3] backlight: lm3630a: add support for changing the boost frequency Maximilian Weigand
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Maximilian Weigand @ 2023-06-14 19:08 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller,
	Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Heiko Stuebner
  Cc: devicetree, linux-fbdev, Maximilian Weigand, linux-kernel,
	dri-devel, linux-rockchip, linux-leds, linux-arm-kernel

For certain brightness settings the Pine64 PineNote exhibits quite
visible flickering of the led backlights, leading to an unpleasant user
experience. It is understood that flickering is caused by certain power
line ripples interacting with the led driver, inherent to the
specific hardware. The lm3630a led driver is able to change the boost
converter switching frequency. Among other things, changing the boost
frequency can also greatly improve visible flickering issues.

This patchset enables dts control of two frequency modifications that the
hardware is capable of: Switch from a base frequency of 500 kHz to 1
MHz, and activate a frequency shift to 560 kHz or 1.12 MHz,
respectively.

As flickering characteristics are mainly hardware dependent, this should
warrant the inclusion of two dts entries for the lm3630a led driver to
control the boost frequency of the chip on a per-device basis.

Changes were tested on a Pine64 PineNote. The following brightness
settings were found to exhibit serious flickering without either the
frequency shift or the higher boost frequency:

echo 186 > /sys/class/backlight/backlight_warm/brightness
echo 255 > /sys/class/backlight/backlight_cool/brightness

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
---
Maximilian Weigand (3):
      backlight: lm3630a: add support for changing the boost frequency
      dt-bindings: backlight: lm3630a: add entries to control boost frequency
      arm64: dts: rockchip: shift boost frequency for rk3566-pinenote backlight

 .../bindings/leds/backlight/lm3630a-backlight.yaml           | 12 ++++++++++++
 arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi            |  1 +
 drivers/video/backlight/lm3630a_bl.c                         |  9 ++++++++-
 include/linux/platform_data/lm3630a_bl.h                     |  5 +++++
 4 files changed, 26 insertions(+), 1 deletion(-)
---
base-commit: 858fd168a95c5b9669aac8db6c14a9aeab446375
change-id: 20230602-lm3630a_boost_frequency-bae9656ec759

Best regards,
-- 
Maximilian Weigand <mweigand@mweigand.net>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] backlight: lm3630a: add support for changing the boost frequency
  2023-06-14 19:08 [PATCH 0/3] backlight: lm3630a: add functionality to change boost converter frequency Maximilian Weigand
@ 2023-06-14 19:08 ` Maximilian Weigand
  2023-06-26 14:39   ` Daniel Thompson
  2023-06-14 19:08 ` [PATCH 2/3] dt-bindings: backlight: lm3630a: add entries to control " Maximilian Weigand
  2023-06-14 19:08 ` [PATCH 3/3] arm64: dts: rockchip: shift boost frequency for rk3566-pinenote backlight Maximilian Weigand
  2 siblings, 1 reply; 9+ messages in thread
From: Maximilian Weigand @ 2023-06-14 19:08 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller,
	Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Heiko Stuebner
  Cc: devicetree, linux-fbdev, Maximilian Weigand, linux-kernel,
	dri-devel, linux-rockchip, linux-leds, linux-arm-kernel

From: Maximilian Weigand <mweigand@mweigand.net>

The led driver supports changing the switching frequency of the boost
converter by two means: the base switching frequency can be changed from
500 kHz to 1 MHz, and a frequency shift can be activated, leading to
switching frequencies of 560 kHz or 1.12 Mhz, respectively.

Add this functionality to the led driver by introducing two dts entries
that control the boost frequency (500 kHz by default) and the frequency
shift (no shift by default).

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
---
 drivers/video/backlight/lm3630a_bl.c     | 9 ++++++++-
 include/linux/platform_data/lm3630a_bl.h | 5 +++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
index d8c42acecb5d..1e8645694ab5 100644
--- a/drivers/video/backlight/lm3630a_bl.c
+++ b/drivers/video/backlight/lm3630a_bl.c
@@ -92,7 +92,7 @@ static int lm3630a_chip_init(struct lm3630a_chip *pchip)
 	/* set Cofig. register */
 	rval |= lm3630a_update(pchip, REG_CONFIG, 0x07, pdata->pwm_ctrl);
 	/* set boost control */
-	rval |= lm3630a_write(pchip, REG_BOOST, 0x38);
+	rval |= lm3630a_write(pchip, REG_BOOST, pdata->boost_ctrl);
 	/* set current A */
 	rval |= lm3630a_update(pchip, REG_I_A, 0x1F, 0x1F);
 	/* set current B */
@@ -528,6 +528,13 @@ static int lm3630a_probe(struct i2c_client *client)
 		pdata->ledb_max_brt = LM3630A_MAX_BRIGHTNESS;
 		pdata->leda_init_brt = LM3630A_MAX_BRIGHTNESS;
 		pdata->ledb_init_brt = LM3630A_MAX_BRIGHTNESS;
+		pdata->boost_ctrl = LM3630A_BOOST_CTRL_DEFAULT;
+
+		if (device_property_read_bool(pchip->dev, "ti,boost_frequency_shift"))
+			pdata->boost_ctrl |= LM3630A_BOOST_SHIFT_FREQ;
+
+		if (device_property_read_bool(pchip->dev, "ti,boost_use_1mhz"))
+			pdata->boost_ctrl |= LM3630A_BOOST_USE_1MHZ;
 
 		rval = lm3630a_parse_node(pchip, pdata);
 		if (rval) {
diff --git a/include/linux/platform_data/lm3630a_bl.h b/include/linux/platform_data/lm3630a_bl.h
index 530be9318711..fb5ffb906dcf 100644
--- a/include/linux/platform_data/lm3630a_bl.h
+++ b/include/linux/platform_data/lm3630a_bl.h
@@ -33,6 +33,9 @@ enum lm3630a_ledb_ctrl {
 };
 
 #define LM3630A_MAX_BRIGHTNESS 255
+#define LM3630A_BOOST_CTRL_DEFAULT 0x38
+#define LM3630A_BOOST_USE_1MHZ BIT(0)
+#define LM3630A_BOOST_SHIFT_FREQ BIT(1)
 /*
  *@leda_label    : optional led a label.
  *@leda_init_brt : led a init brightness. 4~255
@@ -44,6 +47,7 @@ enum lm3630a_ledb_ctrl {
  *@ledb_ctrl     : led b disable, enable linear, enable exponential
  *@pwm_period    : pwm period
  *@pwm_ctrl      : pwm disable, bank a or b, active high or low
+ *@boost_ctrl    : boost converter control
  */
 struct lm3630a_platform_data {
 
@@ -60,6 +64,7 @@ struct lm3630a_platform_data {
 	/* pwm config. */
 	unsigned int pwm_period;
 	enum lm3630a_pwm_ctrl pwm_ctrl;
+	unsigned int boost_ctrl;
 };
 
 #endif /* __LINUX_LM3630A_H */

-- 
2.39.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] dt-bindings: backlight: lm3630a: add entries to control boost frequency
  2023-06-14 19:08 [PATCH 0/3] backlight: lm3630a: add functionality to change boost converter frequency Maximilian Weigand
  2023-06-14 19:08 ` [PATCH 1/3] backlight: lm3630a: add support for changing the boost frequency Maximilian Weigand
@ 2023-06-14 19:08 ` Maximilian Weigand
  2023-06-17 10:12   ` Krzysztof Kozlowski
  2023-06-14 19:08 ` [PATCH 3/3] arm64: dts: rockchip: shift boost frequency for rk3566-pinenote backlight Maximilian Weigand
  2 siblings, 1 reply; 9+ messages in thread
From: Maximilian Weigand @ 2023-06-14 19:08 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller,
	Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Heiko Stuebner
  Cc: devicetree, linux-fbdev, Maximilian Weigand, linux-kernel,
	dri-devel, linux-rockchip, linux-leds, linux-arm-kernel

From: Maximilian Weigand <mweigand@mweigand.net>

Add 'ti,boost_use_1mhz' to switch between 500 kHz and 1 MHz boost
converter switching frequency, and add 'ti,boost_frequency_shift' to
activate a frequency shift to 560 kHz or 1.12 MHz, respectively.

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
---
 .../bindings/leds/backlight/lm3630a-backlight.yaml           | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
index 3c9b4054ed9a..ef7ea0ad2d25 100644
--- a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
+++ b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
@@ -33,6 +33,18 @@ properties:
     description: GPIO to use to enable/disable the backlight (HWEN pin).
     maxItems: 1
 
+  ti,boost_use_1mhz:
+    description: |
+      If present, change the boost converter switching frequency from the
+      default 500 kHz to 1 MHz. Refer to data sheet for hardware requirements.
+    type: boolean
+
+  ti,boost_frequency_shift:
+    description: |
+      If present, change boost converter switching frequency from 500 kHz to
+      560 kHz or from 1 Mhz to 1.12 Mhz, respectively.
+    type: boolean
+
 required:
   - compatible
   - reg

-- 
2.39.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] arm64: dts: rockchip: shift boost frequency for rk3566-pinenote backlight
  2023-06-14 19:08 [PATCH 0/3] backlight: lm3630a: add functionality to change boost converter frequency Maximilian Weigand
  2023-06-14 19:08 ` [PATCH 1/3] backlight: lm3630a: add support for changing the boost frequency Maximilian Weigand
  2023-06-14 19:08 ` [PATCH 2/3] dt-bindings: backlight: lm3630a: add entries to control " Maximilian Weigand
@ 2023-06-14 19:08 ` Maximilian Weigand
  2 siblings, 0 replies; 9+ messages in thread
From: Maximilian Weigand @ 2023-06-14 19:08 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller,
	Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Heiko Stuebner
  Cc: devicetree, linux-fbdev, Maximilian Weigand, linux-kernel,
	dri-devel, linux-rockchip, linux-leds, linux-arm-kernel

From: Maximilian Weigand <mweigand@mweigand.net>

The PineNote exhibits visible flickering of its backlight for certain
brightness settings. Alleviate this by enabling a frequency shift from
500 kHz to 560 kHz for the boost converter of the led driver.

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
---
 arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi
index 8d61f824c12d..4e4b3bbaa157 100644
--- a/arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi
@@ -453,6 +453,7 @@ led-controller@36 {
 		pinctrl-names = "default";
 		#address-cells = <1>;
 		#size-cells = <0>;
+		ti,boost_frequency_shift;
 
 		led@0 {
 			reg = <0>;

-- 
2.39.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] dt-bindings: backlight: lm3630a: add entries to control boost frequency
  2023-06-14 19:08 ` [PATCH 2/3] dt-bindings: backlight: lm3630a: add entries to control " Maximilian Weigand
@ 2023-06-17 10:12   ` Krzysztof Kozlowski
  2023-06-17 16:34     ` Heiko Stübner
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-17 10:12 UTC (permalink / raw)
  To: Maximilian Weigand, Lee Jones, Daniel Thompson, Jingoo Han,
	Helge Deller, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Heiko Stuebner
  Cc: devicetree, linux-fbdev, Maximilian Weigand, linux-kernel,
	dri-devel, linux-rockchip, linux-leds, linux-arm-kernel

On 14/06/2023 21:08, Maximilian Weigand wrote:
> From: Maximilian Weigand <mweigand@mweigand.net>
> 
> Add 'ti,boost_use_1mhz' to switch between 500 kHz and 1 MHz boost
> converter switching frequency, and add 'ti,boost_frequency_shift' to
> activate a frequency shift to 560 kHz or 1.12 MHz, respectively.
> 
> Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
> ---
>  .../bindings/leds/backlight/lm3630a-backlight.yaml           | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
> index 3c9b4054ed9a..ef7ea0ad2d25 100644
> --- a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
> +++ b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
> @@ -33,6 +33,18 @@ properties:
>      description: GPIO to use to enable/disable the backlight (HWEN pin).
>      maxItems: 1
>  
> +  ti,boost_use_1mhz:

No underscores in property names.

> +    description: |

Do not need '|' unless you need to preserve formatting.

> +      If present, change the boost converter switching frequency from the
> +      default 500 kHz to 1 MHz. Refer to data sheet for hardware requirements.
> +    type: boolean
> +
> +  ti,boost_frequency_shift:
> +    description: |
> +      If present, change boost converter switching frequency from 500 kHz to
> +      560 kHz or from 1 Mhz to 1.12 Mhz, respectively.

So just make it a property choosing the frequency, not bools, with
proper unit suffix.


Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] dt-bindings: backlight: lm3630a: add entries to control boost frequency
  2023-06-17 10:12   ` Krzysztof Kozlowski
@ 2023-06-17 16:34     ` Heiko Stübner
  2023-06-17 17:42       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 9+ messages in thread
From: Heiko Stübner @ 2023-06-17 16:34 UTC (permalink / raw)
  To: Maximilian Weigand, Lee Jones, Daniel Thompson, Jingoo Han,
	Helge Deller, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Krzysztof Kozlowski
  Cc: devicetree, linux-fbdev, Maximilian Weigand, linux-kernel,
	dri-devel, linux-rockchip, linux-leds, linux-arm-kernel

Am Samstag, 17. Juni 2023, 12:12:17 CEST schrieb Krzysztof Kozlowski:
> On 14/06/2023 21:08, Maximilian Weigand wrote:
> > From: Maximilian Weigand <mweigand@mweigand.net>
> > 
> > Add 'ti,boost_use_1mhz' to switch between 500 kHz and 1 MHz boost
> > converter switching frequency, and add 'ti,boost_frequency_shift' to
> > activate a frequency shift to 560 kHz or 1.12 MHz, respectively.
> > 
> > Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
> > ---
> >  .../bindings/leds/backlight/lm3630a-backlight.yaml           | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
> > index 3c9b4054ed9a..ef7ea0ad2d25 100644
> > --- a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
> > +++ b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
> > @@ -33,6 +33,18 @@ properties:
> >      description: GPIO to use to enable/disable the backlight (HWEN pin).
> >      maxItems: 1
> >  
> > +  ti,boost_use_1mhz:
> 
> No underscores in property names.
> 
> > +    description: |
> 
> Do not need '|' unless you need to preserve formatting.
> 
> > +      If present, change the boost converter switching frequency from the
> > +      default 500 kHz to 1 MHz. Refer to data sheet for hardware requirements.
> > +    type: boolean
> > +
> > +  ti,boost_frequency_shift:
> > +    description: |
> > +      If present, change boost converter switching frequency from 500 kHz to
> > +      560 kHz or from 1 Mhz to 1.12 Mhz, respectively.
> 
> So just make it a property choosing the frequency, not bools, with
> proper unit suffix.

i.e.
ti,boost-frequency-hz = <x>;
with x being 500000, 560000, 1000000, 1120000

with the driver failing when the frequency is not achievable
with the two knobs of 1mhz and shift.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] dt-bindings: backlight: lm3630a: add entries to control boost frequency
  2023-06-17 16:34     ` Heiko Stübner
@ 2023-06-17 17:42       ` Krzysztof Kozlowski
  2023-06-17 18:15         ` Maximilian Weigand
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-17 17:42 UTC (permalink / raw)
  To: Heiko Stübner, Maximilian Weigand, Lee Jones,
	Daniel Thompson, Jingoo Han, Helge Deller, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: devicetree, linux-fbdev, Maximilian Weigand, linux-kernel,
	dri-devel, linux-rockchip, linux-leds, linux-arm-kernel

On 17/06/2023 18:34, Heiko Stübner wrote:
> Am Samstag, 17. Juni 2023, 12:12:17 CEST schrieb Krzysztof Kozlowski:
>> On 14/06/2023 21:08, Maximilian Weigand wrote:
>>> From: Maximilian Weigand <mweigand@mweigand.net>
>>>
>>> Add 'ti,boost_use_1mhz' to switch between 500 kHz and 1 MHz boost
>>> converter switching frequency, and add 'ti,boost_frequency_shift' to
>>> activate a frequency shift to 560 kHz or 1.12 MHz, respectively.
>>>
>>> Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
>>> ---
>>>  .../bindings/leds/backlight/lm3630a-backlight.yaml           | 12 ++++++++++++
>>>  1 file changed, 12 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
>>> index 3c9b4054ed9a..ef7ea0ad2d25 100644
>>> --- a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
>>> +++ b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
>>> @@ -33,6 +33,18 @@ properties:
>>>      description: GPIO to use to enable/disable the backlight (HWEN pin).
>>>      maxItems: 1
>>>  
>>> +  ti,boost_use_1mhz:
>>
>> No underscores in property names.
>>
>>> +    description: |
>>
>> Do not need '|' unless you need to preserve formatting.
>>
>>> +      If present, change the boost converter switching frequency from the
>>> +      default 500 kHz to 1 MHz. Refer to data sheet for hardware requirements.
>>> +    type: boolean
>>> +
>>> +  ti,boost_frequency_shift:
>>> +    description: |
>>> +      If present, change boost converter switching frequency from 500 kHz to
>>> +      560 kHz or from 1 Mhz to 1.12 Mhz, respectively.
>>
>> So just make it a property choosing the frequency, not bools, with
>> proper unit suffix.
> 
> i.e.
> ti,boost-frequency-hz = <x>;
> with x being 500000, 560000, 1000000, 1120000
> 
> with the driver failing when the frequency is not achievable
> with the two knobs of 1mhz and shift.

Yeah, with a default value (500000, I guess).

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] dt-bindings: backlight: lm3630a: add entries to control boost frequency
  2023-06-17 17:42       ` Krzysztof Kozlowski
@ 2023-06-17 18:15         ` Maximilian Weigand
  0 siblings, 0 replies; 9+ messages in thread
From: Maximilian Weigand @ 2023-06-17 18:15 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Heiko Stübner, Maximilian Weigand,
	Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller,
	Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: devicetree, linux-fbdev, linux-kernel, dri-devel, linux-rockchip,
	linux-leds, linux-arm-kernel

Hi,

On 17.06.23 19:42, Krzysztof Kozlowski wrote:
> On 17/06/2023 18:34, Heiko Stübner wrote:
>> Am Samstag, 17. Juni 2023, 12:12:17 CEST schrieb Krzysztof Kozlowski:
>>> On 14/06/2023 21:08, Maximilian Weigand wrote:
>>>> From: Maximilian Weigand <mweigand@mweigand.net>
>>>>
>>>> Add 'ti,boost_use_1mhz' to switch between 500 kHz and 1 MHz boost
>>>> converter switching frequency, and add 'ti,boost_frequency_shift' to
>>>> activate a frequency shift to 560 kHz or 1.12 MHz, respectively.
>>>>
>>>> Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
>>>> ---
>>>>  .../bindings/leds/backlight/lm3630a-backlight.yaml           | 12 ++++++++++++
>>>>  1 file changed, 12 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
>>>> index 3c9b4054ed9a..ef7ea0ad2d25 100644
>>>> --- a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
>>>> +++ b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
>>>> @@ -33,6 +33,18 @@ properties:
>>>>      description: GPIO to use to enable/disable the backlight (HWEN pin).
>>>>      maxItems: 1
>>>>  
>>>> +  ti,boost_use_1mhz:
>>>
>>> No underscores in property names.
>>>
>>>> +    description: |
>>>
>>> Do not need '|' unless you need to preserve formatting.
>>>
>>>> +      If present, change the boost converter switching frequency from the
>>>> +      default 500 kHz to 1 MHz. Refer to data sheet for hardware requirements.
>>>> +    type: boolean
>>>> +
>>>> +  ti,boost_frequency_shift:
>>>> +    description: |
>>>> +      If present, change boost converter switching frequency from 500 kHz to
>>>> +      560 kHz or from 1 Mhz to 1.12 Mhz, respectively.
>>>
>>> So just make it a property choosing the frequency, not bools, with
>>> proper unit suffix.
>>
>> i.e.
>> ti,boost-frequency-hz = <x>;
>> with x being 500000, 560000, 1000000, 1120000
>>
>> with the driver failing when the frequency is not achievable
>> with the two knobs of 1mhz and shift.
> 
> Yeah, with a default value (500000, I guess).

Thanks for the feedback, this is quite obviously the better solution! I
will rework the submission accordingly.

Best regards

Maximilian


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] backlight: lm3630a: add support for changing the boost frequency
  2023-06-14 19:08 ` [PATCH 1/3] backlight: lm3630a: add support for changing the boost frequency Maximilian Weigand
@ 2023-06-26 14:39   ` Daniel Thompson
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Thompson @ 2023-06-26 14:39 UTC (permalink / raw)
  To: Maximilian Weigand
  Cc: devicetree, Conor Dooley, Pavel Machek, Jingoo Han, Helge Deller,
	Lee Jones, linux-fbdev, dri-devel, linux-kernel, linux-rockchip,
	Rob Herring, linux-arm-kernel, Krzysztof Kozlowski,
	Maximilian Weigand, linux-leds

On Wed, Jun 14, 2023 at 09:08:52PM +0200, Maximilian Weigand wrote:
> From: Maximilian Weigand <mweigand@mweigand.net>
>
> The led driver supports changing the switching frequency of the boost
> converter by two means: the base switching frequency can be changed from
> 500 kHz to 1 MHz, and a frequency shift can be activated, leading to
> switching frequencies of 560 kHz or 1.12 Mhz, respectively.
>
> Add this functionality to the led driver by introducing two dts entries
> that control the boost frequency (500 kHz by default) and the frequency
> shift (no shift by default).
>
> Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>

Driver changes look ok (or at least will be when the DT bindings are
finalized).

However... I think patches 1 and 2 of this series are in the wrong
order. See #5 in
https://docs.kernel.org/devicetree/bindings/submitting-patches.html
for details.


Daniel.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-26 14:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 19:08 [PATCH 0/3] backlight: lm3630a: add functionality to change boost converter frequency Maximilian Weigand
2023-06-14 19:08 ` [PATCH 1/3] backlight: lm3630a: add support for changing the boost frequency Maximilian Weigand
2023-06-26 14:39   ` Daniel Thompson
2023-06-14 19:08 ` [PATCH 2/3] dt-bindings: backlight: lm3630a: add entries to control " Maximilian Weigand
2023-06-17 10:12   ` Krzysztof Kozlowski
2023-06-17 16:34     ` Heiko Stübner
2023-06-17 17:42       ` Krzysztof Kozlowski
2023-06-17 18:15         ` Maximilian Weigand
2023-06-14 19:08 ` [PATCH 3/3] arm64: dts: rockchip: shift boost frequency for rk3566-pinenote backlight Maximilian Weigand

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).