mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Purdie <rpurdie@rpsys.net>
To: "Németh Márton" <nm127@freemail.hu>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-kernel@vger.kernel.org, Rodrigo Pereira <rodripe@gmail.com>
Subject: Re: [PATCH 3/3] leds-clevo-mail: driver for Clevo mail LED
Date: Tue, 23 Oct 2007 22:48:24 +0100	[thread overview]
Message-ID: <1193176104.5709.137.camel@localhost.localdomain> (raw)
In-Reply-To: <471B4C46.9030502@freemail.hu>

On Sun, 2007-10-21 at 14:55 +0200, Németh Márton wrote:
> diff -uprN linux-2.6.23.orig/Documentation/leds-class.txt linux-2.6.23/Documentation/leds-class.txt
> --- linux-2.6.23.orig/Documentation/leds-class.txt	2007-10-09 22:31:38.000000000 +0200
> +++ linux-2.6.23/Documentation/leds-class.txt	2007-10-21 10:45:35.000000000 +0200
> @@ -39,7 +39,9 @@ LED Device Naming
> 
>  Is currently of the form:
> 
> -"devicename:colour"
> +"devicename:colour" or
> +"devicename:colour:type" or
> +"devicename::type"

Adding a the idea of function here was proposed a while back and we
probably should do that but it needs to be a separate patch and some of
the other drivers probably need tweaking for consistency. I will take
care of this for the next merge window.

> diff -uprN linux-2.6.23.orig/drivers/leds/Kconfig linux-2.6.23/drivers/leds/Kconfig
> --- linux-2.6.23.orig/drivers/leds/Kconfig	2007-10-09 22:31:38.000000000 +0200
> +++ linux-2.6.23/drivers/leds/Kconfig	2007-10-21 12:04:50.000000000 +0200
> @@ -101,6 +101,39 @@ config LEDS_GPIO
>  	  outputs. To be useful the particular board must have LEDs
>  	  and they must be connected to the GPIO lines.
> 
> +config LEDS_CLEVO_MAIL
> +	tristate "Mail LED on Clevo notebook (EXPERIMENTAL)"
> +	depends on LEDS_CLASS && X86 && SERIO_I8042 && DMI && EXPERIMENTAL
> +	help
> +	  This driver makes the mail LED accessible from userspace
> +	  programs through the leds subsystem. This LED have three
> +	  known mode: off, blink at 0.5Hz and blink at 1Hz.
> +
> +	  The driver supports two kinds of interface: using ledtrig-timer
> +	  or through /sys/class/leds/clevo::mail/brightness. As this LED
> +	  cannot change it's brightness it blinks instead. The brightness
> +	  value 0 means off, 1..127 means blink at 0.5Hz and 128..255 means
> +	  blink at 1Hz.

Hmm, there really is no way to just turn the LED on? :(

> +	  Example to start blink at 0.5Hz:
> +	    echo 1 >/sys/class/leds/clevo::mail/brightness
> +	  - or -
> +	    echo timer >/sys/class/leds/clevo::mail/trigger
> +	    echo 1000 >/sys/class/leds/clevo::mail/delay_on
> +	    echo 1000 >/sys/class/leds/clevo::mail/delay_off

The Kconfig option shouldn't need to go into this much detail. If we
need this much detail, we should probably enhance the LED documentation
in Documentation/ instead.

> diff -uprN linux-2.6.23.orig/drivers/leds/leds-clevo-mail.c linux-2.6.23/drivers/leds/leds-clevo-mail.c
> --- linux-2.6.23.orig/drivers/leds/leds-clevo-mail.c	1970-01-01 01:00:00.000000000 +0100
> +++ linux-2.6.23/drivers/leds/leds-clevo-mail.c	2007-10-21 10:49:32.000000000 +0200
> @@ -0,0 +1,210 @@
> +
> +#include <linux/module.h>
> +
> +#include <linux/platform_device.h>
> +#include <linux/err.h>
> +#include <linux/leds.h>
> +
> +#include <linux/io.h>
> +#include <linux/dmi.h>
> +
> +#include <linux/i8042.h>
> +
> +#define HANDLED				0

Probably easiest to turn the two references to this into "return 0"

Other than that the driver looks ok and I'm happy to add a version with
the above minor tweaks to the LED tree.

Cheers,

Richard


  reply	other threads:[~2007-10-23 21:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19 18:52 Németh Márton
2007-10-19 20:36 ` Randy Dunlap
2007-10-21 12:52   ` Németh Márton
2007-10-21 12:55     ` Németh Márton
2007-10-23 21:48       ` Richard Purdie [this message]
2007-10-28 11:22         ` Németh Márton
2007-10-31 14:14           ` Richard Purdie
  -- strict thread matches above, loose matches on Subject: below --
2007-07-17 10:18 Németh Márton
2007-07-17 13:20 ` Dmitry Torokhov
2007-07-17 18:13 ` Németh Márton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1193176104.5709.137.camel@localhost.localdomain \
    --to=rpurdie@rpsys.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm127@freemail.hu \
    --cc=randy.dunlap@oracle.com \
    --cc=rodripe@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome