Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1538285rdd; Thu, 11 Jan 2024 02:06:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJjn8UoBn3UMUog5olVtao+vedHMZmM30WS+zEh5aiUVBbWOlcRR7lPnXqWafKKQD6mRDB X-Received: by 2002:a05:6a00:2304:b0:6d9:b5ba:7802 with SMTP id h4-20020a056a00230400b006d9b5ba7802mr1200446pfh.26.1704967607599; Thu, 11 Jan 2024 02:06:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704967607; cv=none; d=google.com; s=arc-20160816; b=BgkbeitEg/yViO1+2D3u1f5mu6isEdaU7FO4d0fB2yWD+sDO3LjzzzvU0tXM1552pU WoPGGmqMzvQP/SYBYTejiuzf+KdUkLPZ7U6tj18P43pfNzkw4eVwyQLAE7mTxcmzdZL4 58dtbLKroTuRJNgNBq5gmm85qUe28dpvza26IRgKyDWQDFeYrB6WT7nGI0JwzCHL4wQE Ohr/7E1IdsIpLRuOAJGoUPMHuvd4PNv8jwgkg/Mh5W1Z1W+kjdisnIJL04tIYAgKNb4u Iz3MKOPIB0CS9NAxaGGBqN9WxQznT5wUKWyvhxbKWGO2HlLxogVHgvhKJxVpA+g5/IbL dm+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=styMETXZVBUSR1b52NRuSJ0HJ6aBh7wiAWTpjwFIYiA=; fh=Q0JpVfPEZhMiWKgkq1SU/2iPe5ydYttTSZwNuIs4ezE=; b=bBeUoifV1Cv1TABnO3hryYpNEZLdeeLgNohUP7744hPjAOsPC/q5A0mGxy6xHJGUZc +Fk6FusCwtdxhjSb82OOoXfn/yMtP+fM6FtBSbdWA3VvAHc7j/M9pm5e8OcvTyEL3deS KQpVYDRS2Txw0o8/BolVxEEKoUKGQmI9wk7D4K8RfmovHEoIvM3h0U1qu1UlZh5avvZD 9rSCjcm4bWzCWxo6DYbCZ2Ft7TBXGSR5YeNpESG0yzm8iGsUZ8OfHegPLzUdx9V+zJXn dG2t39e2WPsaMbD9EaAKYB1vaE5O+5vJj2BE9t/tZgMG1avBaWMiVxExbz0OPVnOIQ6G SigQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bSH8f5B6; spf=pass (google.com: domain of linux-kernel+bounces-23358-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23358-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 lo4-20020a056a003d0400b006d9915f3658si721217pfb.199.2024.01.11.02.06.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 02:06:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23358-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=bSH8f5B6; spf=pass (google.com: domain of linux-kernel+bounces-23358-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23358-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 45543283408 for ; Thu, 11 Jan 2024 10:06:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22DF312E5D; Thu, 11 Jan 2024 10:06:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bSH8f5B6" 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 418EE12B76; Thu, 11 Jan 2024 10:06:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24D68C43390; Thu, 11 Jan 2024 10:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704967597; bh=VYrd9TK5vSZv+DQia/igxBL3YVo83ir67Ef6elbaMrg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bSH8f5B6Cz0YR+iTIx3EPz7hnVD09H687f1+CsbVoZyclMuBnyTNTjsJlQKoAS7VF +rSapP8GHDNP63b25oeHq0MkgHNwaesLSSNyFyi7RXsNHirr/5b5wD5s1KfFe0YYFf Nldq23YFUNQvRb9CMzd359iP/X1jAIOXmoJgNYLpV+CB1B9pOvIz0DQ6LAIfnNTVLJ a7mK7sA2GmsnS+D9xnGHrNw+xxhLeLsegoAs4RFNMDUtOYKz6VAAkERNxWdMF0Ii0H 4mm9t+eZvtbWSN0HxGkbHs0mUl6Hq8W1p8uoF7bK7AnKZWmYcfZGQU0pwgY/jxOtDA Eju+eJdwEquOA== Date: Thu, 11 Jan 2024 10:06:31 +0000 From: Lee Jones To: Anjelique Melendez Cc: pavel@ucw.cz, thierry.reding@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, agross@kernel.org, andersson@kernel.org, luca.weiss@fairphone.com, konrad.dybcio@linaro.org, u.kleine-koenig@pengutronix.de, quic_subbaram@quicinc.com, quic_gurus@quicinc.com, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pwm@vger.kernel.org Subject: Re: [PATCH v8 4/7] leds: rgb: leds-qcom-lpg: Add support for PPG through single SDAM Message-ID: <20240111100631.GL7948@google.com> References: <20231221185838.28440-1-quic_amelende@quicinc.com> <20231221185838.28440-5-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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231221185838.28440-5-quic_amelende@quicinc.com> On Thu, 21 Dec 2023, Anjelique Melendez wrote: > In some PMICs like pmi632, the pattern look up table (LUT) and LPG > configuration is stored in a single SDAM module instead of LUT > peripheral. This feature is called PPG. PPG uses Qualcomm Programmable > Boot Sequencer (PBS) inorder to trigger pattern sequences for PMICs. > > Signed-off-by: Anjelique Melendez > Tested-by: Luca Weiss > --- > drivers/leds/rgb/leds-qcom-lpg.c | 268 ++++++++++++++++++++++++++++--- > 1 file changed, 244 insertions(+), 24 deletions(-) > > diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c > index 68d82a682bf6..a76cb1d6b7b5 100644 > --- a/drivers/leds/rgb/leds-qcom-lpg.c > +++ b/drivers/leds/rgb/leds-qcom-lpg.c > @@ -8,11 +8,13 @@ > #include > #include > #include > +#include > #include > #include > #include > #include > #include > +#include [...] > +static void lpg_sdam_apply_lut_control(struct lpg_channel *chan) > +{ > + struct nvmem_device *lpg_chan_sdam = chan->lpg->lpg_chan_sdam; > + unsigned int lo_idx = chan->pattern_lo_idx; > + unsigned int hi_idx = chan->pattern_hi_idx; > + u8 val = 0, conf = 0; > + > + if (!chan->ramp_enabled || chan->pattern_lo_idx == chan->pattern_hi_idx) Nit: you can use lo_idx and hi_idx here instead, right? Please fix this up subsequently. -- Lee Jones [李琼斯]