Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3390466rwr; Sun, 7 May 2023 10:34:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hfT3qfqy4IgL8jU37Og6a0o03fGTI0nGxwQdZxqG7jOtc9UjKpDMyJUkSKCDXpIsdCFmq X-Received: by 2002:a05:6a20:734b:b0:f5:2b11:5a05 with SMTP id v11-20020a056a20734b00b000f52b115a05mr8868229pzc.19.1683480893590; Sun, 07 May 2023 10:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683480893; cv=none; d=google.com; s=arc-20160816; b=OHTHk/vY5hUOYAajBab8my2+3i8kw63zIQznkX2Q2PFhP2LL1w5Fs7P0pEldmADlza H46YIxAtoUz690/740NXkiQ8IssmVxw4SAYvwjy/+85BII5OzxGHHiAgH3lz2LmShe9Z iBK/fhW++ZDMpSuA0onWQ5BedJw+1w7T+ezRlnd7cce41tpTM4MoUPpVd+OU4IdMbkQw snjSdWVi5QPvOmjGYgB4pm2D6HHPlfgYuLqgUkYRcxqEmFSTmwyaFfWdcIKyQxJ63g1B LLgSxDWty6Uu8rCORyXqXXNpocY+cAZYv6pVEPKhq/nD9NbTrLVf8RG4bRM16iTl7rgo +jDg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SQHQgsnbPJTgsXPCqG4AqQGuAPuZsFrH5o3VxE1rTc4=; b=1J8y3ZkNS/z+GBDBJsl4LoE2xogsnWCCrojkhx+wfbmIEdUAqFuy2U4E7+/8aWOBdy HTRBs+OEz3CT9p/Rxwbvrpp62wGK8WF5W9fkGOsvEE3vsN7JxtqWCCwWu3zMpXBO4S8b iPj+Abp8ZweD3tt4CQ0EiDS+23VcH0h6JvIC2XHX+KkmkigsUqtnF3l0crihcePUIwab s4ktZPITA/eHoYilFQwwZmu3r/ZLQdQ40UL8OwfzMIleLQpOBuv6GVY3jqBunOdeKxso jpkj+EqpFhP5+UE2vwmSvR5hpx479MhMXnA8w+BqVU2wOx52eFex2kv/OwyTwe7AjFFJ PJ/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dylanvanassche.be header.s=MBO0001 header.b=L8DHt6oq; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020aa79887000000b0063b8685bab4si6802765pfl.113.2023.05.07.10.34.41; Sun, 07 May 2023 10:34:53 -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; dkim=pass header.i=@dylanvanassche.be header.s=MBO0001 header.b=L8DHt6oq; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231784AbjEGRcJ (ORCPT + 99 others); Sun, 7 May 2023 13:32:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231686AbjEGRcF (ORCPT ); Sun, 7 May 2023 13:32:05 -0400 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FF1A1BD1; Sun, 7 May 2023 10:32:01 -0700 (PDT) Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4QDs1B61f7z9skr; Sun, 7 May 2023 19:31:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dylanvanassche.be; s=MBO0001; t=1683480718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SQHQgsnbPJTgsXPCqG4AqQGuAPuZsFrH5o3VxE1rTc4=; b=L8DHt6oqMQ8+MSjhjgvR8ROjEp/xzp//i4ahR1oot9wJb9ksy9p4mq7TVNSDmY2bjQffzU 6PyzNP/QvBRbBiXG2THMOqGShi6WG5B7bTACe2E3Ew4b+GTYPzawtWWKe41tQBA1qZn33/ P2kW/icoEIwE3GyDua1Hmep0/3lRWUZ9c8qNlgMbDP/CdAMNjUEzo2IfBR3VWmAs3lZXZV 5pg6FsY0mGznF5gKGBvmXpDavzgcnwGuadaCdgRwvn5Dw6EBo51DyiibPGjxq6WgAe9Z3T LpWi0Sh1FM7IdQBqjL6FwrOI2wMAAOnzxSiKNGPl3qjEwyibISoTU/mobYdAqQ== From: Dylan Van Assche To: pavel@ucw.cz, quic_fenglinw@quicinc.com, lee@kernel.org Cc: trix@redhat.com, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Dylan Van Assche Subject: [PATCH 2/2] leds: flash: leds-qcom-flash: disable LED when changing brightness Date: Sun, 7 May 2023 19:29:41 +0200 Message-Id: <20230507172941.364852-3-me@dylanvanassche.be> In-Reply-To: <20230507172941.364852-1-me@dylanvanassche.be> References: <20230507172941.364852-1-me@dylanvanassche.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 The Qualcomm PMI8998 PMIC requires the LED to be disabled when configuring the brightness. Always disable the LED when setting the brightness and re-enable it afterwards. Signed-off-by: Dylan Van Assche --- drivers/leds/flash/leds-qcom-flash.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/leds/flash/leds-qcom-flash.c b/drivers/leds/flash/leds-qcom-flash.c index 16045b5d89b1..c8d41a3caf38 100644 --- a/drivers/leds/flash/leds-qcom-flash.c +++ b/drivers/leds/flash/leds-qcom-flash.c @@ -417,6 +417,14 @@ static int qcom_flash_led_brightness_set(struct led_classdev *led_cdev, bool enable = !!brightness; int rc; + rc = set_flash_strobe(led, SW_STROBE, false); + if (rc) + return rc; + + rc = set_flash_module_en(led, false); + if (rc) + return rc; + rc = set_flash_current(led, current_ma, TORCH_MODE); if (rc) return rc; -- 2.40.1