* [PATCH] Add support for Cobalt Server front LED
@ 2007-01-15 18:36 Florian Fainelli
2007-01-15 22:42 ` Yoichi Yuasa
2007-01-16 9:53 ` Peter Horton
0 siblings, 2 replies; 10+ messages in thread
From: Florian Fainelli @ 2007-01-15 18:36 UTC (permalink / raw)
To: linux-mips
[-- Attachment #1: Type: text/plain, Size: 4166 bytes --]
Hi all,
This patch adds support for controlling the front LED on Cobalt Server. It has
been tested on Qube 2 with either no default trigger, or the IDE-activity
trigger. Both work fine. Please comment and test !
Thanks
Florian
Signed-off-by: Florian Fainelli <florian.fainelli@int-evry.fr>
diff -urN linux-2.6.19.1/include/asm-mips/mach-cobalt/cobalt.h
linux-2.6.19.1.led/include/asm-mips/mach-cobalt/cobalt.h
--- linux-2.6.19.1/include/asm-mips/mach-cobalt/cobalt.h 2006-12-11
20:32:53.000000000 +0100
+++ linux-2.6.19.1.led/include/asm-mips/mach-cobalt/cobalt.h 2007-01-15
19:29:07.000000000 +0100
@@ -97,6 +97,7 @@
(PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS)
#define COBALT_LED_PORT (*(volatile unsigned char *)
CKSEG1ADDR(0x1c000000))
+#define COBALT_LED_BASE 0xbc000000
# define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */
# define COBALT_LED_BAR_RIGHT (1 << 1) /* Qube */
# define COBALT_LED_WEB (1 << 2) /* RaQ */
diff -urN linux-2.6.19.1/drivers/leds/Kconfig
linux-2.6.19.1.led/drivers/leds/Kconfig
--- linux-2.6.19.1/drivers/leds/Kconfig 2006-12-11 20:32:53.000000000 +0100
+++ linux-2.6.19.1.led/drivers/leds/Kconfig 2007-01-15 19:22:00.000000000
+0100
@@ -76,6 +76,12 @@
This option enables support for the Soekris net4801 and net4826
error
LED.
+config LEDS_COBALT
+ tristate "LED Support for Cobalt Server front LED"
+ depends on LEDS_CLASS && MIPS_COBALT
+ help
+ This option enables support for the front LED on Cobalt Server
+
comment "LED Triggers"
config LEDS_TRIGGERS
diff -urN linux-2.6.19.1/drivers/leds/leds-cobalt.c
linux-2.6.19.1.led/drivers/leds/leds-cobalt.c
--- linux-2.6.19.1/drivers/leds/leds-cobalt.c 1970-01-01 01:00:00.000000000
+0100
+++ linux-2.6.19.1.led/drivers/leds/leds-cobalt.c 2007-01-15
19:28:09.000000000 +0100
@@ -0,0 +1,55 @@
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/leds.h>
+#include <asm/mach-cobalt/cobalt.h>
+
+/* Copyright 2006 - Florian Fainelli <florian@openwrt.org>
+ *
+ * This driver let you control the Cobalt Qube/RaQ front LED
+ *
+ * 255 (max brightness) -> turn the led on
+ * 0 -> turn the led off
+ *
+ * If you want the LED to be blinking on IDE activity, select the IDE trigger
+ */
+
+void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness
brightness)
+{
+ switch (brightness) {
+ case LED_OFF:
+ *(volatile uint8_t *) COBALT_LED_BASE = 0;
+ break;
+ case LED_FULL:
+ *(volatile uint8_t *) COBALT_LED_BASE = COBALT_LED_BAR_LEFT |
COBALT_LED_BAR_RIGHT;
+ break;
+ default:
+ return;
+ }
+}
+
+static struct led_classdev cobalt_led = {
+ .name = "cobalt-front-led",
+ .brightness_set = cobalt_led_set,
+#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK
+ .default_trigger = "ide-disk",
+#endif
+};
+
+static int __init cobalt_led_init(void)
+{
+ return led_classdev_register(NULL, &cobalt_led);
+}
+
+static void __exit cobalt_led_exit(void)
+{
+ led_classdev_unregister(&cobalt_led);
+}
+
+module_init(cobalt_led_init);
+module_exit(cobalt_led_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Front LED support for Cobalt Server");
+MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
diff -urN linux-2.6.19.1/drivers/leds/Makefile
linux-2.6.19.1.led/drivers/leds/Makefile
--- linux-2.6.19.1/drivers/leds/Makefile 2006-12-11 20:32:53.000000000
+0100
+++ linux-2.6.19.1.led/drivers/leds/Makefile 2007-01-15 19:22:18.000000000
+0100
@@ -13,6 +13,7 @@
obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o
obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
+obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o
# LED Triggers
obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] Add support for Cobalt Server front LED
2007-01-15 18:36 [PATCH] Add support for Cobalt Server front LED Florian Fainelli
@ 2007-01-15 22:42 ` Yoichi Yuasa
2007-01-15 23:33 ` Florian Fainelli
2007-01-16 9:53 ` Peter Horton
1 sibling, 1 reply; 10+ messages in thread
From: Yoichi Yuasa @ 2007-01-15 22:42 UTC (permalink / raw)
To: Florian Fainelli; +Cc: yoichi_yuasa, linux-mips
Hi,
On Mon, 15 Jan 2007 19:36:52 +0100
Florian Fainelli <florian.fainelli@int-evry.fr> wrote:
> Hi all,
>
> This patch adds support for controlling the front LED on Cobalt Server. It has
> been tested on Qube 2 with either no default trigger, or the IDE-activity
> trigger. Both work fine. Please comment and test !
>
> Thanks
>
> Florian
>
> Signed-off-by: Florian Fainelli <florian.fainelli@int-evry.fr>
>
> diff -urN linux-2.6.19.1/include/asm-mips/mach-cobalt/cobalt.h
> linux-2.6.19.1.led/include/asm-mips/mach-cobalt/cobalt.h
> --- linux-2.6.19.1/include/asm-mips/mach-cobalt/cobalt.h 2006-12-11
> 20:32:53.000000000 +0100
> +++ linux-2.6.19.1.led/include/asm-mips/mach-cobalt/cobalt.h 2007-01-15
> 19:29:07.000000000 +0100
> @@ -97,6 +97,7 @@
> (PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS)
>
> #define COBALT_LED_PORT (*(volatile unsigned char *)
> CKSEG1ADDR(0x1c000000))
> +#define COBALT_LED_BASE 0xbc000000
You don't need COBALT_LED_BASE.
Because COBALT_LED_PORT is already defined.
Yoichi
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add support for Cobalt Server front LED
2007-01-15 22:42 ` Yoichi Yuasa
@ 2007-01-15 23:33 ` Florian Fainelli
2007-01-15 23:56 ` Florian Fainelli
0 siblings, 1 reply; 10+ messages in thread
From: Florian Fainelli @ 2007-01-15 23:33 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-mips
[-- Attachment #1: Type: text/plain, Size: 2018 bytes --]
Hi Yoichi,
I first used the COBALT_LED_PORT address but it did not work for a reason I
ignore. If I use the COBALT_LED_BASE as defined, which is taken from the CoLo
code, it works fine.
Do know you what could explain this difference ? Can you test it on your
boxes ?
Thank you very much in advance for your answer.
Le lundi 15 janvier 2007 23:42, Yoichi Yuasa a écrit :
> Hi,
>
> On Mon, 15 Jan 2007 19:36:52 +0100
>
> Florian Fainelli <florian.fainelli@int-evry.fr> wrote:
> > Hi all,
> >
> > This patch adds support for controlling the front LED on Cobalt Server.
> > It has been tested on Qube 2 with either no default trigger, or the
> > IDE-activity trigger. Both work fine. Please comment and test !
> >
> > Thanks
> >
> > Florian
> >
> > Signed-off-by: Florian Fainelli <florian.fainelli@int-evry.fr>
> >
> > diff -urN linux-2.6.19.1/include/asm-mips/mach-cobalt/cobalt.h
> > linux-2.6.19.1.led/include/asm-mips/mach-cobalt/cobalt.h
> > --- linux-2.6.19.1/include/asm-mips/mach-cobalt/cobalt.h
> > 2006-12-11 20:32:53.000000000 +0100
> > +++ linux-2.6.19.1.led/include/asm-mips/mach-cobalt/cobalt.h
> > 2007-01-15 19:29:07.000000000 +0100
> > @@ -97,6 +97,7 @@
> > (PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS)
> >
> > #define COBALT_LED_PORT (*(volatile unsigned char *)
> > CKSEG1ADDR(0x1c000000))
> > +#define COBALT_LED_BASE 0xbc000000
>
> You don't need COBALT_LED_BASE.
> Because COBALT_LED_PORT is already defined.
>
> Yoichi
--
Cordialement, Florian Fainelli
---------------------------------------------
5, rue Charles Fourier
Chambre 1202
91011 Evry
http://www.alphacore.net
(+33) 01 60 76 64 21
(+33) 06 09 02 64 95
---------------------------------------------
Association MiNET
http://www.minet.net
---------------------------------------------
Institut National des Télécommunication
http://www.int-evry.fr/telecomint
---------------------------------------------
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add support for Cobalt Server front LED
2007-01-15 23:33 ` Florian Fainelli
@ 2007-01-15 23:56 ` Florian Fainelli
2007-01-17 16:46 ` Ralf Baechle
0 siblings, 1 reply; 10+ messages in thread
From: Florian Fainelli @ 2007-01-15 23:56 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-mips
[-- Attachment #1: Type: text/plain, Size: 4209 bytes --]
Hi Yoichi,
Answering back to myself, since I fixed the stuff using the COBALT_LED_PORT,
here the corrected patch. Can you queue this patch for a commit if it sounds
acceptable to you ?
Thank you very much in advance.
diff -urN linux-2.6.19.1/drivers/leds/leds-cobalt.c
linux-2.6.19.1.led/drivers/leds/leds-cobalt.c
--- linux-2.6.19.1/drivers/leds/leds-cobalt.c 1970-01-01 01:00:00.000000000
+0100
+++ linux-2.6.19.1.led/drivers/leds/leds-cobalt.c 2007-01-16
00:49:20.000000000 +0100
@@ -0,0 +1,55 @@
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/leds.h>
+#include <asm/mach-cobalt/cobalt.h>
+
+/* Copyright 2006 - Florian Fainelli <florian@openwrt.org>
+ *
+ * This driver let you control the Cobalt Qube/RaQ front LED
+ *
+ * 255 (max brightness) -> turn the led on
+ * 0 -> turn the led off
+ *
+ * If you want the LED to be blinking on IDE activity, select the IDE trigger
+ */
+
+void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness
brightness)
+{
+ switch (brightness) {
+ case LED_OFF:
+ COBALT_LED_PORT = 0;
+ break;
+ case LED_FULL:
+ COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+ break;
+ default:
+ return;
+ }
+}
+
+static struct led_classdev cobalt_led = {
+ .name = "cobalt-front-led",
+ .brightness_set = cobalt_led_set,
+#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK
+ .default_trigger = "ide-disk",
+#endif
+};
+
+static int __init cobalt_led_init(void)
+{
+ return led_classdev_register(NULL, &cobalt_led);
+}
+
+static void __exit cobalt_led_exit(void)
+{
+ led_classdev_unregister(&cobalt_led);
+}
+
+module_init(cobalt_led_init);
+module_exit(cobalt_led_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Front LED support for Cobalt Server");
+MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
Le mardi 16 janvier 2007 00:33, Florian Fainelli a écrit :
> Hi Yoichi,
>
> I first used the COBALT_LED_PORT address but it did not work for a reason I
> ignore. If I use the COBALT_LED_BASE as defined, which is taken from the
> CoLo code, it works fine.
>
> Do know you what could explain this difference ? Can you test it on your
> boxes ?
>
> Thank you very much in advance for your answer.
>
> Le lundi 15 janvier 2007 23:42, Yoichi Yuasa a écrit :
> > Hi,
> >
> > On Mon, 15 Jan 2007 19:36:52 +0100
> >
> > Florian Fainelli <florian.fainelli@int-evry.fr> wrote:
> > > Hi all,
> > >
> > > This patch adds support for controlling the front LED on Cobalt Server.
> > > It has been tested on Qube 2 with either no default trigger, or the
> > > IDE-activity trigger. Both work fine. Please comment and test !
> > >
> > > Thanks
> > >
> > > Florian
> > >
> > > Signed-off-by: Florian Fainelli <florian.fainelli@int-evry.fr>
> > >
> > > diff -urN linux-2.6.19.1/include/asm-mips/mach-cobalt/cobalt.h
> > > linux-2.6.19.1.led/include/asm-mips/mach-cobalt/cobalt.h
> > > --- linux-2.6.19.1/include/asm-mips/mach-cobalt/cobalt.h
> > > 2006-12-11 20:32:53.000000000 +0100
> > > +++ linux-2.6.19.1.led/include/asm-mips/mach-cobalt/cobalt.h
> > > 2007-01-15 19:29:07.000000000 +0100
> > > @@ -97,6 +97,7 @@
> > > (PCI_FUNC (devfn) << 8) | (where)),
> > > GT_PCI0_CFGADDR_OFS)
> > >
> > > #define COBALT_LED_PORT (*(volatile unsigned char *)
> > > CKSEG1ADDR(0x1c000000))
> > > +#define COBALT_LED_BASE 0xbc000000
> >
> > You don't need COBALT_LED_BASE.
> > Because COBALT_LED_PORT is already defined.
> >
> > Yoichi
--
Cordialement, Florian Fainelli
---------------------------------------------
5, rue Charles Fourier
Chambre 1202
91011 Evry
http://www.alphacore.net
(+33) 01 60 76 64 21
(+33) 06 09 02 64 95
---------------------------------------------
Association MiNET
http://www.minet.net
---------------------------------------------
Institut National des Télécommunication
http://www.int-evry.fr/telecomint
---------------------------------------------
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] Add support for Cobalt Server front LED
2007-01-15 23:56 ` Florian Fainelli
@ 2007-01-17 16:46 ` Ralf Baechle
2007-01-17 18:04 ` Florian Fainelli
0 siblings, 1 reply; 10+ messages in thread
From: Ralf Baechle @ 2007-01-17 16:46 UTC (permalink / raw)
To: Florian Fainelli; +Cc: Yoichi Yuasa, linux-mips
On Tue, Jan 16, 2007 at 12:56:00AM +0100, Florian Fainelli wrote:
> Answering back to myself, since I fixed the stuff using the COBALT_LED_PORT,
> here the corrected patch. Can you queue this patch for a commit if it sounds
> acceptable to you ?
>
> Thank you very much in advance.
Signed-off???
> +void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness
> brightness)
This function is only used locally so should be static.
Ralf
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add support for Cobalt Server front LED
2007-01-17 16:46 ` Ralf Baechle
@ 2007-01-17 18:04 ` Florian Fainelli
2007-01-17 18:29 ` Ralf Baechle
0 siblings, 1 reply; 10+ messages in thread
From: Florian Fainelli @ 2007-01-17 18:04 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Yoichi Yuasa, linux-mips
[-- Attachment #1: Type: text/plain, Size: 3827 bytes --]
Hi Ralf,
This should take into account everything that has been said before.
Thanks.
Signed-off-by: Florian Fainelli <florian.fainelli@int-evry.fr>
diff -urN linux-2.6.19.1/drivers/leds/Kconfig
linux-2.6.19.1.led/drivers/leds/Kconfig
--- linux-2.6.19.1/drivers/leds/Kconfig 2006-12-11 20:32:53.000000000 +0100
+++ linux-2.6.19.1.led/drivers/leds/Kconfig 2007-01-15 19:22:00.000000000
+0100
@@ -76,6 +76,12 @@
This option enables support for the Soekris net4801 and net4826
error
LED.
+config LEDS_COBALT
+ tristate "LED Support for Cobalt Server front LED"
+ depends on LEDS_CLASS && MIPS_COBALT
+ help
+ This option enables support for the front LED on Cobalt Server
+
comment "LED Triggers"
config LEDS_TRIGGERS
diff -urN linux-2.6.19.1/drivers/leds/leds-cobalt.c
linux-2.6.19.1.led/drivers/leds/leds-cobalt.c
--- linux-2.6.19.1/drivers/leds/leds-cobalt.c 1970-01-01 01:00:00.000000000
+0100
+++ linux-2.6.19.1.led/drivers/leds/leds-cobalt.c 2007-01-15
19:28:09.000000000 +0100
@@ -0,0 +1,55 @@
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/leds.h>
+#include <asm/mach-cobalt/cobalt.h>
+
+/* Copyright 2006 - Florian Fainelli <florian@openwrt.org>
+ *
+ * This driver let you control the Cobalt Qube/RaQ front LED
+ *
+ * 255 (max brightness) -> turn the led on
+ * 0 -> turn the led off
+ *
+ * If you want the LED to be blinking on IDE activity, select the IDE trigger
+ */
+
+static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness
brightness)
+{
+ switch (brightness) {
+ case LED_OFF:
+ *(volatile uint8_t *) COBALT_LED_BASE = 0;
+ break;
+ case LED_FULL:
+ *(volatile uint8_t *) COBALT_LED_BASE = COBALT_LED_BAR_LEFT |
COBALT_LED_BAR_RIGHT;
+ break;
+ default:
+ return;
+ }
+}
+
+static struct led_classdev cobalt_led = {
+ .name = "cobalt-front-led",
+ .brightness_set = cobalt_led_set,
+#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK
+ .default_trigger = "ide-disk",
+#endif
+};
+
+static int __init cobalt_led_init(void)
+{
+ return led_classdev_register(NULL, &cobalt_led);
+}
+
+static void __exit cobalt_led_exit(void)
+{
+ led_classdev_unregister(&cobalt_led);
+}
+
+module_init(cobalt_led_init);
+module_exit(cobalt_led_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Front LED support for Cobalt Server");
+MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
diff -urN linux-2.6.19.1/drivers/leds/Makefile
linux-2.6.19.1.led/drivers/leds/Makefile
--- linux-2.6.19.1/drivers/leds/Makefile 2006-12-11 20:32:53.000000000
+0100
+++ linux-2.6.19.1.led/drivers/leds/Makefile 2007-01-15 19:22:18.000000000
+0100
@@ -13,6 +13,7 @@
obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o
obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
+obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o
# LED Triggers
obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
Le mercredi 17 janvier 2007 17:46, Ralf Baechle a écrit :
> On Tue, Jan 16, 2007 at 12:56:00AM +0100, Florian Fainelli wrote:
> > Answering back to myself, since I fixed the stuff using the
> > COBALT_LED_PORT, here the corrected patch. Can you queue this patch for a
> > commit if it sounds acceptable to you ?
> >
> > Thank you very much in advance.
>
> Signed-off???
>
> > +void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness
> > brightness)
>
> This function is only used locally so should be static.
>
> Ralf
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] Add support for Cobalt Server front LED
2007-01-17 18:04 ` Florian Fainelli
@ 2007-01-17 18:29 ` Ralf Baechle
2007-01-17 18:37 ` Florian Fainelli
0 siblings, 1 reply; 10+ messages in thread
From: Ralf Baechle @ 2007-01-17 18:29 UTC (permalink / raw)
To: Florian Fainelli; +Cc: Yoichi Yuasa, linux-mips
On Wed, Jan 17, 2007 at 07:04:23PM +0100, Florian Fainelli wrote:
> This should take into account everything that has been said before.
It does (thanks!) - but it arrived in my mailbox is nicely line wrapped
ASCII jibberish, no longer a valid patch ...
Ralf
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add support for Cobalt Server front LED
2007-01-17 18:29 ` Ralf Baechle
@ 2007-01-17 18:37 ` Florian Fainelli
0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2007-01-17 18:37 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Yoichi Yuasa, linux-mips
[-- Attachment #1: Type: text/plain, Size: 452 bytes --]
Hi Ralf,
Sorry for the line wrapping :)
Signed-off-by: Florian Fainelli <florian.fainelli@int-evry.fr>
Le mercredi 17 janvier 2007 19:29, Ralf Baechle a écrit :
> On Wed, Jan 17, 2007 at 07:04:23PM +0100, Florian Fainelli wrote:
> > This should take into account everything that has been said before.
>
> It does (thanks!) - but it arrived in my mailbox is nicely line wrapped
> ASCII jibberish, no longer a valid patch ...
>
> Ralf
[-- Attachment #2: leds-cobalt.patch --]
[-- Type: text/plain, Size: 2836 bytes --]
diff -urN linux-2.6.19.1/drivers/leds/Kconfig linux-2.6.19.1.led/drivers/leds/Kconfig
--- linux-2.6.19.1/drivers/leds/Kconfig 2006-12-11 20:32:53.000000000 +0100
+++ linux-2.6.19.1.led/drivers/leds/Kconfig 2007-01-15 19:22:00.000000000 +0100
@@ -76,6 +76,12 @@
This option enables support for the Soekris net4801 and net4826 error
LED.
+config LEDS_COBALT
+ tristate "LED Support for Cobalt Server front LED"
+ depends on LEDS_CLASS && MIPS_COBALT
+ help
+ This option enables support for the front LED on Cobalt Server
+
comment "LED Triggers"
config LEDS_TRIGGERS
diff -urN linux-2.6.19.1/drivers/leds/leds-cobalt.c linux-2.6.19.1.led/drivers/leds/leds-cobalt.c
--- linux-2.6.19.1/drivers/leds/leds-cobalt.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.1.led/drivers/leds/leds-cobalt.c 2007-01-17 19:35:15.000000000 +0100
@@ -0,0 +1,55 @@
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/leds.h>
+#include <asm/mach-cobalt/cobalt.h>
+
+/* Copyright 2006 - Florian Fainelli <florian@openwrt.org>
+ *
+ * This driver let you control the Cobalt Qube/RaQ front LED
+ *
+ * 255 (max brightness) -> turn the led on
+ * 0 -> turn the led off
+ *
+ * If you want the LED to be blinking on IDE activity, select the IDE trigger
+ */
+
+static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness brightness)
+{
+ switch (brightness) {
+ case LED_OFF:
+ COBALT_LED_PORT = 0;
+ break;
+ case LED_FULL:
+ COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+ break;
+ default:
+ return;
+ }
+}
+
+static struct led_classdev cobalt_led = {
+ .name = "cobalt-front-led",
+ .brightness_set = cobalt_led_set,
+#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK
+ .default_trigger = "ide-disk",
+#endif
+};
+
+static int __init cobalt_led_init(void)
+{
+ return led_classdev_register(NULL, &cobalt_led);
+}
+
+static void __exit cobalt_led_exit(void)
+{
+ led_classdev_unregister(&cobalt_led);
+}
+
+module_init(cobalt_led_init);
+module_exit(cobalt_led_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Front LED support for Cobalt Server");
+MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
diff -urN linux-2.6.19.1/drivers/leds/Makefile linux-2.6.19.1.led/drivers/leds/Makefile
--- linux-2.6.19.1/drivers/leds/Makefile 2006-12-11 20:32:53.000000000 +0100
+++ linux-2.6.19.1.led/drivers/leds/Makefile 2007-01-15 19:22:18.000000000 +0100
@@ -13,6 +13,7 @@
obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o
obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
+obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o
# LED Triggers
obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add support for Cobalt Server front LED
2007-01-15 18:36 [PATCH] Add support for Cobalt Server front LED Florian Fainelli
2007-01-15 22:42 ` Yoichi Yuasa
@ 2007-01-16 9:53 ` Peter Horton
2007-01-16 10:14 ` Florian Fainelli
1 sibling, 1 reply; 10+ messages in thread
From: Peter Horton @ 2007-01-16 9:53 UTC (permalink / raw)
To: Florian Fainelli; +Cc: linux-mips
Florian Fainelli wrote:
>
> This patch adds support for controlling the front LED on Cobalt Server. It has
> been tested on Qube 2 with either no default trigger, or the IDE-activity
> trigger. Both work fine. Please comment and test !
>
Why did you add COBALT_LED_BASE when there was already a COBALT_LED_PORT
define on the line above ?
All your
*(volatile uint8_t *) COBALT_LED_BASE = n;
can be replaced by
COBALT_LED_PORT = n;
P.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-01-17 18:39 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-15 18:36 [PATCH] Add support for Cobalt Server front LED Florian Fainelli
2007-01-15 22:42 ` Yoichi Yuasa
2007-01-15 23:33 ` Florian Fainelli
2007-01-15 23:56 ` Florian Fainelli
2007-01-17 16:46 ` Ralf Baechle
2007-01-17 18:04 ` Florian Fainelli
2007-01-17 18:29 ` Ralf Baechle
2007-01-17 18:37 ` Florian Fainelli
2007-01-16 9:53 ` Peter Horton
2007-01-16 10:14 ` Florian Fainelli
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.