Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4428237imm; Tue, 11 Sep 2018 11:44:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYIC7oHd13E88OcGGwj6eY6XXmX9O3UcsVpsU1fPCcMQxpkZ0QSlrAYjEqNoHmroQbf/96z X-Received: by 2002:a65:560a:: with SMTP id l10-v6mr29956720pgs.130.1536691450251; Tue, 11 Sep 2018 11:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536691450; cv=none; d=google.com; s=arc-20160816; b=CkAFu+p7txkIhg1OKW/VOfKuqF8OTZlss96TiJv9MNZDX3nrE93YBFuRa18wzfsdsx YUKUYx2Lf33cQjFscYsBxlMEI8jXVBLb+IR0ZmTz9crDl5oGvAarSF2HQ+LHd34EyT7U 3PY3GDNyoZwWIBMlTOUYMkFFAcgMkyGZ0JzS3QdJMYa/Xg22Vy7BQnv9GanibJhxmk9K HcreXOoUgoSPWbH4cKfLo/2pb7h880d6rTE6kxDNYPSMVeyDj6x64HaaeUlE03oQnjiR QWq794crjPY+bbFxg6bpgf21ehpCqDhdnFmM681EumrVM966n+4e3JJJSP5WwjtH6jIM W4MA== 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:from:references:cc:to:subject:dkim-signature; bh=0drb+/CS2lzkJiS7EqvZdflW/nK1Y7n9YmXVxNZwp0Q=; b=AjAm8tNXb5+mANNTMMPahZ8dg9qifEUOssKLOrcX3UKH83npes+pWhCNOoVGU7SWfW jbfXta9J0KX7+ze4h3u0/qvwORbAzJ6zOVQLDKvFOtB+IGH7Zve3+z6HvXRrR8JAHJXL 4fbot72kHWT43pQct4+KC8J+Qu1ASwvn77O222Q6aX7CE585GxZz44N6M9sD9diYjgAr KS7WHStSMNgm3/6Jmg8ZOkcuFp5cDsxxbBxuWL7Q2MSdnGxAy9LqCNTxPrTp83694owP Gm7Z7yOtzD5PdmmbnAmPxCIcDcxmI9IWRdV3NFXksIw6skY/CUGiE6STuws9tUEHYG2y rbXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pbcQ6f5M; 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 e14-v6si19527231pfi.184.2018.09.11.11.43.54; Tue, 11 Sep 2018 11:44:10 -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=pbcQ6f5M; 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 S1728003AbeIKXny (ORCPT + 99 others); Tue, 11 Sep 2018 19:43:54 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44594 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726689AbeIKXny (ORCPT ); Tue, 11 Sep 2018 19:43:54 -0400 Received: by mail-wr1-f67.google.com with SMTP id v16-v6so27070777wro.11; Tue, 11 Sep 2018 11:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0drb+/CS2lzkJiS7EqvZdflW/nK1Y7n9YmXVxNZwp0Q=; b=pbcQ6f5MeSMnk28M//DpOka0xZUCe7JPa4CHXJ8GB7E6FiR7ibT5cCf9hZh47W6f+X HFZ1kLd0a09yUy5200BpPio1uPwx/SokoIX92r0H83Li8SRXTOtbhFa+CA4mp3JgyWJr YwmCroVc2ucdMH74UH+UiFX2b0WSHSdCZ+XMMkWDgp2Paor9L35FHdPZUGNVp10zqdA0 mKoJDdV2OZ6roVGERPUkzHJpi93pQ8qKT0uOkiRwcAj2LxH/BD1AydDvpLMA5A2uxwet K2lmv0Mxp+ZAlHshd2dM9typ0hGRnwwT3N/28X7Ut+phwxO6ePhrqOW+VANVuOL6SLIB bBgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0drb+/CS2lzkJiS7EqvZdflW/nK1Y7n9YmXVxNZwp0Q=; b=VFYxPHBzoj0eBnAHGenHaIWBIdn2TU2Duhv6jAAl+H/i20Ld/PiOzAnG69a7zig7Ah Qbd1JhhsONQisFKz/aR/Fi5A2IGz93/JCZnI2173EH+yImBkk3QWYOsw3RG7j1AHUNiS UgE/08WAixI+w6BXzUkirqlWNKF4erksdZhxSToChky1vKJ6MxHcUiVojahzRqdA9gft /ieWxuvTo2297yhQKO3MGwh61jwbyOHbP27NoLjffRKFOaTBRUctk7A0kn6vLFVgwWVS VnAhU5WO9Y779mefDQk+qP+6r95m6VNH3C9IO2xbke5QTj0Ph2l7XPXikqQfjf8g0fbX Lg8Q== X-Gm-Message-State: APzg51DnflNcyDLPWwAXYvicJ4TZLCu64pslpkKV9E7ZkZ5j7OPiHGAo FnyARajpsSKv9TJrLJTrdHJxG4Yo X-Received: by 2002:adf:b7c9:: with SMTP id t9-v6mr18983177wre.274.1536691395817; Tue, 11 Sep 2018 11:43:15 -0700 (PDT) Received: from [192.168.1.18] (bks43.neoplus.adsl.tpnet.pl. [83.28.186.43]) by smtp.gmail.com with ESMTPSA id f18-v6sm19795143wrw.32.2018.09.11.11.43.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 11:43:14 -0700 (PDT) Subject: Re: [PATCH v8 1/2] leds: core: Introduce LED pattern trigger To: Pavel Machek , Bjorn Andersson Cc: Baolin Wang , 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> <20180910211935.GA4697@amd> From: Jacek Anaszewski Message-ID: Date: Tue, 11 Sep 2018 20:43:12 +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: <20180910211935.GA4697@amd> Content-Type: text/plain; charset=windows-1252 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 Pavel, On 09/10/2018 11:19 PM, Pavel Machek wrote: > On Fri 2018-09-07 22:02:08, 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. > > 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. If you looked at what we agreed on with Baolin, you'd realize that this property is in no way preserved. This is what the whole story is about - we're introducing hw_pattern because of difficulties in describing breathing pattern by a series of [brightness delta_t] tuples. And Bjorn presented another example. I'm inclined to leave the definition of hw_pattern semantics to the LED class drivers, and allow them to create related sysfs files. >>> +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. >> >> 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 > -- Best regards, Jacek Anaszewski