Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp991193imm; Sat, 8 Sep 2018 13:20:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZlJBYkS+9ADWyfZ0Xzdc8THbHq+0sj7/S1IrzcTf4MWRe+sxZmWotL06H5wVEWZaYnnDha X-Received: by 2002:a62:3241:: with SMTP id y62-v6mr15554464pfy.4.1536438049395; Sat, 08 Sep 2018 13:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536438049; cv=none; d=google.com; s=arc-20160816; b=IzeGWjgqwePk2r3YgycST5usnBRFu6UWUZwy1SSJgEidvelWSgfNspbUarnZGJv9cf VZQopGpokHslvTJM3NbYcOT9mmtKCCHuXmvcQVJH7EoysgGOv0ActTMklKJ7moenpvSX DJCtNcp9NBZLRE1es+U7mmwx+ibBHCgs3JV050nRR6yR63sKHH/ELQezxuXFa0or0T7I ppz8i3Cn9wmCigynuQwTfIVObLVCZNmDJT47TEpe0kPH/v+Qa7NIVb7OrYrxrCEpJ2FJ P0sNrt4NIcGnD2Kf2YbFtjKxEANB/xI+supFve1XHQJbq+REt9iZvtGlXjjsHjF2HzMA 7Utg== 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:references:cc:to:subject:from:dkim-signature; bh=ZNJmlwFylUMaTOqdlmwF6kXUG0vTUL6zYGWJBwTic3A=; b=MXH43wO7L2ItZnlL1sC34QplrA1Zo2MMvpZOTWtddbp8NlckSUkRZxucVGU64ri5mJ ap4sO9l7pSKf3Ivvvb5c7Fiw6cz37TEoxp7k/GxvK4wpWgT5g7nSOUFeCbj+ND9ZcsP9 Ih6O8+Xlwp8honeHq9cLQIUdQTdknX1l0qEKN0a2FoeJ/rE27/Pj9HNkXzmJOKYz6Ki0 +qIWen6EJyhfek+Rz00U0HBlX/+vW68ez9X8k5EleGcdpHF62Dn2VfYng67z78DuFdJV +Hh/tMjXb7sDYpBDl7rxOdcpHmKOr30Hhfxy5pubvI+RWMEOl0GMCCcS0UgeakRncOoV tjKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PtDar8su; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w17-v6si13370546pfl.171.2018.09.08.13.20.26; Sat, 08 Sep 2018 13:20:49 -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=@gmail.com header.s=20161025 header.b=PtDar8su; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727774AbeIIBGO (ORCPT + 99 others); Sat, 8 Sep 2018 21:06:14 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:39695 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727608AbeIIBGO (ORCPT ); Sat, 8 Sep 2018 21:06:14 -0400 Received: by mail-wm0-f68.google.com with SMTP id q8-v6so17674315wmq.4; Sat, 08 Sep 2018 13:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZNJmlwFylUMaTOqdlmwF6kXUG0vTUL6zYGWJBwTic3A=; b=PtDar8sui22s+uQUAK1jdbpIPNAy0Z9CHSGj1jTgft/FsuhciU2eaefXKjkGE5JVXi FavXUMDvZX/pXLhn7EKpjuNdnrVCCcGkSZ5Xv6ApcsxihfdqSQBQr8uEL7jK8vhvoYhT WDnj9q8QyCTEKbL7NaBiRlRRxarQHrzYBaXtOl0r/kS4gKTy6HmpfSqxBvQZcFH3Sibi bsNBvgaw7wcqAg0/VHBhIZMQuqSUMyybDYo94izRMjfub2y1yRwt/tTyyiNjV/WdPCax 2zPAijfHrRehugIWhTrS65xvSXQYN37zYfRAgiOoFUnQKG7hxrqjh7hyMrR42BCnu2+T OQ5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZNJmlwFylUMaTOqdlmwF6kXUG0vTUL6zYGWJBwTic3A=; b=oVuPkj9y1m+kHHOkjW0uwqh9mcevkA1N9Iq/jjbfPG6gv/UoZ0RRAyoraisIvKI1Zb G97M6hJ/sxKzn7D7gbju/q5ItzXJkkxDxw8a5Faf6xwnVjR9f3HGTHBbRucWJ9VTjv0I Y7hOWQ9geF4rVwFGL4gmYNPY9kpTIBwr5OUWKENHQSwdZFgNwoOJ6xX02c08Sxtno1nW cy132oV696RH5zqfnCL1YX/AUQJ98PeXZmuPvO20sfksrD4g5RmJ49wB5COL42UMy/N1 qTLzFSpZUNF4TnNqNfxXLvlhTSoaOe39Y1LW+YE1+yQZUA9PgfsMlehUxONpgXwp/H/U wK7g== X-Gm-Message-State: APzg51B9Wm56HBqsFiOJ7QzZjlA8TfJTYisXjgLNVZ9Wa0zDrT1HV7Zd jjRLmhU8IKAjOypA20R7wbU5Tcy+ X-Received: by 2002:a1c:f30d:: with SMTP id q13-v6mr8208804wmq.36.1536437955039; Sat, 08 Sep 2018 13:19:15 -0700 (PDT) Received: from [192.168.1.18] (civ14.neoplus.adsl.tpnet.pl. [83.31.45.14]) by smtp.gmail.com with ESMTPSA id 14-v6sm18877146wmp.32.2018.09.08.13.19.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Sep 2018 13:19:13 -0700 (PDT) From: Jacek Anaszewski Subject: Re: [PATCH v8 1/2] leds: core: Introduce LED pattern trigger To: Bjorn Andersson , Baolin Wang Cc: pavel@ucw.cz, rteysseyre@gmail.com, broonie@kernel.org, linus.walleij@linaro.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org References: <5a502ec29251c019ddad8f3314ab45fc0f6feaf7.1536027873.git.baolin.wang@linaro.org> <20180908050208.GY2523@minitux> Message-ID: <0190dc10-99a3-abb7-b196-a537c49a2b6e@gmail.com> Date: Sat, 8 Sep 2018 22:19:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180908050208.GY2523@minitux> Content-Type: text/plain; charset=utf-8 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 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. [0] https://lkml.org/lkml/2018/9/3/1192 -- Best regards, Jacek Anaszewski