From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D29DAC43219 for ; Wed, 2 Feb 2022 10:17:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235275AbiBBKRK (ORCPT ); Wed, 2 Feb 2022 05:17:10 -0500 Received: from relay07.th.seeweb.it ([5.144.164.168]:41543 "EHLO relay07.th.seeweb.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237737AbiBBKRJ (ORCPT ); Wed, 2 Feb 2022 05:17:09 -0500 Received: from SoMainline.org (94-209-165-62.cable.dynamic.v4.ziggo.nl [94.209.165.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id CF9E53F72A; Wed, 2 Feb 2022 11:17:07 +0100 (CET) Date: Wed, 2 Feb 2022 11:17:06 +0100 From: Marijn Suijten To: Bjorn Andersson Cc: Pavel Machek , Rob Herring , Andy Gross , Thierry Reding , Uwe Kleine-K?nig , Lee Jones , 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, Yassine Oudjana , Luca Weiss , Subbaraman Narayanamurthy Subject: Re: [PATCH v10 2/2] leds: Add driver for Qualcomm LPG Message-ID: <20220202101706.ompigtbovbz6shwq@SoMainline.org> References: <20211010043912.136640-1-bjorn.andersson@linaro.org> <20211010043912.136640-2-bjorn.andersson@linaro.org> <20211027211928.tjybwy2lokj6eoun@SoMainline.org> <20211027212709.4ma5uzy5titmgzqv@SoMainline.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 2022-01-28 18:53:24, Bjorn Andersson wrote: > On Wed 27 Oct 16:27 CDT 2021, Marijn Suijten wrote: > > > On 2021-10-27 23:19:30, Marijn Suijten wrote: > > > Hi Bjorn, > > > > > > On 2021-10-22 10:25:35, Bjorn Andersson wrote: > > > > On Sat 09 Oct 21:39 PDT 2021, Bjorn Andersson wrote: > > > > > > > > > The Light Pulse Generator (LPG) is a PWM-block found in a wide range of > > > > > PMICs from Qualcomm. These PMICs typically comes with 1-8 LPG instances, > > > > > with their output being routed to various other components, such as > > > > > current sinks or GPIOs. > > > > > > > > > > Each LPG instance can operate on fixed parameters or based on a shared > > > > > lookup-table, altering the duty cycle over time. This provides the means > > > > > for hardware assisted transitions of LED brightness. > > > > > > > > > > A typical use case for the fixed parameter mode is to drive a PWM > > > > > backlight control signal, the driver therefor allows each LPG instance > > > > > to be exposed to the kernel either through the LED framework or the PWM > > > > > framework. > > > > > > > > > > A typical use case for the LED configuration is to drive RGB LEDs in > > > > > smartphones etc, for which the driver support multiple channels to be > > > > > ganged up to a MULTICOLOR LED. In this configuration the pattern > > > > > generators will be synchronized, to allow for multi-color patterns. > > > > > > > > > > Signed-off-by: Bjorn Andersson > > > > > --- > > > > > > > > Any feedback on this? > > > > > > I asked in #linux-msm whether anything is wrong with the patterns, > > > since my Sony Discovery (sdm630 with a pm660l) blinks way quicker on a > > > pattern that's supposed to stay on for 1s and off for 1s: > > > > > > echo "0 1000 255 1000" > /sys/class/leds/rgb\:status/hw_pattern > > > > > > It however seems to be broken in the same way on an older version now > > > (this might be v9 or v8) which I don't remember to be the case. Can you > > > double-check if this is all working fine on your side? If so, I'll have > > > to find some time to debug it on my end. > > > > > > Thanks! > > > - Marijn > > > > Another thing I just ran into: on both patch revisions the colors are > > flipped. multi_index reports "red green glue", but the values written > > to multi_intensity correspond to "blue green red" instead. Is it the > > same on your side? > > > > I booted one of my 8974 devices with RGB LED and the colors matches my > expectations. Can you confirm that your mapping in the DT node is > correct? > > E.g. with pm8941 the mapping should be "backwards": > [snip] Thanks, this was indeed a mistake on my side: downstream pm660l sets blue to the first channel too, whereas I set it to red. Let's blame it on downstream mixing zero-based and one-based indices and my inability to read that :) - Marijn