Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1633499

[PATCH 2/3] leds: Add the LED_BRIGHTNESS_FAST flag

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From David Lin <dtwlin@google.com>
Newsgroups linux.kernel
Subject [PATCH 2/3] leds: Add the LED_BRIGHTNESS_FAST flag
Date Sun, 30 Apr 2017 23:40:02 +0200
Message-ID <tC4Js-8ub-29@gated-at.bofh.it> (permalink)
References <tC4Jr-8ub-11@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o092SpYESZylaaC5OYwNMrRDiQDPpHsgi1eUDr4VAEo=; b=KhbDgIIyreaq8yQeZ27YK4obyGUx7EQZVktWpj2hCqasBT/USBT4SrwUDEDg9fcxz9 VWhXCyjuohzpOuohf8jyMxEBCiFxoVZhRjlSPx+82GvdMpvWBQZvAHhX+58OjKvRZP+T J471MXUFVd+n0qXOzdJXooLtFLmReQ+noL4hoFkVC6aIRlxjZ5NdqX+xga3CayU6Sdxw HH69ZKsGFQD9UYT1NJhxU+wu/sSUM2YWM87a9jV1pbSXkG/Px8EpueXyJZ91Zy5XkD2v SwnELhykNQj4uVKRHr5d+WQOicVxl1yfHosZsR8W4v0y0cunbpUYCURSkSIrANjTTn0U JR1g==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o092SpYESZylaaC5OYwNMrRDiQDPpHsgi1eUDr4VAEo=; b=ESW28ZXjjrS29OoQY7PklVOXI8mNK4ybhgyml7v+a2JJBg0H0JtNAg+PE2ATXTEliv UbmXgQZGVScxn1K1LG1ucPHWwRoikS8vZ3qhPbj8epYBJ+0UXAAVibYaAeVpglEhnQjw JA73BqnR5wG/535StLZSTpIy6DVW/HDAAruTbZjQkJWQvuVI0WPh0Qoe07WvVMHMLUr1 dMFjy0Hv2rgvzs2M6/1tHroRa5VHSf7hSm6ml3HOV2P8a9MRcHLrDrSEk4phORYvH6mi hwpAwrebP1b/yjw1JVY3KFzApj5Yula+Oxgdl0DTea875/6Xd6zl/CJG32EPkJ5GpGOR 4D1Q==
X-Gm-Message-State AN3rC/4NNY7AgyeWxpv8lu9c4JcIBxjbrbT67ZacGJTYSmSb6QtB4FPZ fbytQGU2/kbAQgJP
X-Received by 10.98.57.71 with SMTP id g68mr22701168pfa.53.1493588242501; Sun, 30 Apr 2017 14:37:22 -0700 (PDT)
X-Mailer git-send-email 2.13.0.rc0.306.g87b477812d-goog
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 42
Organization linux.* mail to news gateway
X-Original-Cc robh@kernel.org, romlem@google.com, joelaf@google.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, David Lin <dtwlin@google.com>
X-Original-Date Sun, 30 Apr 2017 14:37:00 -0700
X-Original-Message-ID <20170430213701.12297-3-dtwlin@google.com>
X-Original-References <20170430213701.12297-1-dtwlin@google.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1633499

Show key headers only | View raw


This patch adds the LED_BRIGHTNESS_FAST flag to allow the driver to
indicate that the brightness_set() callback is implemented on a fastpath
so that the LED core may choose to for example use a hrtimer to
implement the duration of a trigger for better timing accuracy.

Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: David Lin <dtwlin@google.com>
---
 Documentation/leds/leds-class.txt | 5 +++++
 include/linux/leds.h              | 1 +
 2 files changed, 6 insertions(+)

diff --git a/Documentation/leds/leds-class.txt b/Documentation/leds/leds-class.txt
index 836cb16d6f09..70d7a3dca621 100644
--- a/Documentation/leds/leds-class.txt
+++ b/Documentation/leds/leds-class.txt
@@ -80,6 +80,11 @@ flag must be set in flags before registering. Calling
 led_classdev_notify_brightness_hw_changed on a classdev not registered with
 the LED_BRIGHT_HW_CHANGED flag is a bug and will trigger a WARN_ON.
 
+Optionally, the driver may choose to register with the LED_BRIGHTNESS_FAST flag.
+This flag indicates that the driver implements the brightness_set() callback
+function using a fastpath so the LED core can use hrtimer if the driver requires
+high precision for the trigger timing.
+
 Hardware accelerated blink of LEDs
 ==================================
 
diff --git a/include/linux/leds.h b/include/linux/leds.h
index f9d10a9efcbe..78d2880ccd39 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -49,6 +49,7 @@ struct led_classdev {
 #define LED_HW_PLUGGABLE	BIT(19)
 #define LED_PANIC_INDICATOR	BIT(20)
 #define LED_BRIGHT_HW_CHANGED	BIT(21)
+#define LED_BRIGHTNESS_FAST	BIT(22)
 
 	/* set_brightness_work / blink_timer flags, atomic, private. */
 	unsigned long		work_flags;
-- 
2.13.0.rc0.306.g87b477812d-goog

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] led: ledtrig-transient: add support for hrtimer David Lin <dtwlin@google.com> - 2017-04-30 23:40 +0200
  [PATCH 2/3] leds: Add the LED_BRIGHTNESS_FAST flag David Lin <dtwlin@google.com> - 2017-04-30 23:40 +0200
  Re: [PATCH 0/3] led: ledtrig-transient: add support for hrtimer David Lin <dtwlin@google.com> - 2017-05-04 02:30 +0200
  Re: [PATCH 0/3] led: ledtrig-transient: add support for hrtimer Pavel Machek <pavel@ucw.cz> - 2017-05-08 23:10 +0200
    Re: [PATCH 0/3] led: ledtrig-transient: add support for hrtimer Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2017-05-09 22:50 +0200

csiph-web