[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210915080252.69147-1-marijn.suijten@somainline.org>
Date: Wed, 15 Sep 2021 10:02:52 +0200
From: Marijn Suijten <marijn.suijten@...ainline.org>
To: phone-devel@...r.kernel.org, Pavel Machek <pavel@....cz>
Cc: ~postmarketos/upstreaming@...ts.sr.ht,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...ainline.org>,
Konrad Dybcio <konrad.dybcio@...ainline.org>,
Martin Botka <martin.botka@...ainline.org>,
Jami Kettunen <jami.kettunen@...ainline.org>,
Marijn Suijten <marijn.suijten@...ainline.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Tian Tao <tiantao6@...ilicon.com>, linux-leds@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [RESEND PATCH] leds: ledtrig-pattern: Use last_repeat when applying hw pattern
`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@...ainline.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>
Tested-by: Bjorn Andersson <bjorn.andersson@...aro.org>
---
Resending to pick up Bjorn's s-o-b/r-b and address Pavel in the To:
field directly.
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 43a265dc4696..a11d68143757 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.33.0
Powered by blists - more mailing lists