Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp879163imj; Fri, 15 Feb 2019 08:17:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IYegHEegvaQqeMjFWlG7JmmpvTge8irB/mcwZfgWPQVIrhWI9z/+wnj+jXFgxQ9UDJ+hFXt X-Received: by 2002:a62:3a89:: with SMTP id v9mr10578930pfj.26.1550247423140; Fri, 15 Feb 2019 08:17:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550247423; cv=none; d=google.com; s=arc-20160816; b=vw45jx6kwHCQLgW7BF4BcwZoOnI+fqnJf55BLxWnD8Dl3TaQXXn9zr9X2OzGlVbVpn 7ziRCJWdWRclLoMRWZmEtuPJvA5iRwuPKXWRdYEvOkTOzvoHF7qaB+w9MhUYdb6S/C8A /hNQFSN1FzJu59JJi1NuuZ8pPs1WT+Evv1lD/g8AycvaAKZH/wTiY9m0eMVUgIjixCo8 /tarBH4OcUjUXikhWM8vedKwhmQV2cDp08RC+e/yLW1sfcQAbSxdvCiSOGzWbGqlxg1p OSTK+iKF9Wb9Njcv56W79PoLAs6xh6wQX73dxKD7zud+JOZbc4r0pCAFEmRjeHSzUCa9 F8YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WLRgf64qWQnTzq1NpUHUvq9FwdUAP88reHAqwKrB0Xc=; b=k4eAHR2ETXWiqCzOx6zPxjdaGAPvJJl9gFG5xFGzCBwkoGrac9kW7lzknzg4uJH6CJ QLAFBNN0Byaq5zVovdPVOfjLmDbYzDgUOV9DL2mBGAeG/bGVChfVmLDCnEUqQ7AW/dUO 1Elh6+KpzpIj0fVRXDKL81eu0RsztoBA5+ETlcIVpaycSjkBTaupd3SNlUK3uURnuQmO PyBbc9bn2WuipQymLzcdf1IThZTmemIv8xuP5LTpjhopAhoLjXx0GLC6cnqtgbchntZ3 ex8L0S63nxYnohF6nYKZltL/soFDXMNRZqE2OR0AGlUmWE/3eeFf4dONL5lh37pYJE/c d9NQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si5126994pgp.307.2019.02.15.08.16.46; Fri, 15 Feb 2019 08:17:03 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394825AbfBONCM (ORCPT + 99 others); Fri, 15 Feb 2019 08:02:12 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:57204 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727303AbfBONCL (ORCPT ); Fri, 15 Feb 2019 08:02:11 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id E0F088036F; Fri, 15 Feb 2019 14:02:01 +0100 (CET) Date: Fri, 15 Feb 2019 14:02:07 +0100 From: Pavel Machek To: Hans de Goede Cc: Jacek Anaszewski , Yauhen Kharuzhy , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [PATCH v2 1/2] leds: Add Intel Cherry Trail Whiskey Cove PMIC LEDs Message-ID: <20190215130207.GB32198@amd> References: <1df39a63-533f-bb68-a056-a0241f148be9@redhat.com> <20190213230731.GA8557@amd> <42078a81-e32e-81b7-528f-d1adb60d31c3@redhat.com> <20190213233806.GA11867@amd> <562e2acd-a60a-2aea-4050-6d9414d23a4e@redhat.com> <20190214111423.GE6132@amd> <92cf09b8-726d-4f1b-94ba-368a66af2246@redhat.com> <2b6faaa5-b21e-a512-de7d-ca21be5045fc@gmail.com> <20190214230307.GA17358@amd> <2a5e2002-e5f1-6da3-8a43-317801b69657@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="v9Ux+11Zm5mwPlX6" Content-Disposition: inline In-Reply-To: <2a5e2002-e5f1-6da3-8a43-317801b69657@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --v9Ux+11Zm5mwPlX6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >Hardware can automatically control the LED according to the charging > >status, or it can be used as normal software-controlled LED. > > > >I believe we should use trigger to select if hardware controls it or > >not (and then add driver-specific files to describe the > >details). Other proposal is in the mail thread, too. >=20 > Right, so there are really 2 orthogonal issues here: For completeness, there are actually 3 issues: > 1) With this hardware the LED is either turned on/off automatically > by the PMIC based on charging state; or it is under user control. >=20 > This is different from the led_classdev_notify_brightness_hw_changed > case, where the hardware may update the state underneath the driver, > but the driver can still always update the state itself. In this case > if the LED is in hw-control mode then the driver cannot turn it on/off. >=20 > Pavel suggested modeling this with a new "hardware' trigger, where > setting the trigger to this trigger will enable the hw-controlled > mode and setting any other trigger will switch thing to the user-controll= ed > mode. >=20 > 2) This hardware can do blinking / breathing. There are various issues wi= th > this: >=20 > 2.1) Blinking is more or less covered by the timer trigger. But breathing= is > not the pattern trigger is a poor match since there is only 1 fixed patte= rn >=20 > 2.2) The supported blinking frequencies are very limited, so it might be = better > to keep the standard software blinking mode and have a special sysfs attr= ibute > to select the hardware blink support >=20 > 2.3) The user can also select between continuous on / blinking / breathing > when the LED is under hardware control (it will then be on / blinking / b= reathing) > when charging. 3) Your hardware supports "composed" triggers: You can do "breathing while charging", can do "blinking while charging" and you probably could do "blinking while disk is active" or "breathing while microphone is muted". We don't have such support in LED subsystem, AFAICT. Anyway, I'd say 3) Does not need to be solved now... Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --v9Ux+11Zm5mwPlX6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlxmuE8ACgkQMOfwapXb+vLudQCgqQS77n5Tsm6sjJ5KCzmEdqP/ qxUAn06KMMaz2kPH8f+lqCCXxQJT+vyT =tSOZ -----END PGP SIGNATURE----- --v9Ux+11Zm5mwPlX6--