Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1462779imj; Sun, 17 Feb 2019 06:28:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IZYDxYw7XFhsXVB6M6rkGmndk9nv9bNXCSKaXbOWfjLlQV3lWUZMhStAe3DJyoe7+42WPkj X-Received: by 2002:a65:6242:: with SMTP id q2mr14479436pgv.245.1550413729983; Sun, 17 Feb 2019 06:28:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550413729; cv=none; d=google.com; s=arc-20160816; b=oqoG4IqaPZ2qI+H0A7+Q2yVQBB9r+3ZPiSbfgCBHXDc2usvM9NFpm662HEc1IDu70M WKx0ueNRtNTz+UJJ8EZs5uJSGhmshwkxPup6PLJzTa3mGI93RYT+ImSPG+de1sfrKrtl tcxr8Q7HiuFRPr2Evj4FYZQ1q+0rpVb0EPKE9IldvjUydYn6+fU+n8vs9D5x3RxqcZHd JcA45ge0sAq+vABnmVaJDdvmnwpu83td0e7/UU2EiPurmzpjHS5rlB51agN+aLQk+mop HHhV0cm7HLGy4SHU2ib7S9gvfyHOIlUeJdq79eBJQNIS6Ap3HpQjSma12CJvzkHMEBb1 xMxg== 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; bh=//ZRWvJyweKhrIvvexvNM7vmeuBsg2ofT5HEXjevDhU=; b=szOQkfzg2SvSq3H5Rme+oL0/+SHIhAGdb91pkmUxNbEPuSYQhVDeIRJ2RWygD3hO3I WcqLq7qtN74ipcVufw5RAG7dTlKSNVqy9fXMSYFiIGCFDFdxLDXQmC/+0TmIqwRix5rm W1C7b1FLku8xEHSRQx2FHv2ZfeW1YQ6oESCmGqU/VJZNjEVt3zIkyXRFjrPegffrMSTN /NuKKSORIRBmX6PqLVbJ7sEBl8nrcB/MYfyvF4sXaIpuQU2EuMACaoBWIow4hFybVese y0kR1Mb9FaKQMt+VETN2hAZxmT197cm/HCb3UV0j61q8h5u8p/gb66Bcs0s/1QhOfJL/ FaoA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cg1si5901085plb.124.2019.02.17.06.28.34; Sun, 17 Feb 2019 06:28:49 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726895AbfBQOKx (ORCPT + 99 others); Sun, 17 Feb 2019 09:10:53 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:33249 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725795AbfBQOKx (ORCPT ); Sun, 17 Feb 2019 09:10:53 -0500 Received: by mail-ed1-f67.google.com with SMTP id a2so11671276edi.0 for ; Sun, 17 Feb 2019 06:10:51 -0800 (PST) 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=//ZRWvJyweKhrIvvexvNM7vmeuBsg2ofT5HEXjevDhU=; b=gSUuplUEAJw1vpcY5aiyviZ6xyAvnlr+sxXggBunU314RlliidG4bfxL7aKS7BUyM8 IIeNtxc9cD3LKWTn4EP7R9M1W3j8ZTpOPMImDA1f5G2NSDfkoy2+BmsgLwH5GumijN3c 8giGa4fb5slJTWBSxvU1dyR0lp2PqNLrUVg52EK11Ek7x3ctVH1kHGHpz13RuCKbbYXX zBH6Mr76t3RgAKfQsoOany5E1XfC37oPdH2qXg6uSOKD9gQZzwvQWUwDnhrkV75svVoc BNPiVFCv8XNntpv4vjqclHIiQL/WgTeZU3izkPlc4c7PF91b8OFsNViXzJ3EUKRszP9+ vONQ== X-Gm-Message-State: AHQUAubEZtgpYXbiwnAGvjVTk0aD8jXXne/F8GZjFeeZS0axjxEGQWHV 1bOCPWQq02V3cYYeH/io2cfi++ZiBVw= X-Received: by 2002:a50:92cb:: with SMTP id l11mr15058571eda.25.1550412651112; Sun, 17 Feb 2019 06:10:51 -0800 (PST) Received: from localhost.localdomain ([62.140.137.151]) by smtp.gmail.com with ESMTPSA id x2sm1967913eji.15.2019.02.17.06.10.49 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sun, 17 Feb 2019 06:10:50 -0800 (PST) Subject: Re: [PATCH v2 1/2] leds: Add Intel Cherry Trail Whiskey Cove PMIC LEDs To: Pavel Machek Cc: Jacek Anaszewski , Yauhen Kharuzhy , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org References: <20190214230307.GA17358@amd> <2a5e2002-e5f1-6da3-8a43-317801b69657@redhat.com> <3d5407a7-9458-f071-a1d5-511b09678e20@gmail.com> <87a21c4e-8e5e-c180-2ff3-eb8170746e71@redhat.com> <80971bc3-1193-83ed-913a-12f6217016c8@gmail.com> <8a263266-a41f-c916-e990-02d04de9b5d0@gmail.com> <20190216193727.GA14305@amd> <7be63b6b-8d8d-90b8-fb17-d219b87a101f@redhat.com> <20190217000851.GA29803@amd> From: Hans de Goede Message-ID: <81cc42f5-1f3d-c7f2-eb13-c2f8c4f9bfb4@redhat.com> Date: Sun, 17 Feb 2019 15:10:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190217000851.GA29803@amd> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2/17/19 1:08 AM, Pavel Machek wrote: > >>> I don't pretend to fully understand it, _but_ hw_pattern should really >>> describe the pattern LED should do, not whether it reacts to charging >>> or not. >> >> Then we are back to step 1 of the discussion, that we need another >> mechanism outside of the trigger to select if the LED shows the configured >> pattern always, or only when the charger is on. > > Yep, sorry. > >> These really are 2 orthogonal settings, there is a pattern which can >> be set and the LED can either show that pattern always; or only when >> charging the battery. Note that the same pattern is used in both cases. >> >> This is why I previously suggested having a custom sysfs hardware_control >> attribute which selects between the "only show pattern when charging" >> modes ("hardware_control=1" or "always show the pattern mode" >> ("hardware_control=0"). > > I see... and yes, that would be the easiest solution. > > But somehow I see "this LED is controlled by charging state" as > primary and "it shows pulses instead of staying on" as secondary > eye-candy. > > This week there was another driver for charger LED.. but that one does > not do pulses. Ideally, we'd like consistent interface to the > userland. > > (To make it complex, the other driver supports things like: > LED solid on -- fully charged > LED blinking slowly -- charging > LED blinking fast -- charge error > LED off -- not charging). Something like that could be supported with my original hw_pattern proposal where we simply encode all of this in the hw-pattern file: tupple0: charging blinking_on_time tupple1: charging blinking_off_time tupple2: charging breathing_time tupple3: manual blinking_on_time tupple4: manual blinking_off_time tupple5: manual breathing_time So for this chip you mention, we do not need the breathing time (no breathing support), so we would get the following tupples: tupple0: not charging blinking_on_time tupple1: not charging blinking_off_time tupple2: slow charging blinking_on_time tupple3: slow charging blinking_off_time tupple4: fast charging blinking_on_time tupple5: fast charging blinking_off_time tupple6: charging error blinking_on_time tupple7: charging error blinking_off_time Where by solid on/off can be done by setting one of the blinking times to 0. Having hw_pattern ABIs like this where some of the tupples only activate on certain conditions might be better then a hardware_control sysfs file as it offers more flexibility. Regards, Hans