Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4858783imw; Tue, 19 Jul 2022 14:55:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sIjG/gFnSfPdW9RNlljrAHCT3KgPGch+7qCZVOY3bxCCdd5RG+umvy2OiW0d8tRytZbhnL X-Received: by 2002:a17:902:ebcb:b0:168:e3ba:4b5a with SMTP id p11-20020a170902ebcb00b00168e3ba4b5amr35325596plg.11.1658267757619; Tue, 19 Jul 2022 14:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658267757; cv=none; d=google.com; s=arc-20160816; b=JR/DC7rtfUInI5jf+RpDN0GCx2NXYLUuy7ZIKHV0CWki+9yGwa+ihMGeBIwsq7mx6b dy8vZjNFPYQwOHKPDJhOk1Bk869399LrrBXrvYTyBuoHmNaJEz2RoYYhAafExlAKQ+ly CzsFFjjxpwlsbVWEBHqm/oNmeH3w5jzEghvjsyhPToxTR01zLrJEGLsGpy0pMmP0iIoS kegm81z6MPB3TurM9wa6mvsRvlxdTIT0OJfFn1+3ctRtKoCVHo8m1B6KAxilb3O3AXk5 ygen111da4X8l2JifhEvLCjcItZiZnm6uZWOzaD/s0eczJU4l3YXGKWikvV+w33czwqg EMrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=pz3q/Gv4OcpjStI811V0syq3vyTcrN0GbQJVvJ2kSu4=; b=TcKzKxYbyPQHTj2SjAP3lctsOxoFpQ8vVqwOa03ob7Lfu6eWhrAQTdKrKgfTy4XWl8 m8P3yggeu5nfT/XAqAcxg0e0va64PgNOGAh39QGXajDxlFr7oYl82E9yp3P8YEyBiTbY v8zowGm698T+rnDpfldBC5xHnoq89nku81xlDOo1aphwX2mz/JFyZMMYqGeqA3aroo1+ lLt4N82GArlIjMXLM5/7Q3ShxBl7bwh61VhIxlQJD/GiGHr0tpZmRr1YFINQ+kBSiTt8 l/nxI+FA4stohBXy18RvwOWa/3QfWuP9Isyz0/Ec+Rlok34vEOoq25yzlG1gqzB8goVg 1QBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p7-20020a170902e74700b0016c02d77816si25617761plf.442.2022.07.19.14.55.43; Tue, 19 Jul 2022 14:55:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238484AbiGSVaz (ORCPT + 99 others); Tue, 19 Jul 2022 17:30:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234436AbiGSVay (ORCPT ); Tue, 19 Jul 2022 17:30:54 -0400 Received: from relay02.th.seeweb.it (relay02.th.seeweb.it [IPv6:2001:4b7a:2000:18::163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9734E014 for ; Tue, 19 Jul 2022 14:30:53 -0700 (PDT) Received: from localhost.localdomain (94-209-165-62.cable.dynamic.v4.ziggo.nl [94.209.165.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id AFA611F9C2; Tue, 19 Jul 2022 23:30:51 +0200 (CEST) From: Marijn Suijten To: phone-devel@vger.kernel.org, Pavel Machek , Bjorn Andersson Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] leds: ledtrig-pattern: Use last_repeat when applying hw pattern Date: Tue, 19 Jul 2022 23:30:33 +0200 Message-Id: <20220719213034.1664056-1-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org `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 Reviewed-by: Bjorn Andersson Tested-by: Bjorn Andersson --- 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. */ base-commit: 3b87ed7ea4d598c81a03317a92dfbd59102224fd -- 2.37.1