Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1656449imm; Sun, 9 Sep 2018 06:40:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbLo2ETa7krSen8hNiUtCI+ca70FsXRCx1O9HqkHEoqbqhBnv6YglarbM+qWPDbFgwW+z6Q X-Received: by 2002:a17:902:3081:: with SMTP id v1-v6mr17253889plb.58.1536500414432; Sun, 09 Sep 2018 06:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536500414; cv=none; d=google.com; s=arc-20160816; b=CfZci3kI8K9mfY/rzfunyQrkexJ4I8HwQZtPR7WFahOcC6suoWodaZWnd5gnQ41c9b 0qALCMI5yILMPWysb2+OFlyEyqGOdw0d4TeFkQSukTW2AAf6r+V33ht91Ly2bLokBZo6 r+jWmliDQaVlmzcwm+vq9uklxeR4Pe/OsBIQZzz2310yPftLRp7DEwtEItdRxDSqD1NL rjH8eAAWm20PptQvoOMNuVMA3r8nfRr4bOUyyQIwabXzvJlUeYcch2qfUtNFbRlAlLEu JmT/uZhWNeJ4YjORp3NVxkN8YaTQ0VF1bi7cvhyvc4JJ88U8oqhCpJBJPw/gzB5ka2FE 2BSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=HC1zs5IzIHuYzvbdzHtYGcnZ90chaRrMSZb0TvV0u7s=; b=gG7KmP9DqAYrU1pC/C+mN+6qoDddoU/Q2TmKuclvNwP1PNfWs4RJDbXLsXKbta9sAP LwTTVAVrHiaBScyqd51LeoQTTXYpXhz7mOrlaPsbtSAic9Dq4g4SeLomk109kxLtK5sX /dgOiLIPeL5tUEw3IPZ4BLOVrVC9TdWROl7BcZGkUgLRp2CvNDKeavRxbSvIn44kHAYi wcO+Xr/Dkt9IegNvN0oNvfWp+ImotTpNxIT/gvTL2E2hmlnLjbwJMoSBRtTrBobxy3Da 3Vs3qeJTW93zZ2AA3FZdHESRAf+obXM0LkEm94jV4H+zaYnBt4eDZG+1zXDHBgSXpBCf cKog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=izh+B+dU; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si13381238ple.241.2018.09.09.06.39.57; Sun, 09 Sep 2018 06:40:14 -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; dkim=pass header.i=@linaro.org header.s=google header.b=izh+B+dU; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727277AbeIIS21 (ORCPT + 99 others); Sun, 9 Sep 2018 14:28:27 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:46079 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726952AbeIIS21 (ORCPT ); Sun, 9 Sep 2018 14:28:27 -0400 Received: by mail-oi0-f68.google.com with SMTP id t68-v6so35313103oie.12 for ; Sun, 09 Sep 2018 06:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HC1zs5IzIHuYzvbdzHtYGcnZ90chaRrMSZb0TvV0u7s=; b=izh+B+dUvr8VNeyRxhVTXQguvEr3yoU5DCMjrJm1bYPoYYS2RnijvNEFTG4NgqNjnr LAsSjkC2YRCQ9wkPAlOSkPK4g7L5N/72oNNV2JtmBXwGlxmBnhrRsrURLPdj/h4nRgmp XAFmzZjf2MVpDGUAgtlpHiCblyu8yjxM+08Bg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HC1zs5IzIHuYzvbdzHtYGcnZ90chaRrMSZb0TvV0u7s=; b=EHrnmjgKkkBLAxukdlJrM//FeGB1g0zadXTUFVGU4QOgZo/N3ISt9a7q08YXHPLebI sTltNga9I9NMOdYv/erLuraT0YJjudDQyte++Wqt1K74iAAnANfx08Rps/aUAUwCav6F AShnmZlIYOqzxQOz8l+t/ecQeA0EPZWlk2a1VC7dXqQUcbuk8r/3d7NIESdjfC3PcZ7r xtC/fT26vTfIQE82/jDjpwEYRqwh3Js8fNMCFMdqu3QwVg1w8xD8c6ATBEXr11D4i2Y7 g/OZY+lVGyUqnXfdbeu2RAI8TFWK4R3YzCfgTw9cMNLju+lTQh1DQwfz6s3D9WzToH9U 4iCg== X-Gm-Message-State: APzg51BwB9qrJKU1JHS3Fl1b38U0hyJpT2v4CXMr8iQrEdAzK/4xDKSn RNW8a8YVoVqnN1KjBtkTo86umIM/YezjYQjtlyaPHg== X-Received: by 2002:aca:e005:: with SMTP id x5-v6mr16988687oig.328.1536500322980; Sun, 09 Sep 2018 06:38:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:3ec8:0:0:0:0:0 with HTTP; Sun, 9 Sep 2018 06:38:42 -0700 (PDT) In-Reply-To: <0190dc10-99a3-abb7-b196-a537c49a2b6e@gmail.com> References: <5a502ec29251c019ddad8f3314ab45fc0f6feaf7.1536027873.git.baolin.wang@linaro.org> <20180908050208.GY2523@minitux> <0190dc10-99a3-abb7-b196-a537c49a2b6e@gmail.com> From: Baolin Wang Date: Sun, 9 Sep 2018 21:38:42 +0800 Message-ID: Subject: Re: [PATCH v8 1/2] leds: core: Introduce LED pattern trigger To: Jacek Anaszewski Cc: Bjorn Andersson , Pavel Machek , rteysseyre@gmail.com, Mark Brown , Linus Walleij , Linux LED Subsystem , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9 September 2018 at 04:19, Jacek Anaszewski wrote: > Hi Bjorn, > > On 09/08/2018 07:02 AM, Bjorn Andersson wrote: >> On Tue 04 Sep 04:01 PDT 2018, Baolin Wang wrote: >> >>> 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. >>> + >> >> So, after a full circle we're back at drivers with support for hardware >> patterns should have their own ABI for setting that pattern. >> >> 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. >> >> Given that the interface now is hw specific, what benefit is there to >> attempt to cram these 4 knobs into "hw_pattern"? Or am I allowed to >> create additional files for the latter three? > > So this is an argument corroborating my concerns raised in [0]. > I really think that we should allow for custom pattern interfaces > defined by LED class drivers. > >>> +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. >> >> 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. > > Sounds reasonable. Let's change this semantics as you propose. > >> 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. Hm, so there are some cases we need to make clear. 1) If negative numbers present infinite, so what's the meaning of number 0? 2) What we should show for users if repeat number is negative, just show negative numbers or one string "infinite"? -- Baolin Wang Best Regards