Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1625489ybp; Wed, 9 Oct 2019 17:44:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaMOWi1xhj/vpsdlCIcjiVuiwCtjWQSSN2HrSx0P4ITg18wJPq5z8SmmjfchXGH3PdBJmb X-Received: by 2002:a17:906:19d9:: with SMTP id h25mr5267764ejd.297.1570668263200; Wed, 09 Oct 2019 17:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570668263; cv=none; d=google.com; s=arc-20160816; b=KZH0jEpBDlRuuiNoO7LdFlB/L7dnd+cKiM1vbPlEVdkVP99MUStVSlliy92Le7R7BB iTT68JKMR2dq8cERbhskxHrAr4TWUGOqB7E9InsiL5zrlKTGGe/cSEpsb9yMLvJeDOF7 gPbIyStyuXc93NoOrKrrkeCHpqpc/wUfruv+jwh7ITgOHdObuyeP89E/ICow1KP9PS1L IH+Zx709JHbtbNlb3YgLm4+3jNQ07Z4JlOWHBJVEleX0WYfF9cUsp44k2c6jTxwrCA6d Fufkidjq6HGANrs/00xSqmx3ML+1AiO5UxOC9Syz/7jqOMgBKL5OQWqyirZfeQqcXCFr xY8Q== 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=Yxcoi5EtNXabhjep2Y1KNRL8XZbLwiQgniLFoGc+Jhg=; b=XjxAzwNDpjKUn+0OMkNmeDxcLgzsYJfQMZNPCvVdcR1G514WC2IX/mK0FkOzLapjAb FKduLSjy0EgR80yKU6qo33ty9NILchcrrizFqyDzjwXJc8MoInVu5E3dE30+pQ12Y0BP sPfztMwZfo9U8z6+nDpkhCILHaUzZTIZsxdJ2Zx8T3e/wC0Uz3zgYyQs+SN40Qm/Pmgg C/7cIz04itSsvj91RPuRRQuw70vA9MvvI7J+UjS7IHtGaj98D9cYteoykVGq8/lBJbVf mQg9SD2DaEpzb1v8Mbgwkz+jXdHeyMpeDf9cLUb2x50h/FrPBUlRoSDsyx9XfhwFhuPV dmMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=OdyqiHvn; 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 r17si2307673edx.257.2019.10.09.17.44.00; Wed, 09 Oct 2019 17:44:23 -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=OdyqiHvn; 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 S1732454AbfJJAnf (ORCPT + 99 others); Wed, 9 Oct 2019 20:43:35 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:41122 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731542AbfJJAne (ORCPT ); Wed, 9 Oct 2019 20:43:34 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9A0hTsr118568; Wed, 9 Oct 2019 19:43:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1570668209; bh=Yxcoi5EtNXabhjep2Y1KNRL8XZbLwiQgniLFoGc+Jhg=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=OdyqiHvnQzZqyossQxz3sx4kdIAR8VUP6BgxA3SmmHqR/uxK23T0HrTnaq/cZ6A3V j5Oa4KdlAc+mCginCMsMUyWVujETpxXKj7/LAy1rCqME9es7UbdOZIRZ9VpDe7DSHm ymKMUsbpqGwQdvDCDVQ/qbCjWcKxfWXt5OPygy2s= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9A0hT2N004540 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Oct 2019 19:43:29 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 9 Oct 2019 19:43:25 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE110.ent.ti.com (10.64.6.31) 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, 9 Oct 2019 19:43:29 -0500 Received: from [10.250.65.13] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9A0hTT9004462; Wed, 9 Oct 2019 19:43:29 -0500 Subject: Re: [PATCH v11 04/16] leds: multicolor: Introduce a multicolor class definition To: Bjorn Andersson CC: Jacek Anaszewski , Pavel Machek , Linux LED Subsystem , lkml References: <20191008204800.19870-1-dmurphy@ti.com> <20191008204800.19870-5-dmurphy@ti.com> <20191009232539.GB571@minitux> From: Dan Murphy Message-ID: <1b18570f-a5ac-fb34-aed9-7d8422df7e6d@ti.com> Date: Wed, 9 Oct 2019 19:43:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191009232539.GB571@minitux> 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 Bjorn On 10/9/19 6:25 PM, Bjorn Andersson wrote: > On Wed 09 Oct 13:44 PDT 2019, Dan Murphy wrote: > >> Bjorn >> >> On 10/9/19 3:11 PM, Bjorn Andersson wrote: >>> On Tue, Oct 8, 2019 at 1:49 PM Dan Murphy wrote: >>>> Introduce a multicolor class that groups colored LEDs >>>> within a LED node. >>>> >>>> The multi color class groups monochrome LEDs and allows controlling two >>>> aspects of the final combined color: hue and lightness. The former is >>>> controlled via _intensity files and the latter is controlled >>>> via brightness file. >>>> >>> Thanks for making progress on this, it's been the one outstanding >>> question mark for the long overdue respin of the Qualcomm LPG driver. >>> But while it works for the LPG, in that it has outputs named "RGB" I >>> have boards with "generic" LED drivers that are connected to RGB LEDs. >>> So per your proposed solution we would need to add the additional >> You don't have to add the MC class to those drivers.  This is an optional >> framework but if you wanted to use the framework for specific devices then >> yes you would need to add that support. This is why I did the LP55xx patches >> to demonstrate the feasibility since the LP50xx has the MC class >> intelligence already. >> > Correct me if I've misunderstood something, but if I have a product > using e.g. lm3533 connected to an RGB LED then the correct way to > represent this towards userspace is to introduce the MC class in the > lm3533 LED driver, no? > Not necessarily.  If the RGB LED is to be used as a RGB module and not as independent LEDs. For instance on smartphones if you had that RGB module connected to the LM3533 and needed to mix colors to give different status indicators then yes you would use the MC class.  As the MC class presents and treats the module as a single LED with individual color mixing control knobs. If you were using each LED for a separate use cases then you would want to present these as individual LEDs as done today. >> The LP55xx driver can register to the LED class and/or the MC LED class >> pending on the DT organization. >> > Understood. > >> I don't plan on going through all of TI's RGB drivers and retrofitting them >> to the MC class.  I do have to update the GPIO LED driver to use the class >> but that work is still pending. >> >> I may also update the Motorola PCAP driver as well since I have a Droid4 to >> test. >> > My concern with this is that being connected to a RGB LED is not a > property of the controller, but the system design and the proposed > implementation makes it a property of each controller. > > I'm not saying that the proposed path is wrong, I'm saying that we have > 83 files named leds-*.c in drivers/leds and this adaption needs to > happen on each one. Agreed.  I would expect the adoption to be done on a case by case basis driven by usage and need. > > > And I'm not saying I expect you to do this. Phew.  I did not think you were. I will only convert drivers that I can could test. > >>> mc_class handling to every single LED driver that might be used to >>> sink current into an RGB LED. >>> >>> I also don't see anything preventing hardware designers from feeding >>> single RGB LEDs from multiple different LED controllers, something the >>> current proposal would prohibit. >> What do you mean by a single RGB LED? Are you referring to a RGB module? >> >> http://wiki.sunfounder.cc/index.php?title=RGB_LED_Module >> > Yes > >> There is no prevention for HW designers to put a driver on each LED output >> but I am not sure why they would incur >> >> the additional BOM cost seems quite silly unless you have an unlimited >> budget ;) >> > So if you have a system with e.g. 8 PWM channels on one PMIC and a > single PWM available on a different PMIC then you're saying that the > hardware guys would be silly to believe that they can drive 3 RGB LEDS > off this? OK I must have removed my question to you on presenting a use case.   Grouping LEDs across multiple devices would an issue yes but we would need a design or hardware to develop a good solution. > >> If they did design the system that way then the SW would need to revert back >> to the standard LED class as it is done today. >> > If that is the agreed upon design then I'll continue to adapt my LED > drivers to the MC class. For now this is the basic design. We are willing to take other suggestions.  We appreciate the feedback. Dan