Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4925917imu; Sat, 19 Jan 2019 23:07:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN4yobIGpqKSdUBDPOptWWqm5GqzmKYkFf31fUYqFPP3fxYCTKcDz0+8+IMDFDXKQXvEk7Cx X-Received: by 2002:a62:1f9d:: with SMTP id l29mr25579820pfj.14.1547968020380; Sat, 19 Jan 2019 23:07:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547968020; cv=none; d=google.com; s=arc-20160816; b=I7NoHKwwbbw5bqyTYScP0k2HV225Vdj7G4H+7Usyhgsb3WCQ7ArQS4a9WZdkwq9qCU HeEuSmrlKzPZgJmRMTy9C50VsiIQIJZfAj6+Y9PcFbSXG0ERvL0350hiDkGBKuCZ8Hbt +iIJ6DDg0NX4BBfttoq6DMi083S3oMJZfFL/0DTvBIYPzWBOkfSpvMZ53NFmqR3rqxEP z3DQa4wV6FKYRkfGOfUncP8NN2m7zNjbk+eU4h1h1eYFvmS2fxsPBWMeWRFjIniKwiiK j0EINSAhHdRYQVv9ZPDLfzx3YRmh0OiNlgzlVE7bqvNM0ZB0wC1gX6CmQGm1BGBMsXVI O+hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=bLqnWhlxHpgWfGyFlH98Wn5dIRZXafa6jshw9DETldI=; b=o0DjcHF1XaCA7mE5mw9l1Ca/bPU7BSbbelJrDmuhd8ew+bZyovcdnOj2odK/SUIlls +NWi4plqemwEk9TDvBSgKqAvpyTyof/p0wCpcWr+p9aBruqxG5U1BBGM0n6wCximPIiK 1Hr3K0870ePa1DskKE2Io7mbE4pz6Jy/auWLwtmreIvaa54Wiwxr6ISQLA/YxkV4gACs +Y8BmrU3xUzDH3yNSY5HCOvlGUdR4G8/VQG35Eywli6Q1TwHOMWTnTxqk9eLC1nj7MB2 CWDkYrZNwCPLwKYN/O3ogY+Gp7Dz1RABSNn/eMZHg929XPvUkqk76Xuou92uERfHPuzS r08w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fPU1DwTa; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si8624910pgo.356.2019.01.19.23.06.21; Sat, 19 Jan 2019 23:07:00 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=fPU1DwTa; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730360AbfATGvy (ORCPT + 99 others); Sun, 20 Jan 2019 01:51:54 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:41274 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727206AbfATGvy (ORCPT ); Sun, 20 Jan 2019 01:51:54 -0500 Received: by mail-lf1-f66.google.com with SMTP id c16so13290734lfj.8; Sat, 19 Jan 2019 22:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=bLqnWhlxHpgWfGyFlH98Wn5dIRZXafa6jshw9DETldI=; b=fPU1DwTaeEHtMd6rcNT/EBthw/u91b0+VipKMNz5hVKIJ+hscTG2VhNvT8K3NANeGE sCNAd2hDiMS/b3+zxZt53nSCOiryo3tWEXPuu9tL9xkFYL1v68m/E8N2qtYgVBTOdZ5A 6XGUppkKs800uW4jH+Z9SNQAjzipNT79M6wkKkjJOWor9mFxJDxcHhuvuZkh0euLIxG1 sqo1wLwJMa7lS8L8yUNyNfkjkfyHFZpqQuG0PvHp9GxNmG9TV5rFdh0jz2xpTL7Wjox4 zJqHy7mjOZ1hKKBXLpw+AQrkaD+c//YocZv/LcCwyyGvNhqVWHpbQBiYCCpO4Y/8Mmod M1xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bLqnWhlxHpgWfGyFlH98Wn5dIRZXafa6jshw9DETldI=; b=RBzzEwVvwgYHt1ker5FKz/Iz8xyVFvxJ9Ak9EsRCwI2jJeRH2k4JGjL5I6XXbgU/mL MyMWjurHj3UCsw1jUK58C7pv0JahRU37NpmDKXpMvg4SStbgue+ywjFhzjBuYQ4kV+p2 P7tEdXAzNeeBrfjDDcPHoPoK8XGKkAxUS4p3Y0WqKBN0wnDi7ovyyRoMkz1KrqbBm/FI Q/z3j9BEtyaWnFrn0d2UM6crrwHax2kAOUrPDN3uuCwDKFINpMfo6uNNV8a8tjGnQq8V 2nuXqsd60D5lqHOYtl5K7PNE4FHL6NNbNZMbjokoiv8BrwiqhISjjIAF6Om6KnHUDIg0 QAKA== X-Gm-Message-State: AJcUukc5K/oYGufPoNo7obo0HPoAgtqiOEiTbAIsra8PWIwme4LemXYX +G9Xp90SVczdybkoNR0uhKo= X-Received: by 2002:a19:40cc:: with SMTP id n195mr15795803lfa.40.1547967111415; Sat, 19 Jan 2019 22:51:51 -0800 (PST) Received: from ?IPv6:2001:14ba:8017:3300:7056:8bb8:4271:58c3? (dtynxhydtm6g7ttxvndbt-3.rev.dnainternet.fi. [2001:14ba:8017:3300:7056:8bb8:4271:58c3]) by smtp.googlemail.com with ESMTPSA id b81-v6sm1576677ljb.7.2019.01.19.22.51.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Jan 2019 22:51:50 -0800 (PST) Subject: Re: [PATCH v2 2/2] leds: lp50xx: Add the LP50XX family of the RGB LED driver To: Pavel Machek Cc: Jacek Anaszewski , Dan Murphy , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org References: <20190114211723.11186-1-dmurphy@ti.com> <20190114211723.11186-2-dmurphy@ti.com> <20190115222223.GA17363@amd> <79394d17-3124-75b2-ccac-dc1046499d14@ti.com> <20190116105537.GA1803@amd> <4115ad75-22f7-d9ae-c38f-e0ab61fb6655@gmail.com> <20190119214606.GA4712@amd> From: =?UTF-8?B?VmVzYSBKw6TDpHNrZWzDpGluZW4=?= Message-ID: Date: Sun, 20 Jan 2019 08:51:48 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190119214606.GA4712@amd> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, On 19/01/2019 23.46, Pavel Machek wrote: > Hi! > >>> Moreover, I think that RGB LED class with configurable >>> brightness-model, and with possible color range adjustments via >>> icc-profiles or something similar, is the best solution that has been >>> proposed so far. It is just flexible. >>> >>> I'd like to capitalize on the ideas shared in this thread and have >>> finally LED RGB class materialized. >>> >> >> I have now updated my github code with my understanding of the discussion: >> https://github.com/vesajaaskelainen/linux/tree/wip-multi-color-led >> >> Commits: >> - dt-bindings: leds: Introduce linux,default-brightness-model for all leds >> https://github.com/vesajaaskelainen/linux/commit/4ffb21d644056686096226bbede7c8c78b0254c2 >> - drivers: leds: Add core support for multi color element LEDs >> https://github.com/vesajaaskelainen/linux/commit/627f38bb78cebc694b8e6d735fb088c87925435d >> - dt-bindings: leds: leds-pwm: Introduce multi color element leds support >> https://github.com/vesajaaskelainen/linux/commit/ef6c5730d621e79ea0b02470caa83bc39439536a >> - WIP: drivers: leds: leds-pwm: Add multi color element LED support. >> https://github.com/vesajaaskelainen/linux/commit/0430a27823d9162926424b32c23be1c53eb9cbe2 >> >> First two commits are common and could be taken before I am happy with the >> pwm led driver changes. This new conditional feature flag makes it a bit >> harder. Of course one option would be to require it to be enabled. >> >> Current set of concepts: >> - brightness-model: hardware, onoff, linear >> - could be extended in future with other modes like hsv if wanted > > Would it be enough to tell userspace what is relation between values > it writes and output power? > > Onoff is subset of linear, I guess. We already have max_brightness in > the API. Btw. there is slight problem with led trigger framework which is kinda visible with "onoff" vs "linear" settings. If you configure color like: echo onoff > brightness_model echo 32 0 32 255 > color You get not so bright pink color. And if you then enable blinking: echo heartbeat > trigger Then it blinks with not so bright pink color as expected. However if you do it: echo linear > brightness_model echo 255 0 255 32 > color You once again you get not so bright pink color. However when you enable blinking: echo heartbeat > trigger Then it blinks with very bright pink color. Reason I believe is because trigger uses either values 0 or 255 for brightness when controlling. To fix the issue I believe trigger mechanism should be adjusted to allowing one to control ON brightness level. I would recommend fixing this trigger problem with future patches for it. Thanks, Vesa Jääskeläinen