Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2568874lqp; Mon, 25 Mar 2024 02:59:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWIc7+Nc0g/xFzcwBSfUSW/+p7tM7GrFcAVf4OFWiJkC/f0f+vB7G4Kbi0eodPYDhVnxQWKm9COMp0xOyhF6qzhRGi7GdSSVivVnEUBMw== X-Google-Smtp-Source: AGHT+IEwt55Ixf6jh8ZOcYeo976XwF+jCEHainE1/97mGKtwviOzxOjIJhLZzDzQnrSTsBJl3thu X-Received: by 2002:a05:6a00:909a:b0:6ea:b1f5:8a7 with SMTP id jo26-20020a056a00909a00b006eab1f508a7mr685740pfb.2.1711360784518; Mon, 25 Mar 2024 02:59:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711360784; cv=pass; d=google.com; s=arc-20160816; b=Th1Y+xKTfADAHKP5HLCh78OwPVV+9xdgNrCnowaBmAAsJXMIvzGXf8LbQ1YKaMeDa+ rvYZPddB8YTIadz7MDpxMVS8SWySp+U5Xk8mSxFG6vgnTsXrzUSK6NZTkgeXrmLepizT Y2/X6RD3m7zuM/1h8bwdqGF45wSHv3Y5gI3vh+nsIrp+x6TgwgiH6oHiasCeOhYJGrep L+llHxyYMEHrFiVG25JamZSd233uQEqqNm5XxdXsz3qLhWaPCY/D59+ps0sgi6AFmJ6K ts7+XbTFc1zR/gTF2gEw2Uo7g8RH7eosf07WC03/LRrgnP22yKEhaFeT99BV61vmlWvj 5C5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Vfxy2gR7YdIf+EmE44J2j0GxAm9tGXiZIHVCOyE51ZA=; fh=ivj7zDt+YXbHsjGKhYOfgTs9HtSu6e/5a+RHjV64RaU=; b=mIrpGO89/Lru+AcdE/bOJp4lLmnR7DJwdq9K6RSnRKpbQUrGEr6M+cD3KMtPrOnOS3 xIAdJLFlaLmqN9RoxCJ0Q5m81RPFs/lnfQAGpAwHEoZI/5LhP0/hC5jg8xrWl/fkXvT9 Po63oVLxd9OsN7PKo7irxJB6Njlny+54hQePhSDG6cGqDcEdhgvdQAZk/gWzISAILFX8 ld1n+OYTcuhzJpri67FWJwilwUFGVXYEUvPnYX6f+Iv98yY6cuujyBFhGXBknvFsYSSq Aby4LiJb8Ijdb+lWZRINEu9U3HR3Bd8l3RRY2y4/SxlPHUOt/nXA+AHXsRgqQ+mgBQiK QuGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ure/p40F"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115968-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115968-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n5-20020a63ee45000000b005dc72782fd6si6978267pgk.260.2024.03.25.02.59.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:59:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115968-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ure/p40F"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115968-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115968-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9CB9729E60A for ; Mon, 25 Mar 2024 09:55:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77261393B48; Mon, 25 Mar 2024 03:04:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ure/p40F" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47C42232112; Sun, 24 Mar 2024 23:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322256; cv=none; b=svnf6pzCD74HXhIo2yx0Spg8GZ+rh6B1CNsZ77HlYrkcn+zJTchAM/hM4ZGdZGAuZBo16b5+8By/Mwx+YW4yih6b+MXcfhXCldWULlXyNcGlJ0413SfRkVyFfQNXyioYLvn87vpQG7OB036YeGvzRcLPQx+biaUUGuDtGdFEyT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322256; c=relaxed/simple; bh=E/cah9PJnZMr4jy1aYat2RUIWf/zWUgYO97GdOL/LZs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EjYEjttCSHcAfzXMEgjkflKua1QB7KpujvNZCMiR6eGYKgGWTb8hNm0Ebyz1NV+jAUVDnId0Nv8Ipl7V8gcqoHWvNrJS2lor8jt7SmiHbgnOONPVbik0OStkqjVd0xhmK0Uj3s9+DsJ5rnFqYNOKUY9xMw2vYrrHK2B85LZ+mcg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ure/p40F; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79B5EC433B1; Sun, 24 Mar 2024 23:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322255; bh=E/cah9PJnZMr4jy1aYat2RUIWf/zWUgYO97GdOL/LZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ure/p40FH+XdS/Zx8woPqlA/uNv5cBHECG88R5KYq0q/aZbZPViz94/HEt3NqbO/5 LpCHfZq/NPR0PM6Wb5VRFmuOcmp+mYz0I86nnGpC9OWOXoqZsPN9UcCgc67L/bSLMM 4xHsvcOl2HVHUaot6NicEJu5FqxI0fEIFfEhLgJFZTiCVvBc9yTn+okHPbLmskW6U+ Zf0q/kCVS28kN0pBMc6vaVLlEIbxJH76gC7miEHNRQ38TXaKGg6ePawhyy8DA6GG9Z lhb0L4mKMCCqQYk4RTd2OgLSsNWAK/a4Pwk43LOz43H7dfps6XdqF6HHTdQSuRXUr1 2lK1oVMXone/g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ondrej Jirman , Lee Jones , Sasha Levin Subject: [PATCH 6.1 337/451] leds: sgm3140: Add missing timer cleanup and flash gpio control Date: Sun, 24 Mar 2024 19:10:13 -0400 Message-ID: <20240324231207.1351418-338-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Ondrej Jirman [ Upstream commit 205c29887a333ee4b37596e6533373e38cb23947 ] Enabling strobe and then setting brightness to 0 causes the driver to enter invalid state after strobe end timer fires. We should cancel strobe mode resources when changing brightness (aka torch mode). Fixes: cef8ec8cbd21 ("leds: add sgm3140 driver") Signed-off-by: Ondrej Jirman Link: https://lore.kernel.org/r/20240217191133.1757553-1-megi@xff.cz Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/leds/flash/leds-sgm3140.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/leds/flash/leds-sgm3140.c b/drivers/leds/flash/leds-sgm3140.c index d3a30ad94ac46..dd5d327c52a10 100644 --- a/drivers/leds/flash/leds-sgm3140.c +++ b/drivers/leds/flash/leds-sgm3140.c @@ -114,8 +114,11 @@ static int sgm3140_brightness_set(struct led_classdev *led_cdev, "failed to enable regulator: %d\n", ret); return ret; } + gpiod_set_value_cansleep(priv->flash_gpio, 0); gpiod_set_value_cansleep(priv->enable_gpio, 1); } else { + del_timer_sync(&priv->powerdown_timer); + gpiod_set_value_cansleep(priv->flash_gpio, 0); gpiod_set_value_cansleep(priv->enable_gpio, 0); ret = regulator_disable(priv->vin_regulator); if (ret) { -- 2.43.0