[PATCH 4/7] dt-bindings: leds: irled: ir-spi-led: Add new duty-cycle value

Biswapriyo Nath posted 7 patches 1 week, 1 day ago
There is a newer version of this series
[PATCH 4/7] dt-bindings: leds: irled: ir-spi-led: Add new duty-cycle value
Posted by Biswapriyo Nath 1 week, 1 day ago
30 duty cycle for IR transmitter is used in Xiaomi Redmi Note 8 (ginkgo).

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
---
 Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
index 72cadebf6e3..0297bfbb275 100644
--- a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
+++ b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
@@ -25,7 +25,7 @@ properties:
 
   duty-cycle:
     $ref: /schemas/types.yaml#/definitions/uint8
-    enum: [50, 60, 70, 75, 80, 90]
+    enum: [30, 50, 60, 70, 75, 80, 90]
     description:
       Percentage of one period in which the signal is active.
 

-- 
2.53.0
Re: [PATCH 4/7] dt-bindings: leds: irled: ir-spi-led: Add new duty-cycle value
Posted by Krzysztof Kozlowski 6 days, 16 hours ago
On Wed, Mar 25, 2026 at 06:07:27PM +0000, Biswapriyo Nath wrote:
> 30 duty cycle for IR transmitter is used in Xiaomi Redmi Note 8 (ginkgo).
> 
> Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
> ---
>  Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
> index 72cadebf6e3..0297bfbb275 100644
> --- a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
> +++ b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
> @@ -25,7 +25,7 @@ properties:
>  
>    duty-cycle:
>      $ref: /schemas/types.yaml#/definitions/uint8
> -    enum: [50, 60, 70, 75, 80, 90]
> +    enum: [30, 50, 60, 70, 75, 80, 90]

Hm, why is this enum, instead of 1-99, in the first place?

Best regards,
Krzysztof
Re: [PATCH 4/7] dt-bindings: leds: irled: ir-spi-led: Add new duty-cycle value
Posted by Sean Young 6 days, 15 hours ago
On Fri, Mar 27, 2026 at 08:51:18AM +0100, Krzysztof Kozlowski wrote:
> On Wed, Mar 25, 2026 at 06:07:27PM +0000, Biswapriyo Nath wrote:
> > 30 duty cycle for IR transmitter is used in Xiaomi Redmi Note 8 (ginkgo).
> > 
> > Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
> > ---
> >  Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
> > index 72cadebf6e3..0297bfbb275 100644
> > --- a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
> > +++ b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
> > @@ -25,7 +25,7 @@ properties:
> >  
> >    duty-cycle:
> >      $ref: /schemas/types.yaml#/definitions/uint8
> > -    enum: [50, 60, 70, 75, 80, 90]
> > +    enum: [30, 50, 60, 70, 75, 80, 90]
> 
> Hm, why is this enum, instead of 1-99, in the first place?

Well in reality only a few different duty cycles are used by IR protocols.
30% is quite common so that should part of the list. 

Having said that a range of 1-99 would be nicer. Do we set this like so:

 - minimum: 1
 - maximum: 99

?

Thanks,

Sean
Re: [PATCH 4/7] dt-bindings: leds: irled: ir-spi-led: Add new duty-cycle value
Posted by Krzysztof Kozlowski 6 days, 14 hours ago
On 27/03/2026 09:41, Sean Young wrote:
> On Fri, Mar 27, 2026 at 08:51:18AM +0100, Krzysztof Kozlowski wrote:
>> On Wed, Mar 25, 2026 at 06:07:27PM +0000, Biswapriyo Nath wrote:
>>> 30 duty cycle for IR transmitter is used in Xiaomi Redmi Note 8 (ginkgo).
>>>
>>> Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
>>> ---
>>>  Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
>>> index 72cadebf6e3..0297bfbb275 100644
>>> --- a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
>>> +++ b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
>>> @@ -25,7 +25,7 @@ properties:
>>>  
>>>    duty-cycle:
>>>      $ref: /schemas/types.yaml#/definitions/uint8
>>> -    enum: [50, 60, 70, 75, 80, 90]
>>> +    enum: [30, 50, 60, 70, 75, 80, 90]
>>
>> Hm, why is this enum, instead of 1-99, in the first place?
> 
> Well in reality only a few different duty cycles are used by IR protocols.
> 30% is quite common so that should part of the list. 
> 
> Having said that a range of 1-99 would be nicer. Do we set this like so:
> 
>  - minimum: 1
>  - maximum: 99

I asked, because I don't know what hardware is really there. This should
match reality, so if you say continuous range is never used, it does not
have the be changed to 1-99.


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof
Re: [PATCH 4/7] dt-bindings: leds: irled: ir-spi-led: Add new duty-cycle value
Posted by Sean Young 6 days, 13 hours ago
On Fri, Mar 27, 2026 at 10:38:17AM +0100, Krzysztof Kozlowski wrote:
> On 27/03/2026 09:41, Sean Young wrote:
> > On Fri, Mar 27, 2026 at 08:51:18AM +0100, Krzysztof Kozlowski wrote:
> >> On Wed, Mar 25, 2026 at 06:07:27PM +0000, Biswapriyo Nath wrote:
> >>> 30 duty cycle for IR transmitter is used in Xiaomi Redmi Note 8 (ginkgo).
> >>>
> >>> Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
> >>> ---
> >>>  Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
> >>> index 72cadebf6e3..0297bfbb275 100644
> >>> --- a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
> >>> +++ b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
> >>> @@ -25,7 +25,7 @@ properties:
> >>>  
> >>>    duty-cycle:
> >>>      $ref: /schemas/types.yaml#/definitions/uint8
> >>> -    enum: [50, 60, 70, 75, 80, 90]
> >>> +    enum: [30, 50, 60, 70, 75, 80, 90]
> >>
> >> Hm, why is this enum, instead of 1-99, in the first place?
> > 
> > Well in reality only a few different duty cycles are used by IR protocols.
> > 30% is quite common so that should part of the list. 
> > 
> > Having said that a range of 1-99 would be nicer. Do we set this like so:
> > 
> >  - minimum: 1
> >  - maximum: 99
> 
> I asked, because I don't know what hardware is really there. This should
> match reality, so if you say continuous range is never used, it does not
> have the be changed to 1-99.

So the transmit hardware can do an continuous range (almost). It's the
real life usage which doesn't really use many different values.

The value set here is just the default duty cycle. There is also an ioctl 
LIRC_SET_SEND_DUTY_CYCLE which sets the duty cycle for transmission.

Most IR drivers just have a hardcoded default value for the duty cycle,
I think ir-spi is the only one which allows this to be set via dt.

I'd say allowing the default to be set via dt is not necessary. If this had
occurred to be during review I would've asked for it to be removed. It's
there now, so:

Reviewed-by: Sean Young <sean@mess.org>

Sean