Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp7581pxb; Mon, 31 Jan 2022 03:56:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFQGsuG9x0+/N9Ql33o8ku2kwIqq5GffrCoTPcj+vTCJ7r8/lzjcIc03Mm5+b8fGvG2ye2 X-Received: by 2002:a17:907:3f8b:: with SMTP id hr11mr17112612ejc.602.1643630202085; Mon, 31 Jan 2022 03:56:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643630202; cv=none; d=google.com; s=arc-20160816; b=eHznLcnDWPfBgInLHii4Pd/I1qaUOFoCiTgIyW0QDI9nwsBKZT/cMNNxVtLo25JAgz vaIic5NsgApfOqGWaqh7nYOgb4G5+1kdwY6M7kZXUPJi6TE+SvUz4oBDXt6pkNSraC1M UofT6+ERQc0xUuD/E8pUu8nW7jb1do3+uDwsAybWZts5++xWH6Y9biTEmGsOA9R+tJIi viv9TSba0Eg92cI+Lt1LKr3pUVlkciOa+FnDLNJcdN9T9HDqvq6L0899nD4XYMrNZxZ2 pkffrvUdmRNd9wnfOZv5fqPzCnxBt3gdSOP06boiJWEZO+j9CIuu2qaziUW52HzfvsI4 SxrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wP9GUemZjobVvElhar7UqvhZ43XmUSMFie0l7uhdp34=; b=gpXLvWqIw8/zcWhbtInv0cisNF+gxkiHbSkCjOYB/LnlZkAvrDIuqY1XfUNwwJ861r Zz/7/7pTFSZwad5zSRLwHtf7IEfY658JMMQ25pyxBNepydUZ/c/5MTCYn1PPSpi5ACPU h6PCuhuZZ1KqR8/XVvA2mZjypsbRGfuqWIuVzYlq73XU7dUXd4SgTVrLw8PPLM22ocFu DzoTJ3DOx1o0yXhuKfbQN/ly4ZhCExmSE0uaGkczfMaA/JDhXsCEP65hP7Z06qDn/6lV qJE85vhvyKmYuyz+O4gyCl6DI/X81i0W9HvZ5JS5v4i5spkw9pnF9WQmU6Y30Phr+9gT ZVXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mMl9H0qw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m13si7098997ejn.0.2022.01.31.03.56.18; Mon, 31 Jan 2022 03:56:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mMl9H0qw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243067AbiA2Aut (ORCPT + 99 others); Fri, 28 Jan 2022 19:50:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241666AbiA2Aur (ORCPT ); Fri, 28 Jan 2022 19:50:47 -0500 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA60DC061749 for ; Fri, 28 Jan 2022 16:50:47 -0800 (PST) Received: by mail-oi1-x230.google.com with SMTP id p203so15523198oih.10 for ; Fri, 28 Jan 2022 16:50:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wP9GUemZjobVvElhar7UqvhZ43XmUSMFie0l7uhdp34=; b=mMl9H0qw9/VE5m1aO1VI4YZPm4cSdMe0mM3Q2l4V1XUz9/eB0ZKNP/bYFFaNoTXCCq Gb2+GZx14nkjburIhdiga039yksG29/Xqy+EMFyFBXbTb9brMIhyntvWRT2RFU8KMwak axohOsIVOumItT87Cf3fDnf7as+Xc/uKUaVRIXY6Jd/4Qajcb2OZzn9bVS05p9zHNv7w O2gTlJblQuIQbtM0FSf9QnHWBfKzr1rHLNB5nbr7kGfX6jPyNR+0ZWoKB6hXAM3axWnx 1BB+IGZcE38YeWzvHZtY3adbMruKepDbVCuRUscZ2zLiqpxHsy3U2wBsA7vm0861LeO6 RNbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wP9GUemZjobVvElhar7UqvhZ43XmUSMFie0l7uhdp34=; b=05ZBkwaXvxIKullVcyIt+TMqsnhRMEP0l62zSzPNqMBowboSGxnYypr4px4ToSHTAp 6TkWDGBzqi3wo7vjniNqlDwPiSaPRea/qbXxS+JVA1FgcvtKtAtVfRzOilvti0ZBej9Q 8JOgFZjBylep0z4rUvwtUkTLBtaem9ZN90m1a+eCM3H6HsrvXRs+OK8X3u4cbdIHfxbm k60QJgSCWPM8aVVMBQUfCmiEEplCoTPAOZJj7dZOO+RGNIzzUkeImbjKJ43DS6Thcsvd vwpTmEcN+VB7ruGsC2yGOOLnXUXGhwZJp9AfcU81mvdyHYZjE8B8tVLMc09SR+pO251Z lsxQ== X-Gm-Message-State: AOAM531fJnqezakJwi4bwECI6PZFnHigxx+VMELpEgDghkSfikXkS6rB 7GiRVL3d886gQBMvIOjoZeOmeQ== X-Received: by 2002:aca:100c:: with SMTP id 12mr7528496oiq.147.1643417446535; Fri, 28 Jan 2022 16:50:46 -0800 (PST) Received: from yoga ([2600:1700:a0:3dc8:5c39:baff:fe03:898d]) by smtp.gmail.com with ESMTPSA id c26sm3619496otn.34.2022.01.28.16.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 16:50:45 -0800 (PST) Date: Fri, 28 Jan 2022 18:50:42 -0600 From: Bjorn Andersson To: Marijn Suijten 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: References: <20211010043912.136640-1-bjorn.andersson@linaro.org> <20211010043912.136640-2-bjorn.andersson@linaro.org> <20211027211928.tjybwy2lokj6eoun@SoMainline.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211027211928.tjybwy2lokj6eoun@SoMainline.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 27 Oct 16:19 CDT 2021, 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. > I had missed the fact that LPG_RAMP_DURATION_REG is two registers for msg and lsb, for a total of 9 bits of duration. So what you saw was probably ticking at 232ms. Note though that the pattern uses the last time as "high pause", so I expect that you should have seen 232 ms of off, followed by 464ms of light. I've fixed this for v11, both rejecting invalid input and writing out all 9 bits. Thanks for spotting this! Bjorn