Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2316876pxb; Thu, 3 Feb 2022 04:11:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzoAph1meyrJkv284k196LAQfWfMBO2izzzvFDD89hC71QSH1sPFo1PDJfOU9q9bz4BnKsy X-Received: by 2002:a17:907:7246:: with SMTP id ds6mr29324961ejc.212.1643890273364; Thu, 03 Feb 2022 04:11:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643890273; cv=none; d=google.com; s=arc-20160816; b=lmgv+uh5HGD7+oOZkp1bqzxlPnPfjyPKG0uefCOLgqEgZnwaJShfqQOS8lU03C7ixV M+b6a4ZkmMZuUqRAf3rb2ksB9dM78IXBccgc2p5agTJ96VJbhvYNAIwOAy0ZUmg2bsyB j5RAqhM6X1RXagPusnQATLT5VXqHAvtwYZEWVq5Aqpnd/g1oeHwkDeCwqov4Q4RlFU5E R+I/kvlsczw1LRMiUbl5J6u9IsoktR4MqDevuyfswDmrcw/R8AboRydoZ4udKosXWeYi 4ia26W4BVihmAnyWSX0feTJXK6tzgBfgdlIU5JUVgcQlEoElb2YGihaMFYqcX2GHMGrq v4dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HlraHmNgdumj40y+Vxj8nJOCtHX98SAfTtbNfZ64dtc=; b=ihleWcSSauGeCRu8u+4hkx/I+vvDa33WHAw6YjsvRikzvCgrhWFiXyiA1Bha+J/yLP VYwgaAkPUwzSnP7RR9zUGDDfg81L8WO3oe3m5dn8oCOsLcu/oacQM0rionTN6A91uVMu QT0aT3xxO79mfBOix9idB/idRdUCNDfIqk0ljl+vUcLGAEV/Q6kb2fZawTC6tZN3xHbB 5Frae1gFk6eeQk3yJNp8DxvegUQoLrBgCfSUydeO7A9+CzVbsXCTx9MTY6wsanECkyXB Lb0m2B1T/mb6N4xcXNL/lkledb0Rstj416sr+4Yv+PFk/HFc8BRIBL+Mr5seCiGPtAZJ XTNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yWO2Xpa2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs37si14014810ejc.870.2022.02.03.04.10.47; Thu, 03 Feb 2022 04:11:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yWO2Xpa2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235073AbiBBWIo (ORCPT + 99 others); Wed, 2 Feb 2022 17:08:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232511AbiBBWIn (ORCPT ); Wed, 2 Feb 2022 17:08:43 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BF99C061714 for ; Wed, 2 Feb 2022 14:08:43 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id n10so1443800edv.2 for ; Wed, 02 Feb 2022 14:08:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HlraHmNgdumj40y+Vxj8nJOCtHX98SAfTtbNfZ64dtc=; b=yWO2Xpa2CCWLLJb5WHskpjn5ZNPJ/SJ+AOhMyUg5xDbi75ZZhWweuQFle7wYLU4M8D fvyHZSTOE+nAgE9ATzz7pArYZV4gxHZhHzKlHiDXUgXFcOlYCojCjCGlpirLz4MGUhDQ MURclDksMefKRG8nXCl9XVfWTzeD20uzS6M/EzsF1ljdSgzEkmr5DpjVVq8Ca+rTUe9q WhXFwcSNP/efg0S9o+bEOQmnIFtWelEWRhlr7iJYNcAodLqZS+583KP/lhXLlKnZRQE9 TWPsmQyj4c+34zeOudEqMi4j9H0RPJn03T1e7v2bD0xzjLD6PGOE6adR1FZsuuyFnYBM zfXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HlraHmNgdumj40y+Vxj8nJOCtHX98SAfTtbNfZ64dtc=; b=du2PvfTxU2CSL0CMvguQut7U45RtIi1il9YUyCEZnAFHzz8p/IfQ+96hcMMUIdm2nE k9+FpogRtvRZKb0evs2tmm/qCoWkSDWw1VecIR5/3tV4t19xoks3IIENb5NFXHO2GS2d jwkejbzUZoaSEuKnwx17HbqwAPhjdmYMBGOQEZ6I/CwxMQqwwUqxwSET2836Wd+IPaaa 3RDh3SvT9Wmhobyi4giskzuC0BPqHlgQjah0W5i/Ntlik2jXSzN7WugqQ8rOsI3jsHIY ZZuSKru/w7sd7Ex5b48g3PZwP7RL1iVMwujn+LUX/QK9h08PpP/AlS15US0tHGtMpWYu iNDg== X-Gm-Message-State: AOAM533u1FQ5oLL3ee1pzOn4j8l5WaNNpkZIdfngnJTc7jlaSxFNF8sU Uy1+N7yu4f3XiUu1Vds+dvHpLB9VGRYfuU6OB3QcjOj+BiI= X-Received: by 2002:a05:6402:50cf:: with SMTP id h15mr25388003edb.102.1643839721825; Wed, 02 Feb 2022 14:08:41 -0800 (PST) MIME-Version: 1.0 References: <20220129005429.754727-1-bjorn.andersson@linaro.org> <20220129005429.754727-2-bjorn.andersson@linaro.org> <20220202111833.ibeq3udj37dkfv6l@SoMainline.org> In-Reply-To: From: Bjorn Andersson Date: Wed, 2 Feb 2022 16:08:29 -0600 Message-ID: Subject: Re: [PATCH v11 2/2] leds: Add driver for Qualcomm LPG To: Marijn Suijten Cc: Pavel Machek , Thierry Reding , "Uwe Kleine-K?nig" , Lee Jones , Satya Priya Kakitapalli , Luca Weiss , Rob Herring , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 2, 2022 at 2:04 PM Bjorn Andersson wrote: > > On Wed 02 Feb 03:18 PST 2022, Marijn Suijten wrote: > > > On 2022-01-28 16:54:29, 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 > > > > Reviewed-by: Marijn Suijten > > > > There may still be some things to improve based on whether lo_pause > > works in non-ping-pong mode - to alleviate the requirement for the first > > delta_t to be at most 512ms - but this patch should not be delayed much > > longer and that's perhaps for a followup patch. Same for my request for > > documentation and examples which at the same time serve as some form of > > tests to see if everything works as desired. > > > > I've been considering lopause to be the value before we start the > pattern, but I think you're right in that it denotes how long we should > hold the first value. > > So I think it might make sense in the predefined " > " scheme to use first as to calculate lo-pause. I think > it has to be calculated, because the first value will iiuc be held > for (lopause + 1) * delay ms. > > > I also vaguely remember other (downstream) drivers to support more than > > 512ms per step by (drastically?) changing PWM period, but not sure how > > that worked again nor if it was reliable. > > > > Thinking about it again, while 512 is the 9th bit, we should be able to > represent [0..1023] with 9 bits... > Sorry, my mind was elsewhere as I wrote that. [0..511] is what we got. Regards, Bjorn