Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3794144pxy; Tue, 4 May 2021 10:02:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1SvYv8IjslEfftqab2Suv9/yBDCGkbLfYkvysuv2q8GWpvFd0jM7HGnuUmbgKsFQQcRTh X-Received: by 2002:a63:5723:: with SMTP id l35mr23697512pgb.111.1620147731217; Tue, 04 May 2021 10:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620147731; cv=none; d=google.com; s=arc-20160816; b=typPv6JDlSMaV0bbBAneFHCLnC2IY97KLLbDRN8RhOdrH+Yq+zVZMkiSsuPKq9R5xX PsDi+ofhUCNHM8O93VUuYBCnQQqd82PWT6T9xuELB2WiJFpIUF5WygxDkAuzws8jWBRK P3953eLvd33sjOegZE2ApYYOU20Jy1XDtZUME3npz00DwURss6LNeWT8tAHdorXSyifK Ph45mGc/z4cRiXoz7Lq7OkL7nM9IrKikYi45+b39zGVxNkph6b6sIreemXTBfGfz483V D5ORemxy92/4wZestKuj+UXnNXfogmOmpTaEIMt7RP85M+nOl52eHzmV5DQqW4D9OP8q i1YA== 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; bh=Ebrk0JDYCF1zKOVvsTE4HxynpUJwqpcQL3pc9XEdYJE=; b=R6nSiiakUfSqGbMJ/mPjrBuHR19lxWf2ws+J6kVzdMG3wIjU/4BurEjL5PcZZbB1Vf r2a9tRxJ/kLqBL8wsGWmiHUJkq5X9vmOIPR0gJ2q0BfAevfkzkaUwe5raifc8Oli05Lr Rf1XZPvRvrbggkCEXBUUyfdPZatywEWGaFG3LpjtdFlxinjbVdpEfHdD9tEXfq/al/so cD1JnMECkOYxFhm7yGKn1w0R/kx+8JYNTmYHz57BiRvUp45TEV67l27YxZwpcswnZ6CL smr146jvS54LAwom7DXS6f/+webpGsWEuiwHv/toBcnHK+JvHu15u/gFV0IlaSTHd7EC EoDA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si2149723plx.183.2021.05.04.10.01.57; Tue, 04 May 2021 10:02:11 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231381AbhEDPoD (ORCPT + 99 others); Tue, 4 May 2021 11:44:03 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:48860 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230512AbhEDPoC (ORCPT ); Tue, 4 May 2021 11:44:02 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 878731C0B87; Tue, 4 May 2021 17:43:06 +0200 (CEST) Date: Tue, 4 May 2021 17:43:05 +0200 From: Pavel Machek To: Bjorn Andersson Cc: Dan Murphy , Rob Herring , Andy Gross , Thierry Reding , Uwe Kleine-K?nig , Lee Jones , Martin Botka , 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 v6 2/4] leds: Add driver for Qualcomm LPG Message-ID: References: <20201021201224.3430546-1-bjorn.andersson@linaro.org> <20201021201224.3430546-3-bjorn.andersson@linaro.org> <20201029181357.GE26053@duo.ucw.cz> <20210429211223.GA5480@amd> <20210429212920.GB2484@yoga> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210429212920.GB2484@yoga> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > > One such example is the laptop in front of me, which has 3 channels > > > wired to an RGB LED and 1 channel wired as a backlight control signal > > > (i.e. using pwm-backlight). Another example is a devboard where the > > > 4 channels are wired to 4 LEDs. > > > > Ok, so this is actually important. In this case you should have PWM > > layer, exporting PWMs, and then rgb-LED driver that takes three of > > those PWMs and turns them into LED, no? > > > > And ... surprise ... that is likely to help other people, as LEDs > > connected to PWMs are quite common. > > > > Hmm.? > > > > If you can't do this for some reason, you should probably explain in > > the changelog, because this is going to be FAQ. > > > > This is exactly what the downstream implementation does and in the case > of a solid color LED this works fine. > > But the hardware has a shared chunk of memory where you can write > duty-cycle values, then for each PWM channel you can specify the > start/stop index and pace for the PWM to read and update the configured > duty-cycle. This is how the hardware implements pattern support. Ok. > So downstream they have (last time I looked at the code) an addition in > the PWM API where the LED driver can inform the PWM driver part about > the indices to use. Naturally I don't think that's a good idea. Dunno. Is it bad idea? pattern support for other PWMs (vibration?) seems useful, too. Yes, it means more discussion and extending PWMs properly.. > Additionally, representing this as individual PWM channels means we're > loosing the grouping that now comes from the description of multicolor > LEDs, which serves the basis for synchronizing the pattern traversal > between the involved channels. Yes, keeping grouping would be nice, but perhaps pattern API for PWMs can do that too? You can have solid-color-only driver now, with patterns being added as discussion with PWM people progresses... Best regards, Pavel --