Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1346221lqt; Fri, 7 Jun 2024 16:03:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3fAXwXSaREWqF/NT8qklA8VUrK3/dAHwC1HyqA3yuNJ1msRTEAlGXrLklONoK5QEOOUhY9FnVJSQX00MJem81mCi3qO5LpWL8AFqfvA== X-Google-Smtp-Source: AGHT+IGhnvWDUv7dNq23jNzXXUWps9ru7LpeCrZr73OSPp27Hatu2i1mtiqFGsUwqwNqky6o5upm X-Received: by 2002:a50:a6c3:0:b0:579:cd46:cbfd with SMTP id 4fb4d7f45d1cf-57c509022aemr2096222a12.18.1717801411728; Fri, 07 Jun 2024 16:03:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717801411; cv=pass; d=google.com; s=arc-20160816; b=U4GW3AKYuFOZp3WlWwScElRxTKXFfrYXjuYecOnwJ3bHsL4EWv13w5TdU392kyPWlS dqcj1iFI/R9rJ1UQv5+ugGACoREqClLICKY9RO44Xs7XCMeca1VCYM+pKsoKdW6UdFoY iLi4L7RytIL+HZd+vYuNtLBQ6Trh1FA+hp4tY3qbLzbsuv/1PE/H09bT9lVSGW5f+VEU 9LldU23Xkk37RzyVA6Roc+1NIvl82RXp2G8RLgk0VkwzXVt8WAYel9X5UTM8UuKm9S81 2OM9rNy7o3nYPXsnjAWX04iRBNX4NBHFH1cL3RiH/Qu1fQAayUqCvGO4mdlPfDIJw+Zs ChDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JwqoOXSU7QwAQ5IzV7yakmLW/aV7SZdzzt3RFTZBGPY=; fh=hY+/VZCIh3BxOImLBte92E3H2aAZfKQdsCEediVEFsQ=; b=tgwaQiYRPHsOG8w/y9sPw0MpOdMdG+8mxkEJOqQ7SlnYLMYsWjg8yLnak8q4XqbA+2 SXEl513gZnLB7wFM5qxodfRlEcEq+kLBwrKk2qMlynlapVf45NLJoZx/SVCUchFB3i1t +cMcNBZxHqHrC7mw7WcW+oTvgqjJDrN39jyGAzu8ZpX/zFlfeECII8QNhFRkthEQ80SH 5ajCTSmAxizkU+JXazIJ/e/EGnnJ8uwcozi+hKOeO6yAwO3tTT//6p7U9LIa8wy2LIHd 8o6mZ9L5MbzWLymjNETfC6rwEXGjv9QO5pd8IiCNViefHLMsUJfCaPOBg8C5DQ5qFOYQ 5ADg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SZYzWvP6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206826-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206826-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae0c6313si2264015a12.4.2024.06.07.16.03.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 16:03:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206826-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SZYzWvP6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206826-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206826-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 669021F23E75 for ; Fri, 7 Jun 2024 23:03:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54C1C13C699; Fri, 7 Jun 2024 23:03:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SZYzWvP6" 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 7130F73473; Fri, 7 Jun 2024 23:03:12 +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=1717801392; cv=none; b=Zpv9uaAuZqUJ+n4k8vZLwZ5INvOn+84tt8uRbXbSor9YT7rcc6+TKZjfOkrzxB8280kxN+SB6lwQ17Nqoc6BxgbgZnawR3VuIgcZ+kfc0soDvHQzQcLXJ22+RJ5wgr3rlyX6oJz+/nDGMmBtyh+qGDQIRTl3ubnU7uoV0MpcEt4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717801392; c=relaxed/simple; bh=Tb0j3EBei+kALnLa+H4KZkSPMvY9CdcHeBoA3BM1ESU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VD26jYBQGmEU3x+lqKcL0hS7glJiNTncfCPiEbXnjhoC+T1gH7bspqRqpIg6DT7e5wST0cUSQpBdBKi2TAqcvuL3z7AHvA0CQbO6wRcW8ktXsg2LbpY2mb3wz3zPGYh+rJCZv3IawuZuUinzfqBQfAJTDjPcuPbsa/ioI2rHdbY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SZYzWvP6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3BB5C4AF07; Fri, 7 Jun 2024 23:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717801392; bh=Tb0j3EBei+kALnLa+H4KZkSPMvY9CdcHeBoA3BM1ESU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SZYzWvP6XmivM98pvEdDsoqEXgz2mOjmHXr/2lntK8ylsw755ibSuK8/pUcJVZCQc oIlWU16e9KqLx6qKtNBcSWqU0/1N1fWgl1Qn79a/BfYFZtMK9v9gblyxVQosjvsvSy btGSCnaVSY3d+n76Nu0YIPRADVAYdtXBE4NF28Fdwh72lcAx40onlQW2izy8AYpZEu yhGQPoNDfDT3ZB/IdwhNFgqg0kMR8gRUBgUsF8BnyCFo/ZFdOKl5yB/pMdIX+WBw2P JTtmacdS71JDsQpRYErolLgYSa/GSpiXfVmtheGnELqHNrHRmBcTnwlTXUT0zoaLkA ep2yVgbWcFMbw== Date: Fri, 7 Jun 2024 18:03:08 -0500 From: Bjorn Andersson To: Anjelique Melendez Cc: pavel@ucw.cz, lee@kernel.org, robh@kernel.org, u.kleine-koenig@pengutronix.de, marijn.suijten@somainline.org, kees@kernel.org, morf3089@gmail.com, quic_gurus@quicinc.com, quic_subbaram@quicinc.com, linux-arm-msm@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] leds: rgb: leds-qcom-lpg: Add PPG check for setting/clearing PBS triggers Message-ID: References: <20240607005250.4047135-1-quic_amelende@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240607005250.4047135-1-quic_amelende@quicinc.com> On Thu, Jun 06, 2024 at 05:52:50PM GMT, Anjelique Melendez wrote: > Currently, all LED LPG devices will call lpg_{set,clear}_pbs_trigger() > when setting brightness regardless of if they support PPG and have PBS > triggers. Check if device supports PPG before setting/clearing PBS > triggers. > > Fixes: 6ab1f766a80a ("leds: rgb: leds-qcom-lpg: Add support for PPG through single SDAM") > Fixes: 5e9ff626861a ("leds: rgb: leds-qcom-lpg: Include support for PPG with dedicated LUT SDAM") > Signed-off-by: Anjelique Melendez Looks to align with sdam code paths. Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/leds/rgb/leds-qcom-lpg.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c > index 9467c796bd04..e74b2ceed1c2 100644 > --- a/drivers/leds/rgb/leds-qcom-lpg.c > +++ b/drivers/leds/rgb/leds-qcom-lpg.c > @@ -2,7 +2,7 @@ > /* > * Copyright (c) 2017-2022 Linaro Ltd > * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. > - * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. > + * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved. > */ > #include > #include > @@ -254,6 +254,9 @@ static int lpg_clear_pbs_trigger(struct lpg *lpg, unsigned int lut_mask) > u8 val = 0; > int rc; > > + if (!lpg->lpg_chan_sdam) > + return 0; > + > lpg->pbs_en_bitmap &= (~lut_mask); > if (!lpg->pbs_en_bitmap) { > rc = nvmem_device_write(lpg->lpg_chan_sdam, SDAM_REG_PBS_SEQ_EN, 1, &val); > @@ -276,6 +279,9 @@ static int lpg_set_pbs_trigger(struct lpg *lpg, unsigned int lut_mask) > u8 val = PBS_SW_TRIG_BIT; > int rc; > > + if (!lpg->lpg_chan_sdam) > + return 0; > + > if (!lpg->pbs_en_bitmap) { > rc = nvmem_device_write(lpg->lpg_chan_sdam, SDAM_REG_PBS_SEQ_EN, 1, &val); > if (rc < 0) > -- > 2.34.1 >