All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] leds: ledtrig-pattern: Use last_repeat when applying hw pattern
@ 2021-04-18 21:34 Marijn Suijten
  2021-04-30 13:41 ` Bjorn Andersson
  2022-05-04 16:02 ` Marijn Suijten
  0 siblings, 2 replies; 3+ messages in thread
From: Marijn Suijten @ 2021-04-18 21:34 UTC (permalink / raw)
  To: linux-leds; +Cc: Bjorn Andersson, Marijn Suijten, Pavel Machek, linux-kernel

`last_repeat` holds the actual value requested by the user whereas
`repeat` is a software iteration variable that is unused in hardware
patterns.

Furthermore `last_repeat` is the field returned to the user when reading
the `repeat` sysfs property.  This field is initialized to `-1` which is
- together with `1` - the only valid value in the upcoming Qualcomm LPG
driver.  It is thus unexpected when `repeat` with an initialization
value of `0` is passed into the the driver, when the sysfs property
clearly presents a value of `-1`.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/leds/trigger/ledtrig-pattern.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c
index 4d138d5317e9..2853b75df338 100644
--- a/drivers/leds/trigger/ledtrig-pattern.c
+++ b/drivers/leds/trigger/ledtrig-pattern.c
@@ -126,7 +126,8 @@ static int pattern_trig_start_pattern(struct led_classdev *led_cdev)
 
 	if (data->is_hw_pattern) {
 		return led_cdev->pattern_set(led_cdev, data->patterns,
-					     data->npatterns, data->repeat);
+					     data->npatterns,
+					     data->last_repeat);
 	}
 
 	/* At least 2 tuples for software pattern. */
-- 
2.31.1


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

* Re: [PATCH] leds: ledtrig-pattern: Use last_repeat when applying hw pattern
  2021-04-18 21:34 [PATCH] leds: ledtrig-pattern: Use last_repeat when applying hw pattern Marijn Suijten
@ 2021-04-30 13:41 ` Bjorn Andersson
  2022-05-04 16:02 ` Marijn Suijten
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2021-04-30 13:41 UTC (permalink / raw)
  To: Marijn Suijten; +Cc: linux-leds, Pavel Machek, linux-kernel

On Sun 18 Apr 16:34 CDT 2021, Marijn Suijten wrote:

> `last_repeat` holds the actual value requested by the user whereas
> `repeat` is a software iteration variable that is unused in hardware
> patterns.
> 
> Furthermore `last_repeat` is the field returned to the user when reading
> the `repeat` sysfs property.  This field is initialized to `-1` which is
> - together with `1` - the only valid value in the upcoming Qualcomm LPG
> driver.  It is thus unexpected when `repeat` with an initialization
> value of `0` is passed into the the driver, when the sysfs property
> clearly presents a value of `-1`.
> 

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  drivers/leds/trigger/ledtrig-pattern.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c
> index 4d138d5317e9..2853b75df338 100644
> --- a/drivers/leds/trigger/ledtrig-pattern.c
> +++ b/drivers/leds/trigger/ledtrig-pattern.c
> @@ -126,7 +126,8 @@ static int pattern_trig_start_pattern(struct led_classdev *led_cdev)
>  
>  	if (data->is_hw_pattern) {
>  		return led_cdev->pattern_set(led_cdev, data->patterns,
> -					     data->npatterns, data->repeat);
> +					     data->npatterns,
> +					     data->last_repeat);
>  	}
>  
>  	/* At least 2 tuples for software pattern. */
> -- 
> 2.31.1
> 

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

* Re: [PATCH] leds: ledtrig-pattern: Use last_repeat when applying hw pattern
  2021-04-18 21:34 [PATCH] leds: ledtrig-pattern: Use last_repeat when applying hw pattern Marijn Suijten
  2021-04-30 13:41 ` Bjorn Andersson
@ 2022-05-04 16:02 ` Marijn Suijten
  1 sibling, 0 replies; 3+ messages in thread
From: Marijn Suijten @ 2022-05-04 16:02 UTC (permalink / raw)
  To: linux-leds; +Cc: Bjorn Andersson, Pavel Machek, linux-kernel

Pavel,

On 2021-04-18 23:34:26, Marijn Suijten wrote:
> `last_repeat` holds the actual value requested by the user whereas
> `repeat` is a software iteration variable that is unused in hardware
> patterns.
> 
> Furthermore `last_repeat` is the field returned to the user when reading
> the `repeat` sysfs property.  This field is initialized to `-1` which is
> - together with `1` - the only valid value in the upcoming Qualcomm LPG
> driver.  It is thus unexpected when `repeat` with an initialization
> value of `0` is passed into the the driver, when the sysfs property
> clearly presents a value of `-1`.
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>

Thanks for picking up Bjorn's LPG patch into your tree!  Will you also
be able to pick up this patch to accompany it?

- Marijn

> ---
>  drivers/leds/trigger/ledtrig-pattern.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c
> index 4d138d5317e9..2853b75df338 100644
> --- a/drivers/leds/trigger/ledtrig-pattern.c
> +++ b/drivers/leds/trigger/ledtrig-pattern.c
> @@ -126,7 +126,8 @@ static int pattern_trig_start_pattern(struct led_classdev *led_cdev)
>  
>  	if (data->is_hw_pattern) {
>  		return led_cdev->pattern_set(led_cdev, data->patterns,
> -					     data->npatterns, data->repeat);
> +					     data->npatterns,
> +					     data->last_repeat);
>  	}
>  
>  	/* At least 2 tuples for software pattern. */
> -- 
> 2.31.1
> 

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

end of thread, other threads:[~2022-05-04 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-18 21:34 [PATCH] leds: ledtrig-pattern: Use last_repeat when applying hw pattern Marijn Suijten
2021-04-30 13:41 ` Bjorn Andersson
2022-05-04 16:02 ` Marijn Suijten

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.