Received: by 2002:a4a:3008:0:0:0:0:0 with SMTP id q8-v6csp3408193oof; Mon, 10 Sep 2018 14:20:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbfkYx1J8AOXJT/5rs8MmoJcDc1SzRRRPPWwmaAHYQWCDAEzUrPoOeE1BF50SQsa3qYJ15C X-Received: by 2002:a63:24c4:: with SMTP id k187-v6mr24897147pgk.162.1536614423942; Mon, 10 Sep 2018 14:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536614423; cv=none; d=google.com; s=arc-20160816; b=I4pJAbgN9TnCccub81KElqWAy0Z0+8pDY52KLBvoDkLEKCSbz10szx4WLcXm1FUo3q flnX+tl2ARvdMLgloLi6cQQOVTz/2y+nd/TUe7vJu48zoZgNW4+ei7iO/glmkhk1bEW5 HlcMleAmCviix3fzyoelgZ6RzqvMyPAX3DK/I92F3kuia+homuASreSSOlWYE+khe42j ih0zg6lpjcxk7S2WYECnIVhwvXgTG0u5zggqu/1PUNukjaC1OcS60MzeqzTYYzT4LKsf 2F/j0uUcqXGrYr0RQyevcRjWcaT0u0mPJ5gW7d4BWio3Yk7ij9QtPrSv5QW2TQ3TmZZt kG4A== 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=qWZgloCPmkKPIMk0KI/6SormSy14nLr0gefyrGTQBys=; b=cCPEAkvEAmQa0CyQyg8r8bKyM60BfJT9M8RVA9tutJof3klK/8LWO6dOwRDKmb6jt8 yRVUcYzf1qX4Adn1V5bAM9NH9mwIKG9jFeqQ7LJpQ3AHrknZ19AN9frF2WyiTKazU4xi TvyT1mU0/SX3uUcAQHzdRovXUAwDr9SlcVBEf/+6PY+/5YkNCFT2ofnj5BBRFNGuNDtN nRNC6s86ZkhgJFfE51jHcxpjIdpOgro9zN03573v7byVj2FoWt9Lv1wBEtdQurwL6PnE tuqtREWkl1uzhj1ckYnZy80aNqZdtLfXPV4tEuMNMq1nC7vRYnQmOMBh+6+uqMO4Wm8Q /KKA== 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 gn12si17438936plb.147.2018.09.10.14.20.06; Mon, 10 Sep 2018 14:20:23 -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; 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 S1726916AbeIKCPf (ORCPT + 99 others); Mon, 10 Sep 2018 22:15:35 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:38801 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbeIKCPf (ORCPT ); Mon, 10 Sep 2018 22:15:35 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id AFFBA8057B; Mon, 10 Sep 2018 23:19:35 +0200 (CEST) Date: Mon, 10 Sep 2018 23:19:35 +0200 From: Pavel Machek To: Bjorn Andersson Cc: Baolin Wang , jacek.anaszewski@gmail.com, rteysseyre@gmail.com, broonie@kernel.org, linus.walleij@linaro.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 1/2] leds: core: Introduce LED pattern trigger Message-ID: <20180910211935.GA4697@amd> References: <5a502ec29251c019ddad8f3314ab45fc0f6feaf7.1536027873.git.baolin.wang@linaro.org> <20180908050208.GY2523@minitux> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <20180908050208.GY2523@minitux> 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 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri 2018-09-07 22:02:08, Bjorn Andersson wrote: > On Tue 04 Sep 04:01 PDT 2018, Baolin Wang wrote: >=20 > > diff --git a/Documentation/ABI/testing/sysfs-class-led-trigger-pattern = b/Documentation/ABI/testing/sysfs-class-led-trigger-pattern > [..] > > +What: /sys/class/leds//hw_pattern > > +Date: September 2018 > > +KernelVersion: 4.20 > > +Description: > > + Specify a hardware pattern for the LED, for LED hardware that > > + supports autonomously controlling brightness over time, according > > + to some preprogrammed hardware patterns. > > + > > + Since different LED hardware can have different semantics of > > + hardware patterns, each driver is expected to provide its own > > + description for the hardware patterns in their ABI documentation > > + file. > > + >=20 > So, after a full circle we're back at drivers with support for hardware > patterns should have their own ABI for setting that pattern. >=20 > The controls for my hardware is: > * a list of brightness values > * the rate of the pattern > * a flag to indicate that the pattern should be played from start > to end, end to start or start to end to start > * a boolean indicating if the pattern should be played once or repeated > indefinitely. No, we are not back to full circle. Or at least we should not be. Yes, hw_pattern can have some limitation pattern does not, but if you take values from hw_pattern file and put them into pattern file, you should get the same pattern (with more power being consumed). And that property is kind of important for me, because it should keep the ABI reasonable. > > +What: /sys/class/leds//repeat > > +Date: September 2018 > > +KernelVersion: 4.20 > > +Description: > > + Specify a pattern repeat number. 0 means repeat indefinitely. > > + > > + This file will always return the originally written repeat > > + number. >=20 > I'm still convinced that this will confuse our users and to me it would > be more logical if this denotes the number of times the pattern should > be repeated, with e.g. negative numbers denoting infinite. >=20 > In particular I expect to have to explain why my driver expects that you > write 0 in the file named "repeat" to make it repeat and 1 to make it > not repeat. Ok, -1 works for me :-). Thanks, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAluW3+cACgkQMOfwapXb+vLfhwCggPzf4UFQRwlNmyNbpUNg9TBI iKUAoK+ksS0tKjEMqCfLrnqXN2kn847m =S0ab -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e--