Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1136983imj; Thu, 14 Feb 2019 01:45:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IZR5TkiuIZO8OD7tXjMe//k8eOvBJk7l25bISsQjYkrmZ/YJJLPOQJmI5Owha256GtWW8Ne X-Received: by 2002:a17:902:724c:: with SMTP id c12mr3121810pll.144.1550137509929; Thu, 14 Feb 2019 01:45:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550137509; cv=none; d=google.com; s=arc-20160816; b=NGL8NitSIv1Rpix24ouBcCwMa7YmgkBKC0WLCpxCXMFyw1vgoLeUneVBgSFm0n9LPb zgduT4atYW1q/5rMfMFs7ZlGnSR6JKIlxZBh/ayVDdFdTSVToQAbN7iNsNkJKnYgqmIQ nAmxO1SBGUCM2bCo0IRguzBP7EwXf1D3e892SvAfQlEz8kWcKrSCxLpWBBDLDYIo/e76 zSa5mL1R2hH3G6UxAHfCoHME8I0TvWXF45zOezeDWTXi80J28yc9BexfVjqeyDz3H6AF A8lTIxoUVuZR++nA40coH22VnWrmJ7ObUEo8QD38AR1M3mFUZjrLkioFQPkWsIF+pfCG AdsQ== 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=kc6+i5aqLuZP9yM5+tRgkQ74PsBtBv/YKLM6uOPPi/Y=; b=BwC55MMD3yKnh4FYs1tlswXdcWY5OW2YFM7FD4kFufhoeHUU5SV6Bku1zUofGqCZNe DWw7KLrtxwxOLhqSX77ifR7mzVhKsas/RdenrODa87DC1bvBoqRLLPeT1NdDPzoMzFMQ EnAJVK/Mhn2fi73FkBaM7bmnVJL909R+eYN9YVg4nbks7ylIpiiXI4wIJycXCRDSlQMX rwnrD/cw+vDOTUu+fYEcHCjWmcwiV1UAvlDHslHW/jZeMUl76TtEOjAyD9DSEtnLelFd Y1clDaJ1ohTv4cpPMGoM/jMVe5l+m7O4Q/NWBg5SjBbqLMRJM0wupiJzK2tFEpG2Osud 9B4Q== 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 g128si1840704pgc.352.2019.02.14.01.44.53; Thu, 14 Feb 2019 01:45:09 -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 S2390729AbfBMXiK (ORCPT + 99 others); Wed, 13 Feb 2019 18:38:10 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:49037 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728875AbfBMXiK (ORCPT ); Wed, 13 Feb 2019 18:38:10 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id D383A80323; Thu, 14 Feb 2019 00:38:00 +0100 (CET) Date: Thu, 14 Feb 2019 00:38:06 +0100 From: Pavel Machek To: Hans de Goede Cc: 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: <20190213233806.GA11867@amd> References: <20190212205901.13037-1-jekhor@gmail.com> <20190212205901.13037-2-jekhor@gmail.com> <1df39a63-533f-bb68-a056-a0241f148be9@redhat.com> <20190213230731.GA8557@amd> <42078a81-e32e-81b7-528f-d1adb60d31c3@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline In-Reply-To: <42078a81-e32e-81b7-528f-d1adb60d31c3@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 --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >Agreed. > > > >>I believe it would be best to add a custom "mode" attribute > >>to the led classdev, with "manual" and "on-when-charging" > >>modes, this would then control bits 0-1 of reg 0x5e1f and > >>by default these bits should be left as is when the driver > >>loads. > > > >No. This is not first hardware when we have something like this, and > >we need something generic here. > > > >One possibility would be magic "hardware drives this led" > >trigger. Hmm? (Jacek disliked this idea before, but maybe we can > >convince him). > > > >Generic "is this driven by hardware or not" attribute might be > >possible, too... but its interaction with triggers/brightness/etc > >would be confusing. >=20 > In this case the interaction is not that tricky, but it will > likely be different per led controller, so I do not think that > we can ever come up with a truely generic solution. >=20 > Basically the charge led has 3 states: >=20 > 1) Off > 2) On > 3) On when charging >=20 > And then when on it has 4 patterns: >=20 > 1) Permanently off (so still not really on) > 2) Permanently on > 3) Blinking > 4) Breathing Ok, so you don't really need to support _both_ off methods. Still sounds like a normal LED, with special "yoga-charging" and "yoga-breathing" triggers. (All the normal triggers should still work, too.) > These 4 patterns can be selected when on, independent > of being perma-on or ondemand-on Yeah, but we don't really want to expose that to userspace. > >>As for the 0x5e20 settings, I believe another custom > >>sysfs attribute, called "breathing" would be a good idea to > >>export the breathing functionality. > > > >We have "pattern" trigger that can do this kind of stuff in > >software. But I'm not sure if this is worth supporting. >=20 > The problem is that any changes made are permanent, they > survice reboots and the default is Breathing, so we need > a way to restore that which does not involve removing > the internal battery of these devices. Wow. Now that's a broken hardware. Anyway, in such case I'd propose having rmmod/reboot/poweroff hook that just sets it to breathing. No need to expose it to userspace. Thanks, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --T4sUOijqQbZv57TR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlxkql4ACgkQMOfwapXb+vKOPQCeNzzI8MH1QkwygTqYdginoCew tigAniui8tZizirvnN0Z4zG8dgSZHmtg =5tRy -----END PGP SIGNATURE----- --T4sUOijqQbZv57TR--