Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2393401lqp; Sun, 24 Mar 2024 17:30:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUIYZdgL6RmUUZ7DnNBN0tW9E4EQ8uKfAZNlVVzGshoUf8oh0kaDj0c0/erXBUFdXg6M39q4A7CA4wEp5bIZxMYprF6Nb1/C8bBG3mLLQ== X-Google-Smtp-Source: AGHT+IGpXo6c9JhvyBZAliSY/i/yPLBDjeCu7GpsnLwbAZl3JICp0P8ibYBmoS+PGuEJYiwIIqnP X-Received: by 2002:a9d:68d0:0:b0:6e6:cb76:3974 with SMTP id i16-20020a9d68d0000000b006e6cb763974mr4049483oto.19.1711326618257; Sun, 24 Mar 2024 17:30:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711326618; cv=pass; d=google.com; s=arc-20160816; b=GjVI8xds6K/VPekH4FMWYLMTXoKHI/K9rC6MvMZR1XwYxzJBKUDqtr99j9hfPSqO2o XjbBla3FgJjIMJgelC9zxeFxPQjXa4BWs1E1c4KrNVY/YKak1n/TLATYk39Sd6o3GZbV SwZNJoGzp2z+Yhq074OlkXtCqDQdHZhlAcQVaFpgU/X+Qs8899CWANhnnS3chhnxwjDK bkXy+bbu4kDNipDBzfRdNtLvSYKeM8oVfMPfIGttWpb6Wp+fkj4b18TImaahXKrJw1o0 3darbc2Au9EvlFq1SeettkB3Rah/SUE3NYaM8FnTrc8NhteSnnQwZ6Nfjv9ApcgU1pWr cfyw== 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=GBDm4m4zthzp/il7kPykgTmpAcPRgmqeXrq4SYPUlb0=; fh=ivj7zDt+YXbHsjGKhYOfgTs9HtSu6e/5a+RHjV64RaU=; b=RVYuihMSjYYbAelshdknnA3tLswfe7zblhrGQRCWxoj97NuY8tIvb/fpSYeIc1VA0I bVuLyTQBALoor9Jcwa9rnvEDmsOVqwIQAUbgKffTbHzAdB9I3azjBymj9CQR7Gw/U8MM 8d8OMiKORDaY0bHlgiubkUgSH/ZgatdzcTH9Ypz1nHddw2RvWSsPcQA20RD/ic6pxWcx P/gqRQHhMccJOZKAbaLiqgQekb1OWdCk/TKjyuiM3WPneUtHbt01f10X3+oAL8p01yx3 xBgUioGGzyyQIXENzGa3VEgew24l5Sk7qlDY0G2hYmMJLrSt79/XEYJcPmxaNcjX77TC Ea7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LIouecgF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113412-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 c24-20020a634e18000000b005dc87643ccdsi6379452pgb.79.2024.03.24.17.30.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:30:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113412-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=LIouecgF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113412-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 E39EA287F2A for ; Mon, 25 Mar 2024 00:30:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5877D1A7032; Sun, 24 Mar 2024 22:43:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LIouecgF" 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 5FF461A69BB; Sun, 24 Mar 2024 22:43:34 +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=1711320214; cv=none; b=p21GcnifznNkPcERyzTWq+wWWamqSq8voYkxo15SHnOv388GxFGq1P5blip6Xw1Qw3HySj3Jwc7lv2LnEeCR56foKkvIJsRsn6mgGmCOLqkRSlwoHfgwBQhzSYocbRLzglNLFIxYOPe16x8hfLHHOe9ZlcWFXj70Szv2cxpMLHM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320214; c=relaxed/simple; bh=mvaQi4rBDSOnIPPLAudxamhpMufrPv08bZt49wXE+sY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NWz/fjm6jIG/gZdPJkhRdG31KLl2i8fETpCnogHgzhx6omvGNeZ+Rs+ej9hyaJqW32Xnsl1Hj/jK4aUCEI/x/p9X91thMYEKo70CmbhQ5AQycV/liOj4Qtc0ydlgsE58O6APm41+UFchXJqs5SgjZKfj0Wv6z1hZSNw3IAV18ns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LIouecgF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B16DC43390; Sun, 24 Mar 2024 22:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320214; bh=mvaQi4rBDSOnIPPLAudxamhpMufrPv08bZt49wXE+sY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LIouecgF0c4zWdQCS1R5fbJjKKatfuf06eL1y4DVLvwnTgKNuY28gBfrb/GnmmJSU Tm2pfRZjtgIJ3jnpwMqGYKsjn40eQWC5tDerr5TwydvvBzXvGqb0+2pmW1CyOevGjG Kfy9by85k1+MXjyiywxNMUR0ooqDBhIeLgsSCRyjFnJU3TXseXahFHh13ge2DDiMJH b0vD9+K2rxmWwhxK5+R03fSYoBd4akcKozUTywSsZYYjTkoZh0ZeDhhxZq7DdmiZ+v byW1rsJESvGPoEY6ErqNQc3i1lv0kW/TD4v94ZUS+sakkzWirJxDyqIOL/xe5/Pl+w TvpPqhzC5W5Kw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ondrej Jirman , Lee Jones , Sasha Levin Subject: [PATCH 6.8 521/715] leds: sgm3140: Add missing timer cleanup and flash gpio control Date: Sun, 24 Mar 2024 18:31:40 -0400 Message-ID: <20240324223455.1342824-522-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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 eb648ff54b4e5..db0ac6641954e 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