Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1553674ybj; Fri, 20 Sep 2019 12:20:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiNof3ZQHOgJqODpK/QgdD2eOF8vhmVg3eI163pzyYp1HH+e1LHmSSvplidYZQ3HcUg/sj X-Received: by 2002:a50:a8c5:: with SMTP id k63mr23705351edc.122.1569007253743; Fri, 20 Sep 2019 12:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569007253; cv=none; d=google.com; s=arc-20160816; b=PqliLiBZuH9SgmTuFp7xyWdDY6UqFpwdVjxaE+54Snlx1CDHwH6dVLQyEnXqlEhpkx IUdLNxWO0cwiInOEmML3CB3B6qsGCHAL++VXeBmsokOnYNpi9TEBrFLUdBDcgsb3s5Ng tQYGQ8BDq/oyE+FzL/wn9tLNxW+RU8y/w8/nHxUccuoTKHkoqKu1l1rw45T8lA9yM+m4 iDJD+29wKum6MrymPl5tQL9Qs0ZX6ZlyRY+/0sBPrbgnSSpayq57iaqET6C+uVEJUAcE b4q2IWd0GJ7W3JULB0M7sjCoKKdlhPIqywZDySgbRMnFMucEanE7KDyLulIfx2V9umE7 JPGA== 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=nE9H3GYPX50OkTC4fJZHCfiqTllBS2vIxWYseW0TEsE=; b=suOXqZ4DW4BkoT6Sh2G16qk5IvaARbKgaebMx5qmi8xzoYriEb0zOBwepmKWtxQ0XJ aunUTd6/LneJfwRmcd5l4V44V8we3aHR/ZTAQTfjFjcRWnGqyqChI6mBs5EwLEc2raZ6 Eg72+e8AMtjLHcyIbemFHyQzPZIQuYutzpevZtxV8MWPTLNgq8Lwkchm2OQghj82K6bW HNTAn6P+izhuArpRxOxq5sOcaMUmXm7aSzHd30AQOxTBa2VuN9mBARDUzw6rV/YkEKwF 7+zFL6A2AzoyENxD1+wXu/WoQYFtjA6MEG8hME3HvODW6Z1hIQ0luqEpJU148KutNDNe 7OMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JOzlTELD; 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 e21si1765765edb.164.2019.09.20.12.20.29; Fri, 20 Sep 2019 12:20:53 -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=JOzlTELD; 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 S2408988AbfITM2g (ORCPT + 99 others); Fri, 20 Sep 2019 08:28:36 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:42216 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406113AbfITM2g (ORCPT ); Fri, 20 Sep 2019 08:28:36 -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 x8KCSXIN097923; Fri, 20 Sep 2019 07:28:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1568982513; bh=nE9H3GYPX50OkTC4fJZHCfiqTllBS2vIxWYseW0TEsE=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=JOzlTELDzsMA0j69dhIVDLNifj5dO5caECg+SaYHU8VBeFMKDVtx18TfkQP4zwW9r 0eP4IPV+erKNz2LUHLNcDYri8BS9q/7wso8M3UJQHx9wj99QKrWkXoT+VHKyNGASt2 IAyW3XxD0xFmk5opr6jrDFK7DDdFWJ/Megy9QxBk= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x8KCSX1M007557 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 20 Sep 2019 07:28:33 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 20 Sep 2019 07:28:29 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE105.ent.ti.com (157.170.170.35) 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; Fri, 20 Sep 2019 07:28: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 x8KCSXtQ027841; Fri, 20 Sep 2019 07:28:33 -0500 Subject: Re: [PATCH v6 6/9] leds: multicolor: Introduce a multicolor class definition To: Jacek Anaszewski , CC: , References: <20190917175937.13872-1-dmurphy@ti.com> <20190917175937.13872-6-dmurphy@ti.com> <045e1988-176c-b5ea-73cb-182b6210a3db@gmail.com> From: Dan Murphy Message-ID: Date: Fri, 20 Sep 2019 07:31:44 -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: <045e1988-176c-b5ea-73cb-182b6210a3db@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 Jacek On 9/19/19 4:32 PM, Jacek Anaszewski wrote: > Dan, > > On 9/19/19 3:07 AM, Dan Murphy wrote: >> Jacek >> >> On 9/18/19 4:27 PM, Jacek Anaszewski wrote: >>> Hi Dan, >>> >>> I think Greg's guidance clarified everything nicely - >>> we will avoid sub-dirs in favour of prefixes >>> to *intensity and *max_intensity. >> Yes I will make the change accordingly.  It will simplify the code. >>> Before you will send an update I have some improvement >>> ideas regarding the remnants after the previous approach, >>> where single color intensity update resulted in updating >>> hardware state. Now the update will happen only on write to >>> brightness file, so we will not need color_set/color_get ops >>> anymore. >> I left those call backs in specifically for the LP50xx. Otherwise the >> LEDs are only updated when the brightness file is written. >> The LP50xx has an engine that performs the intensity computation for the >> specific LED.  So there is no call back to the MC FW for calculating the >> intensity. >> >> The brightness and intensity are written directly to the device and the >> MCU in the device does all the computations so you have real time update. > You can still handle that in brightness_set op. You need to compare > which color channels have changed and update them in hardware in > addition to setting LEDn_BRIGHTNESS register. > > And yes - even updating a single color will need two operations: If we kept the ops then the LP50xx device would only need one operation to the led intensity file to update the color. > echo 231 > colors/red_intensity // only cache the color in MC core > echo 100 > brightness // do the actual hw update And this is the way the LP55xx device works now. > > Note that brightness value doesn't have to be necessarily different > from the previous one here, but writing brightness file will be needed > to trigger the hw update. > >> For the LP55xx device the LEDs are only updated when the brightness file >> is written. >> >> I think we can leave those call backs in if device driver or product >> development teams would like to use them. > I'd not do that - it will be confusing. We can accomplish everything > in brightness_set{_blocking} op. It will have also the advantage of > same ABI semantics across all devices. Otherwise we would need separate > documentation for devices like LP50xx. OK I am not going to argue this I will just remove the ops even though I don't agree. Removing the ops will just make the LP50xx driver more complex then what it needs to be. I will post v8 later today. > > I have also another question - what with linear vs logarithmic > LP50xx brightness scale? I think we should make both options available > to the userspace. I have no requirements from customers to provide this scaling. It can be an enhancement to the driver later if we get the request. Dan