Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp93833imm; Wed, 5 Sep 2018 19:27:47 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaW9SX88Ee2PxBdciXoGk001StCU+S8DhemFmK1cIINGIG5jfDCAJoldYh0hIDwflqWvL/e X-Received: by 2002:a62:9e08:: with SMTP id s8-v6mr637693pfd.23.1536200867555; Wed, 05 Sep 2018 19:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536200867; cv=none; d=google.com; s=arc-20160816; b=mFK9r7u8gAulzmqkYdabGXEsabkvMT06sIsgHjWOzxnAgzPwxpqbyTIfJihzsSllxw Q5kpzX1Yi9r6rBw5sYuo/Mne7M6lxvmcDD8rEiYS6TyQE8Eb7EQzqdUrUyaTuxwQnMP4 EnwSN1RWxGb7xhZltV4WiuFkIfBZic0uaI0z1HEhxGL6lcA5g9PvkQ6wfMaksT9+D5ns nl18lKP1v85z95qBwDWLNxKw7F1aQrR8C/N9eQsvB4mOp3/fCctkeEga50TajoHTkaRo qlG8asDH5SfINBlSoOZs+Xll67u2o203ZIB+7l3/8HDYXFYLQZsoSnUFy4TfE3XUAxWA UBpQ== 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=imKpnDG/aV3qpWKt+JPNwIRVJC88POjfyLVnWVmFVR4=; b=OhGPgke1feBkHgExKuaBBs9fc0xPzMrAnjPl49KtMKeYm8CFwxbeW2asLk5itCNalJ TXIJaCFNICK8zUcM7DMXi0NpNMmGFFeIFWKTziHEO0oYo3itC0o0qU9oB2OVh0Btr858 dkvDqF39Yz90B+x1cD4x4M/qF1R8xH0tDgoRbtASbiauop8lXIFiXIssRXchWEax+DiH yAuSXchUza+bZ4FV4wbtnAjHkBXwkXBhxanK8yn6DbdVgpgTzLChE9KxIG5OAvZFZixA 9zTp4+E44X3LZFVkSnuYCzdcE6utHee97wh7Lxj6TCDhcmZ+pzHwRK+8diOlJZt3rv/2 sXQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Syqf3eZ5; 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 n2-v6si3606471plp.276.2018.09.05.19.27.31; Wed, 05 Sep 2018 19:27:47 -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=Syqf3eZ5; 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 S1726356AbeIFG7G (ORCPT + 99 others); Thu, 6 Sep 2018 02:59:06 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:42651 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725937AbeIFG7G (ORCPT ); Thu, 6 Sep 2018 02:59:06 -0400 Received: by mail-oi0-f66.google.com with SMTP id k81-v6so17636300oib.9 for ; Wed, 05 Sep 2018 19:26:04 -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=imKpnDG/aV3qpWKt+JPNwIRVJC88POjfyLVnWVmFVR4=; b=Syqf3eZ5mSWKzNmLaphP6/P0E/yyjlpsqonxFNF3aqo6rA95W/bEGMFoboT/p04uEa J9ZGBZOnEkfsP0HkfYQccaQ9+wMrwj6wSRYL67nJrkKzl6yrYup9QsjhC3/yhY0flf65 wCzN5tf8L9Q1IP2zvbmHvxFGc2FXAI/bJCq14= 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=imKpnDG/aV3qpWKt+JPNwIRVJC88POjfyLVnWVmFVR4=; b=a+S9j2/ZX1Rz1PFI3/YBxaqcX2QmJ1LiK9NpnI5yxUUpjJgkMHX2Cq0wSBvyJEqvgU PaOcQfqsgmwoO0h7NYOtP+p6M3kwgAdCtsw2uXMIZpZIxZ2sAp2Zgwp+jTsQ1IJ8CGPa 5Fwjsh8Z1XqRq7MLXAq/STrWrwPZdS6PNPRso6Co16WOqjgSl4n3Nqqg5PV9kjnIE5Re 6AwzltmUABhAxUIZjTYLBy9LlusT5sQsWJt21Vh/gu0UZnrVfmoAoLTz9PbxaMtuDQQh VQ2BQ12WNOktZB2hWY98G5ORXKVMBqE0euQwGPPXyk8IC6sbJtzCF6d1in4YDVCUOCmJ iU0A== X-Gm-Message-State: APzg51DO7D1x1+YoPFoL4rCoeApUVtjSnFVWVfvaSwWLTdb8YK0tvzX3 /5HgoGKUfHCgxIrw5kneY4TwlPnJOh3CpYQ+wNTPfQ== X-Received: by 2002:aca:d706:: with SMTP id o6-v6mr624110oig.45.1536200764133; Wed, 05 Sep 2018 19:26:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:3ec8:0:0:0:0:0 with HTTP; Wed, 5 Sep 2018 19:26:03 -0700 (PDT) In-Reply-To: References: <5a502ec29251c019ddad8f3314ab45fc0f6feaf7.1536131926.git.baolin.wang@linaro.org> <059de1cc-e964-6976-15c6-bfb3385e1fcf@gmail.com> From: Baolin Wang Date: Thu, 6 Sep 2018 10:26:03 +0800 Message-ID: Subject: Re: [PATCH v9 2/2] leds: sc27xx: Add pattern_set/clear interfaces for LED controller To: Jacek Anaszewski Cc: Pavel Machek , rteysseyre@gmail.com, Bjorn Andersson , 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 6 September 2018 at 09:43, Baolin Wang wrote: > Hi Jacek, > > On 6 September 2018 at 03:14, Jacek Anaszewski > wrote: >> Hi Baolin, >> >> Thanks for the v9. >> >> On 09/05/2018 09:20 AM, Baolin Wang wrote: >>> This patch implements the 'pattern_set'and 'pattern_clear' >>> interfaces to support SC27XX LED breathing mode. >>> >>> Signed-off-by: Baolin Wang >>> --- >>> Changes from v8: >>> - Optimize the ABI documentation file. >>> >>> Changes from v7: >>> - Add its own ABI documentation file. >>> >>> Changes from v6: >>> - None. >>> >>> Changes from v5: >>> - None. >>> >>> Changes from v4: >>> - None. >>> >>> Changes from v3: >>> - None. >>> >>> Changes from v2: >>> - None. >>> >>> Changes from v1: >>> - Remove pattern_get interface. >>> --- >>> .../ABI/testing/sysfs-class-led-driver-sc27xx | 20 +++++ >>> drivers/leds/leds-sc27xx-bltc.c | 93 ++++++++++++++++++++ >>> 2 files changed, 113 insertions(+) >>> create mode 100644 Documentation/ABI/testing/sysfs-class-led-driver-sc27xx >>> >>> diff --git a/Documentation/ABI/testing/sysfs-class-led-driver-sc27xx b/Documentation/ABI/testing/sysfs-class-led-driver-sc27xx >>> new file mode 100644 >>> index 0000000..391ca6e >>> --- /dev/null >>> +++ b/Documentation/ABI/testing/sysfs-class-led-driver-sc27xx >>> @@ -0,0 +1,20 @@ >>> +What: /sys/class/leds//hw_pattern >>> +Date: September 2018 >>> +KernelVersion: 4.20 >>> +Description: >>> + Specify a hardware pattern for the SC27XX LED. For the SC27XX >>> + LED controller, it only supports 4 stages to make a single >>> + hardware pattern, which is used to configure the rise time, >>> + high time, fall time and low time for the breathing mode. >>> + >>> + For the breathing mode, the SC27XX LED only expects one brightness >>> + for the high stage. To be compatible with the hardware pattern >>> + format, we should set brightness as 0 for rise stage, fall >>> + stage and low stage. >>> + >>> + Min stage duration: 1 >>> + Max stage duration: 255 >>> + Stage duration step: 125 ms >> >> It seems that min and max stage duration are given in device >> specific levels in contrary to the step which is given in ms. >> Please keep it consistent. If I'm getting it right then duration >> constraints should be given as follows: >> >> Min stage duration: 125 ms >> Max stage duration: 31875 ms > > This is not good for users. Since what we set into LED registers is > step counters, and each step is 125 ms. Which means it only support > 125ms, 250ms, 375ms, 500ms .... 31875ms. > > If user set stage duration to 200ms, what we actually set into LED > registers is 1 step counter (200ms / 125ms = 1), which means the > actual duration is 125ms. That will confuse the user. So I still like > to force user to set the step counter which can show the real > duration. Ah, sorry for misunderstanding, to keep consistent with the documentation, I will change the duration unit to ms and add more documentation for the duration step in next version. Thanks. -- Baolin Wang Best Regards