Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7229031ybp; Wed, 16 Oct 2019 05:49:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLd7p3pMwo+N2M6hO3//kbMO9SHwAi+nAiv8sgSFmvpZ9pYphmbFYqoal59VeGxfh8zh9Z X-Received: by 2002:a50:b966:: with SMTP id m93mr38794010ede.228.1571230198740; Wed, 16 Oct 2019 05:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571230198; cv=none; d=google.com; s=arc-20160816; b=khOMBGo5qOanlODd439JHs2fq05TPwyL4ro/z8sqHaGBk+AThRSU17JiHQQmneEMt0 vR+AVByuQ/NOb3QHR7dwkFChkP1kJ/SHHxXGTo0fcfpWZuIYgyQXtO9U/Vl+fwjFA6im 2sQM8+cP67kOfkLZ+U6ZFCiXicilKdxvegtDKjKaBjsHV4D1VBj+iOnsoZa/UaUbgDPo P2HaZJrfIeaw+mypUNLWVFCj3ergf0io251HUSXD7/x4aGFIWqg08ug1M1uNnrD7CYMN 3waR73XtnW1XwX/6ikQ9AhKo3pR/jQroyl/vzgjkk5eNzVgnDbDQK7LOINyt/SsVQhpY 7iiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=vvfizoAV18jYY7G0TZ4BBB9EIjhmzo2BOaH86imNQVs=; b=Fuhe7x0Sq+/7bhPN/Uw8Lo1A1YcRKPQhhf3xFwUqNE8T/b2To69+Va0ulOJ/ndhTRm C9avEgsMoju0AjYsBjCZ3LD3GX759kGOK6nDGb/oiQXnYAhH6VK7uwH+gyd38FvW9Iz0 9gsRstZWB7INGJzj9BsbtVvJs3AwDwSBxv1A8l9DV2ICm88Ru1eDCXZwgJ6/+dhsLXbD 9bsT3mmLsbN44yX5OuSuqBH0aTcbCx2CoNbAEOfLNQtJ3N0lOjTBW7I8mXYHl6EA9bOd CUdMQI9iUNuDgNwE1SjuWP+5qcs4NqI/1BpqtnKYy60Tvq3E1Yyg2wCqF4CCqWVg4w7b WCqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=bTRLib9n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay6si7105141edb.377.2019.10.16.05.49.35; Wed, 16 Oct 2019 05:49:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=bTRLib9n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389372AbfJPIOC (ORCPT + 99 others); Wed, 16 Oct 2019 04:14:02 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:41374 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727050AbfJPIOC (ORCPT ); Wed, 16 Oct 2019 04:14:02 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9G8DvjU130553; Wed, 16 Oct 2019 03:13:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571213637; bh=vvfizoAV18jYY7G0TZ4BBB9EIjhmzo2BOaH86imNQVs=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=bTRLib9nFNL33USrLAuq5kETjmb88wk1GI//n07zVRuwFr7JMeYcyFoBWgpD3TQXM ClwWfa22P3rZ3y4ufFgYm3zsf6K1T8IrruDZunl4L3tmZHetCparfmzQkQxSWRP70j tRQ4c4KnYjuzw78v7UtZjQA8/0HNxRDC+h977udE= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9G8DvkX080531 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 16 Oct 2019 03:13:57 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 16 Oct 2019 03:13:57 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 16 Oct 2019 03:13:57 -0500 Received: from [10.250.99.146] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9G8Dtd6016253; Wed, 16 Oct 2019 03:13:56 -0500 Subject: Re: [PATCH v5 3/3] leds: Add control of the voltage/current regulator to the LED core To: Jacek Anaszewski , Daniel Thompson CC: Pavel Machek , , , , References: <20190923102059.17818-1-jjhiblot@ti.com> <20190923102059.17818-4-jjhiblot@ti.com> <3e648fab-638f-4aa0-dda9-8ddba6562751@gmail.com> <20191013120937.GK5653@amd> <20191014123849.fhvmqn7dyu6bminc@holly.lan> <939cf695-b955-da01-2a2b-3b5ce0dc3660@gmail.com> From: Jean-Jacques Hiblot Message-ID: <5e4ad085-4091-2c43-4001-3378076fd455@ti.com> Date: Wed, 16 Oct 2019 10:13:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <939cf695-b955-da01-2a2b-3b5ce0dc3660@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/10/2019 20:48, Jacek Anaszewski wrote: > On 10/14/19 2:38 PM, Daniel Thompson wrote: >> On Mon, Oct 14, 2019 at 12:49:07PM +0200, Jean-Jacques Hiblot wrote: >>> On 13/10/2019 14:09, Pavel Machek wrote: >>>> Hi! >>>> >>>>> I must say I'm not a big fan of this change. >>>>> It adds a bunch of code to the LED core and gives small >>>>> functionality in a reward. It may also influence maximum >>>>> software blinking rate, so I'd rather avoid calling >>>>> regulator_enable/disable when timer trigger is set. >>>>> >>>>> It will of course require more code. >>>>> >>>>> Since AFAIR Pavel was original proponent of this change then >>>>> I'd like to see his opinion before we move on to discussing >>>>> possible improvements to this patch. >>>> Was I? >>>> >>>> Okay, this series looks quite confusing to me. First, 1/3 looks >>>> "interesting" (would have to analyze it way more). >>>> >>>> Second, 3/3... So we have a LED driver _and_ a regulator? So yes, the >>>> chip driving a LED is usually ... voltage/current regulator. What is >>>> second regulator doing there? Is that a common setup? >>> This is quite common with current-sink LED drivers. >>> >>> The setup looks like this: >>> >>> +-----------+ >>> |           | >>> | Regulator | >>> |           +------------------------+ >>> |           |                        | >>> +-----------+                      __|__ >>>                                    \   / >>>          +---------------------+    \ / led >>>          |                     |     V >>>          |    Led Driver       |   --+-- >>>          |                     |     | >>>          |                     |     | >>>          |                +----------+ >>>          |              \      | >>>          |               \     | >>>          |                +    | >>>          |                |    | >>>          +---------------------+ >>>                           | >>>                        +--+--+ >>>                        /////// >>> >>> >>> Only the regulator usually does not supply only one LED. >> Given questions have been raised about the complexity of the change I >> wondered whether, for a system with this topology, the regulator >> could/should be enabled when the LED driver driver probes? > And this is how are doing that now. > > Moreover, just after seeing your ASCII art it has become obvious to me > that we can't simply do regulator_disable() while setting brightness to > LED_OFF since it can result in powering off the LED controller, which > would need to be reconfigured on next transition to > brightness > LED_OFF. That is a problem only if the LED driver is powered by the same regulator, which is not the case in the diagram. This series make sense only for boards where LEDs have a dedicated voltage rail or can be modeled this way. My use case is a LED panel driven by a LED current-sink controller that uses both a PWM-style control for brightness AND a active-low enable pin. If the enable pin is not HIGH, the panel is never completely dark even if the LED brightness is set to 0. I modeled this switch with a fixed-voltage regulator  which is a common way of doing it (it is after all how this things is done inside the panel). JJ > It looks that the idea is flawed I'm afraid.