* [PATCH][1/6] led: rename leds-cobalt
@ 2007-09-20 14:02 Yoichi Yuasa
2007-09-20 14:03 ` [PATCH][2/6] led: add Cobalt Raq series LEDs support Yoichi Yuasa
2007-09-20 14:17 ` [PATCH][1/6] led: rename leds-cobalt Florian Fainelli
0 siblings, 2 replies; 15+ messages in thread
From: Yoichi Yuasa @ 2007-09-20 14:02 UTC (permalink / raw)
To: Richard Purdie; +Cc: yoichi_yuasa, Ralf Baechle, linux-mips
The leds-cobalt driver only supports the Coable Qube series
(not included in Cobalt Raq series).
This patch has fixed Kconfig and renamed the driver.
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Kconfig mips/drivers/leds/Kconfig
--- mips-orig/drivers/leds/Kconfig 2007-09-14 12:11:41.222575000 +0900
+++ mips/drivers/leds/Kconfig 2007-09-14 12:12:06.820174750 +0900
@@ -87,11 +87,11 @@ config LEDS_H1940
help
This option enables support for the LEDs on the h1940.
-config LEDS_COBALT
- tristate "LED Support for Cobalt Server front LED"
+config LEDS_COBALT_QUBE
+ tristate "LED Support for the Cobalt Qube series front LED"
depends on LEDS_CLASS && MIPS_COBALT
help
- This option enables support for the front LED on Cobalt Server
+ This option enables support for the front LED on Cobalt Qube series
config LEDS_GPIO
tristate "LED Support for GPIO connected LEDs"
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Makefile mips/drivers/leds/Makefile
--- mips-orig/drivers/leds/Makefile 2007-09-14 12:11:41.234575750 +0900
+++ mips/drivers/leds/Makefile 2007-09-14 12:11:23.217449750 +0900
@@ -15,7 +15,7 @@ obj-$(CONFIG_LEDS_AMS_DELTA) += leds-am
obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
obj-$(CONFIG_LEDS_H1940) += leds-h1940.o
-obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o
+obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
# LED Triggers
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
--- mips-orig/drivers/leds/leds-cobalt-qube.c 1970-01-01 09:00:00.000000000 +0900
+++ mips/drivers/leds/leds-cobalt-qube.c 2007-09-14 12:11:23.217449750 +0900
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 - Florian Fainelli <florian@openwrt.org>
+ *
+ * Control the Cobalt Qube series front LED
+ */
+
+#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>
+
+static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness brightness)
+{
+ if (brightness)
+ COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+ else
+ COBALT_LED_PORT = 0;
+}
+
+static struct led_classdev cobalt_led = {
+ .name = "cobalt-front-led",
+ .brightness_set = cobalt_led_set,
+ .default_trigger = "ide-disk",
+};
+
+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 Qube series");
+MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/leds-cobalt.c mips/drivers/leds/leds-cobalt.c
--- mips-orig/drivers/leds/leds-cobalt.c 2007-09-14 12:11:41.258577250 +0900
+++ mips/drivers/leds/leds-cobalt.c 1970-01-01 09:00:00.000000000 +0900
@@ -1,43 +0,0 @@
-/*
- * Copyright 2006 - Florian Fainelli <florian@openwrt.org>
- *
- * Control the Cobalt Qube/RaQ front LED
- */
-
-#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>
-
-static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness brightness)
-{
- if (brightness)
- COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
- else
- COBALT_LED_PORT = 0;
-}
-
-static struct led_classdev cobalt_led = {
- .name = "cobalt-front-led",
- .brightness_set = cobalt_led_set,
- .default_trigger = "ide-disk",
-};
-
-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>");
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH][2/6] led: add Cobalt Raq series LEDs support
2007-09-20 14:02 [PATCH][1/6] led: rename leds-cobalt Yoichi Yuasa
@ 2007-09-20 14:03 ` Yoichi Yuasa
2007-09-20 14:05 ` [PATCH][3/6]led: add Cobalt Raq LEDs platform register Yoichi Yuasa
` (2 more replies)
2007-09-20 14:17 ` [PATCH][1/6] led: rename leds-cobalt Florian Fainelli
1 sibling, 3 replies; 15+ messages in thread
From: Yoichi Yuasa @ 2007-09-20 14:03 UTC (permalink / raw)
To: Richard Purdie; +Cc: yoichi_yuasa, Ralf Baechle, linux-mips
Add Cobalt Raq series LEDs support.
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Kconfig mips/drivers/leds/Kconfig
--- mips-orig/drivers/leds/Kconfig 2007-09-14 13:05:27.969928000 +0900
+++ mips/drivers/leds/Kconfig 2007-09-14 13:05:39.450645500 +0900
@@ -93,6 +93,13 @@ config LEDS_COBALT_QUBE
help
This option enables support for the front LED on Cobalt Qube series
+config LEDS_COBALT_RAQ
+ bool "LED Support for the Cobalt Raq series"
+ depends on LEDS_CLASS && MIPS_COBALT
+ select LEDS_TRIGGERS
+ help
+ This option enables support for the Cobalt Raq series LEDs.
+
config LEDS_GPIO
tristate "LED Support for GPIO connected LEDs"
depends on LEDS_CLASS && GENERIC_GPIO
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Makefile mips/drivers/leds/Makefile
--- mips-orig/drivers/leds/Makefile 2007-09-14 13:05:27.981928750 +0900
+++ mips/drivers/leds/Makefile 2007-09-14 13:05:39.450645500 +0900
@@ -16,6 +16,7 @@ obj-$(CONFIG_LEDS_NET48XX) += leds-net4
obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
obj-$(CONFIG_LEDS_H1940) += leds-h1940.o
obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
+obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
# LED Triggers
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
--- mips-orig/drivers/leds/leds-cobalt-raq.c 1970-01-01 09:00:00.000000000 +0900
+++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-14 13:06:03.900173500 +0900
@@ -0,0 +1,135 @@
+/*
+ * LEDs driver for the Cobalt Raq series.
+ *
+ * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/leds.h>
+#include <linux/platform_device.h>
+#include <linux/spinlock.h>
+#include <linux/types.h>
+
+#include <asm/io.h>
+
+#define LED_WEB 0x04
+#define LED_POWER_OFF 0x08
+
+static void __iomem *led_port;
+static u8 led_value;
+static DEFINE_SPINLOCK(led_value_lock);
+
+static void raq_web_led_set(struct led_classdev *led_cdev,
+ enum led_brightness brightness)
+{
+ spin_lock_irq(&led_value_lock);
+
+ if (brightness)
+ led_value |= LED_WEB;
+ else
+ led_value &= ~LED_WEB;
+ writeb(led_value, led_port);
+
+ spin_unlock_irq(&led_value_lock);
+}
+
+static struct led_classdev raq_web_led = {
+ .name = "raq-web",
+ .brightness_set = raq_web_led_set,
+};
+
+static void raq_power_off_led_set(struct led_classdev *led_cdev,
+ enum led_brightness brightness)
+{
+ spin_lock_irq(&led_value_lock);
+
+ if (brightness)
+ led_value |= LED_POWER_OFF;
+ else
+ led_value &= ~LED_POWER_OFF;
+ writeb(led_value, led_port);
+
+ spin_unlock_irq(&led_value_lock);
+}
+
+static struct led_classdev raq_power_off_led = {
+ .name = "raq-power-off",
+ .brightness_set = raq_power_off_led_set,
+ .default_trigger = "power-off",
+};
+
+static int __devinit cobalt_raq_led_probe(struct platform_device *pdev)
+{
+ struct resource *res;
+ int retval;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res)
+ return -EBUSY;
+
+ led_port = ioremap(res->start, res->end - res->start + 1);
+ if (!led_port)
+ return -ENOMEM;
+
+ retval = led_classdev_register(&pdev->dev, &raq_power_off_led);
+ if (retval)
+ goto err_iounmap;
+
+ retval = led_classdev_register(&pdev->dev, &raq_web_led);
+ if (retval)
+ goto err_unregister;
+
+ return 0;
+
+err_unregister:
+ led_classdev_unregister(&raq_power_off_led);
+
+err_iounmap:
+ iounmap(led_port);
+ led_port = NULL;
+
+ return retval;
+}
+
+static int __devexit cobalt_raq_led_remove(struct platform_device *pdev)
+{
+ led_classdev_unregister(&raq_power_off_led);
+ led_classdev_unregister(&raq_web_led);
+
+ if (led_port) {
+ iounmap(led_port);
+ led_port = NULL;
+ }
+
+ return 0;
+}
+
+static struct platform_driver cobalt_raq_led_driver = {
+ .probe = cobalt_raq_led_probe,
+ .remove = __devexit_p(cobalt_raq_led_remove),
+ .driver = {
+ .name = "Cobalt Raq LEDs",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init cobalt_raq_led_init(void)
+{
+ return platform_driver_register(&cobalt_raq_led_driver);
+}
+
+module_init(cobalt_raq_led_init);
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH][3/6]led: add Cobalt Raq LEDs platform register
2007-09-20 14:03 ` [PATCH][2/6] led: add Cobalt Raq series LEDs support Yoichi Yuasa
@ 2007-09-20 14:05 ` Yoichi Yuasa
2007-09-20 14:06 ` [PATCH][4/6] led: update Cobalt Qube series front LED support Yoichi Yuasa
2007-09-20 16:31 ` [PATCH][3/6]led: add Cobalt Raq LEDs platform register Ralf Baechle
2007-09-20 16:00 ` [PATCH][2/6] led: add Cobalt Raq series LEDs support Ralf Baechle
2007-09-20 22:51 ` Richard Purdie
2 siblings, 2 replies; 15+ messages in thread
From: Yoichi Yuasa @ 2007-09-20 14:05 UTC (permalink / raw)
To: Ralf Baechle; +Cc: yoichi_yuasa, Richard Purdie, linux-mips
Add Cobalt Raq LED platform register and power off trigger.
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/cobalt/Makefile mips/arch/mips/cobalt/Makefile
--- mips-orig/arch/mips/cobalt/Makefile 2007-09-20 10:17:53.325755750 +0900
+++ mips/arch/mips/cobalt/Makefile 2007-09-20 10:27:39.366381000 +0900
@@ -2,7 +2,7 @@
# Makefile for the Cobalt micro systems family specific parts of the kernel
#
-obj-y := buttons.o irq.o reset.o rtc.o serial.o setup.o
+obj-y := buttons.o irq.o led.o reset.o rtc.o serial.o setup.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_EARLY_PRINTK) += console.o
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/cobalt/led.c mips/arch/mips/cobalt/led.c
--- mips-orig/arch/mips/cobalt/led.c 1970-01-01 09:00:00.000000000 +0900
+++ mips/arch/mips/cobalt/led.c 2007-09-20 10:27:39.370381250 +0900
@@ -0,0 +1,56 @@
+/*
+ * Registration of Cobalt LED platform device.
+ *
+ * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/platform_device.h>
+
+static struct resource cobalt_led_resource __initdata = {
+ .start = 0x1c000000,
+ .end = 0x1c000000,
+ .flags = IORESOURCE_MEM,
+};
+
+static __init int cobalt_led_add(void)
+{
+ struct platform_device *pdev;
+ int retval;
+
+ pdev = platform_device_alloc("Cobalt Raq LEDs", -1);
+
+ if (!pdev)
+ return -ENOMEM;
+
+ retval = platform_device_add_resources(pdev, &cobalt_led_resource, 1);
+ if (retval)
+ goto err_free_device;
+
+ retval = platform_device_add(pdev);
+ if (retval)
+ goto err_free_device;
+
+ return 0;
+
+err_free_device:
+ platform_device_put(pdev);
+
+ return retval;
+}
+device_initcall(cobalt_led_add);
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/cobalt/reset.c mips/arch/mips/cobalt/reset.c
--- mips-orig/arch/mips/cobalt/reset.c 2007-09-20 10:17:53.349757250 +0900
+++ mips/arch/mips/cobalt/reset.c 2007-09-20 14:13:09.917504000 +0900
@@ -8,31 +8,37 @@
* Copyright (C) 1995, 1996, 1997 by Ralf Baechle
* Copyright (C) 2001 by Liam Davies (ldavies@agile.tv)
*/
+#include <linux/init.h>
#include <linux/jiffies.h>
-
-#include <asm/io.h>
-#include <asm/reboot.h>
+#include <linux/leds.h>
#include <cobalt.h>
+DEFINE_LED_TRIGGER(power_off_led_trigger);
+
+static int __init ledtrig_power_off_init(void)
+{
+ led_trigger_register_simple("power-off", &power_off_led_trigger);
+ return 0;
+}
+device_initcall(ledtrig_power_off_init);
+
void cobalt_machine_halt(void)
{
int state, last, diff;
unsigned long mark;
/*
- * turn off bar on Qube, flash power off LED on RaQ (0.5Hz)
+ * turn on power off LED on RaQ
*
* restart if ENTER and SELECT are pressed
*/
last = COBALT_KEY_PORT;
- for (state = 0;;) {
-
- state ^= COBALT_LED_POWER_OFF;
- COBALT_LED_PORT = state;
+ led_trigger_event(power_off_led_trigger, LED_FULL);
+ for (state = 0;;) {
diff = COBALT_KEY_PORT ^ last;
last ^= diff;
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH][4/6] led: update Cobalt Qube series front LED support
2007-09-20 14:05 ` [PATCH][3/6]led: add Cobalt Raq LEDs platform register Yoichi Yuasa
@ 2007-09-20 14:06 ` Yoichi Yuasa
2007-09-20 14:08 ` [PATCH][5/6] led: add Cobalt Qube series front LED support to platform register Yoichi Yuasa
2007-09-20 16:38 ` [PATCH][4/6] led: update Cobalt Qube series front LED support Ralf Baechle
2007-09-20 16:31 ` [PATCH][3/6]led: add Cobalt Raq LEDs platform register Ralf Baechle
1 sibling, 2 replies; 15+ messages in thread
From: Yoichi Yuasa @ 2007-09-20 14:06 UTC (permalink / raw)
To: Richard Purdie; +Cc: yoichi_yuasa, Ralf Baechle, linux-mips
Update Cobalt Qube series front LED support.
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
--- mips-orig/drivers/leds/leds-cobalt-qube.c 2007-09-14 11:16:22.397075500 +0900
+++ mips/drivers/leds/leds-cobalt-qube.c 2007-09-14 11:38:52.797470250 +0900
@@ -3,40 +3,100 @@
*
* Control the Cobalt Qube series front LED
*/
-
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/leds.h>
#include <linux/module.h>
+#include <linux/platform_device.h>
#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/device.h>
-#include <linux/leds.h>
-#include <asm/mach-cobalt/cobalt.h>
-static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness brightness)
+#include <asm/io.h>
+
+#define LED_FRONT_LEFT 0x01
+#define LED_FRONT_RIGHT 0x02
+
+static void __iomem *led_port;
+static u8 led_value;
+
+static void qube_front_led_set(struct led_classdev *led_cdev,
+ enum led_brightness brightness)
{
if (brightness)
- COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+ led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT;
else
- COBALT_LED_PORT = 0;
+ led_value = ~(LED_FRONT_LEFT | LED_FRONT_RIGHT);
+ writeb(led_value, led_port);
+}
+
+static struct led_classdev qube_front_led = {
+ .name = "qube-front",
+ .brightness = LED_FULL,
+ .brightness_set = qube_front_led_set,
+ .default_trigger = "ide-disk",
+};
+
+static int __devinit cobalt_qube_led_probe(struct platform_device *pdev)
+{
+ struct resource *res;
+ int retval;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res)
+ return -EBUSY;
+
+ led_port = ioremap(res->start, res->end - res->start + 1);
+ if (!led_port)
+ return -ENOMEM;
+
+ led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT;
+ writeb(led_value, led_port);
+
+ retval = led_classdev_register(&pdev->dev, &qube_front_led);
+ if (retval)
+ goto err_iounmap;
+
+ return 0;
+
+err_iounmap:
+ iounmap(led_port);
+ led_port = NULL;
+
+ return retval;
+}
+
+static int __devexit cobalt_qube_led_remove(struct platform_device *pdev)
+{
+ led_classdev_unregister(&qube_front_led);
+
+ if (led_port) {
+ iounmap(led_port);
+ led_port = NULL;
+ }
+
+ return 0;
}
-static struct led_classdev cobalt_led = {
- .name = "cobalt-front-led",
- .brightness_set = cobalt_led_set,
- .default_trigger = "ide-disk",
+static struct platform_driver cobalt_qube_led_driver = {
+ .probe = cobalt_qube_led_probe,
+ .remove = __devexit_p(cobalt_qube_led_remove),
+ .driver = {
+ .name = "Cobalt Qube LEDs",
+ .owner = THIS_MODULE,
+ },
};
-static int __init cobalt_led_init(void)
+static int __init cobalt_qube_led_init(void)
{
- return led_classdev_register(NULL, &cobalt_led);
+ return platform_driver_register(&cobalt_qube_led_driver);
}
-static void __exit cobalt_led_exit(void)
+static void __exit cobalt_qube_led_exit(void)
{
- led_classdev_unregister(&cobalt_led);
+ platform_driver_unregister(&cobalt_qube_led_driver);
}
-module_init(cobalt_led_init);
-module_exit(cobalt_led_exit);
+module_init(cobalt_qube_led_init);
+module_exit(cobalt_qube_led_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Front LED support for Cobalt Qube series");
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH][5/6] led: add Cobalt Qube series front LED support to platform register
2007-09-20 14:06 ` [PATCH][4/6] led: update Cobalt Qube series front LED support Yoichi Yuasa
@ 2007-09-20 14:08 ` Yoichi Yuasa
2007-09-20 14:10 ` [PATCH][6/6] led: add LED support to cobalt_defconfig Yoichi Yuasa
2007-09-20 16:40 ` [PATCH][5/6] led: add Cobalt Qube series front LED support to platform register Ralf Baechle
2007-09-20 16:38 ` [PATCH][4/6] led: update Cobalt Qube series front LED support Ralf Baechle
1 sibling, 2 replies; 15+ messages in thread
From: Yoichi Yuasa @ 2007-09-20 14:08 UTC (permalink / raw)
To: Ralf Baechle; +Cc: yoichi_yuasa, Richard Purdie, linux-mips
Add Cobalt Qube series front LED support to platform register.
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/cobalt/led.c mips/arch/mips/cobalt/led.c
--- mips-orig/arch/mips/cobalt/led.c 2007-09-12 13:48:40.740621250 +0900
+++ mips/arch/mips/cobalt/led.c 2007-09-12 13:47:59.474042250 +0900
@@ -22,6 +22,8 @@
#include <linux/ioport.h>
#include <linux/platform_device.h>
+#include <cobalt.h>
+
static struct resource cobalt_led_resource __initdata = {
.start = 0x1c000000,
.end = 0x1c000000,
@@ -33,7 +35,11 @@ static __init int cobalt_led_add(void)
struct platform_device *pdev;
int retval;
- pdev = platform_device_alloc("Cobalt Raq LEDs", -1);
+ if (cobalt_board_id == COBALT_BRD_ID_QUBE1 ||
+ cobalt_board_id == COBALT_BRD_ID_QUBE2)
+ pdev = platform_device_alloc("Cobalt Qube LEDs", -1);
+ else
+ pdev = platform_device_alloc("Cobalt Raq LEDs", -1);
if (!pdev)
return -ENOMEM;
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH][6/6] led: add LED support to cobalt_defconfig
2007-09-20 14:08 ` [PATCH][5/6] led: add Cobalt Qube series front LED support to platform register Yoichi Yuasa
@ 2007-09-20 14:10 ` Yoichi Yuasa
2007-09-20 16:41 ` Ralf Baechle
2007-09-20 16:40 ` [PATCH][5/6] led: add Cobalt Qube series front LED support to platform register Ralf Baechle
1 sibling, 1 reply; 15+ messages in thread
From: Yoichi Yuasa @ 2007-09-20 14:10 UTC (permalink / raw)
To: Ralf Baechle; +Cc: yoichi_yuasa, Richard Purdie, linux-mips
Add LED support to cobalt_defconfig.
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/configs/cobalt_defconfig mips/arch/mips/configs/cobalt_defconfig
--- mips-orig/arch/mips/configs/cobalt_defconfig 2007-09-06 13:09:26.597218500 +0900
+++ mips/arch/mips/configs/cobalt_defconfig 2007-09-06 13:21:20.681846000 +0900
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc2
-# Tue Aug 7 22:12:54 2007
+# Linux kernel version: 2.6.23-rc5
+# Thu Sep 6 13:14:29 2007
#
CONFIG_MIPS=y
@@ -55,12 +55,14 @@ CONFIG_DMA_NONCOHERENT=y
CONFIG_DMA_NEED_PCI_MAP_STATE=y
CONFIG_EARLY_PRINTK=y
CONFIG_SYS_HAS_EARLY_PRINTK=y
+# CONFIG_HOTPLUG_CPU is not set
CONFIG_I8259=y
# CONFIG_NO_IOPORT is not set
# CONFIG_CPU_BIG_ENDIAN is not set
CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
CONFIG_IRQ_CPU=y
+CONFIG_IRQ_GT641XX=y
CONFIG_PCI_GT64XXX_PCI0=y
CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -235,6 +237,7 @@ CONFIG_TRAD_SIGNALS=y
# Power management options
#
# CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
#
# Networking
@@ -844,7 +847,21 @@ CONFIG_USB_MON=y
#
# CONFIG_USB_GADGET is not set
# CONFIG_MMC is not set
-# CONFIG_NEW_LEDS is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_COBALT_QUBE=y
+CONFIG_LEDS_COBALT_RAQ=y
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+# CONFIG_LEDS_TRIGGER_TIMER is not set
+# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
# CONFIG_INFINIBAND is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH][1/6] led: rename leds-cobalt
2007-09-20 14:02 [PATCH][1/6] led: rename leds-cobalt Yoichi Yuasa
2007-09-20 14:03 ` [PATCH][2/6] led: add Cobalt Raq series LEDs support Yoichi Yuasa
@ 2007-09-20 14:17 ` Florian Fainelli
2007-09-20 23:05 ` Richard Purdie
1 sibling, 1 reply; 15+ messages in thread
From: Florian Fainelli @ 2007-09-20 14:17 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: Richard Purdie, Ralf Baechle, linux-mips
[-- Attachment #1: Type: text/plain, Size: 431 bytes --]
Le jeudi 20 septembre 2007, Yoichi Yuasa a écrit :
> The leds-cobalt driver only supports the Coable Qube series
> (not included in Cobalt Raq series).
> This patch has fixed Kconfig and renamed the driver.
>
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
>
Acked-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Thanks Yoichi !
--
Cordialement, Florian Fainelli
------------------------------
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH][2/6] led: add Cobalt Raq series LEDs support
2007-09-20 14:03 ` [PATCH][2/6] led: add Cobalt Raq series LEDs support Yoichi Yuasa
2007-09-20 14:05 ` [PATCH][3/6]led: add Cobalt Raq LEDs platform register Yoichi Yuasa
@ 2007-09-20 16:00 ` Ralf Baechle
2007-09-21 2:29 ` Yoichi Yuasa
2007-09-20 22:51 ` Richard Purdie
2 siblings, 1 reply; 15+ messages in thread
From: Ralf Baechle @ 2007-09-20 16:00 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: Richard Purdie, linux-mips
On Thu, Sep 20, 2007 at 11:03:22PM +0900, Yoichi Yuasa wrote:
> diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
> --- mips-orig/drivers/leds/leds-cobalt-raq.c 1970-01-01 09:00:00.000000000 +0900
> +++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-14 13:06:03.900173500 +0900
> @@ -0,0 +1,135 @@
> +/*
> + * LEDs driver for the Cobalt Raq series.
> + *
> + * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
Do you really want to allow version 2 or newer? (Just checking)
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +#include <linux/init.h>
> +#include <linux/ioport.h>
> +#include <linux/leds.h>
> +#include <linux/platform_device.h>
> +#include <linux/spinlock.h>
> +#include <linux/types.h>
> +
> +#include <asm/io.h>
This should be <linux/io.h>
> +
> +#define LED_WEB 0x04
> +#define LED_POWER_OFF 0x08
> +
> +static void __iomem *led_port;
> +static u8 led_value;
> +static DEFINE_SPINLOCK(led_value_lock);
> +
> +static void raq_web_led_set(struct led_classdev *led_cdev,
> + enum led_brightness brightness)
> +{
> + spin_lock_irq(&led_value_lock);
> +
> + if (brightness)
> + led_value |= LED_WEB;
> + else
> + led_value &= ~LED_WEB;
> + writeb(led_value, led_port);
> +
> + spin_unlock_irq(&led_value_lock);
> +}
> +
> +static struct led_classdev raq_web_led = {
> + .name = "raq-web",
> + .brightness_set = raq_web_led_set,
> +};
> +
> +static void raq_power_off_led_set(struct led_classdev *led_cdev,
> + enum led_brightness brightness)
> +{
> + spin_lock_irq(&led_value_lock);
> +
> + if (brightness)
> + led_value |= LED_POWER_OFF;
> + else
> + led_value &= ~LED_POWER_OFF;
> + writeb(led_value, led_port);
> +
> + spin_unlock_irq(&led_value_lock);
> +}
> +
> +static struct led_classdev raq_power_off_led = {
> + .name = "raq-power-off",
> + .brightness_set = raq_power_off_led_set,
> + .default_trigger = "power-off",
> +};
> +
> +static int __devinit cobalt_raq_led_probe(struct platform_device *pdev)
> +{
> + struct resource *res;
> + int retval;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res)
> + return -EBUSY;
> +
> + led_port = ioremap(res->start, res->end - res->start + 1);
> + if (!led_port)
> + return -ENOMEM;
> +
> + retval = led_classdev_register(&pdev->dev, &raq_power_off_led);
> + if (retval)
> + goto err_iounmap;
> +
> + retval = led_classdev_register(&pdev->dev, &raq_web_led);
> + if (retval)
> + goto err_unregister;
> +
> + return 0;
> +
> +err_unregister:
> + led_classdev_unregister(&raq_power_off_led);
> +
> +err_iounmap:
> + iounmap(led_port);
> + led_port = NULL;
> +
> + return retval;
> +}
> +
> +static int __devexit cobalt_raq_led_remove(struct platform_device *pdev)
> +{
> + led_classdev_unregister(&raq_power_off_led);
> + led_classdev_unregister(&raq_web_led);
> +
> + if (led_port) {
> + iounmap(led_port);
> + led_port = NULL;
> + }
> +
> + return 0;
> +}
> +
> +static struct platform_driver cobalt_raq_led_driver = {
> + .probe = cobalt_raq_led_probe,
> + .remove = __devexit_p(cobalt_raq_led_remove),
> + .driver = {
> + .name = "Cobalt Raq LEDs",
> + .owner = THIS_MODULE,
> + },
> +};
> +
> +static int __init cobalt_raq_led_init(void)
> +{
> + return platform_driver_register(&cobalt_raq_led_driver);
> +}
> +
> +module_init(cobalt_raq_led_init);
Ralf
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH][3/6]led: add Cobalt Raq LEDs platform register
2007-09-20 14:05 ` [PATCH][3/6]led: add Cobalt Raq LEDs platform register Yoichi Yuasa
2007-09-20 14:06 ` [PATCH][4/6] led: update Cobalt Qube series front LED support Yoichi Yuasa
@ 2007-09-20 16:31 ` Ralf Baechle
1 sibling, 0 replies; 15+ messages in thread
From: Ralf Baechle @ 2007-09-20 16:31 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: Richard Purdie, linux-mips
On Thu, Sep 20, 2007 at 11:05:13PM +0900, Yoichi Yuasa wrote:
> From: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/cobalt/Makefile mips/arch/mips/cobalt/Makefile
> --- mips-orig/arch/mips/cobalt/Makefile 2007-09-20 10:17:53.325755750 +0900
> +++ mips/arch/mips/cobalt/Makefile 2007-09-20 10:27:39.366381000 +0900
> @@ -2,7 +2,7 @@
> # Makefile for the Cobalt micro systems family specific parts of the kernel
> #
>
> -obj-y := buttons.o irq.o reset.o rtc.o serial.o setup.o
> +obj-y := buttons.o irq.o led.o reset.o rtc.o serial.o setup.o
>
> obj-$(CONFIG_PCI) += pci.o
> obj-$(CONFIG_EARLY_PRINTK) += console.o
> diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/cobalt/led.c mips/arch/mips/cobalt/led.c
> --- mips-orig/arch/mips/cobalt/led.c 1970-01-01 09:00:00.000000000 +0900
> +++ mips/arch/mips/cobalt/led.c 2007-09-20 10:27:39.370381250 +0900
> @@ -0,0 +1,56 @@
> +/*
> + * Registration of Cobalt LED platform device.
> + *
> + * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +#include <linux/errno.h>
> +#include <linux/init.h>
> +#include <linux/ioport.h>
> +#include <linux/platform_device.h>
> +
> +static struct resource cobalt_led_resource __initdata = {
> + .start = 0x1c000000,
> + .end = 0x1c000000,
> + .flags = IORESOURCE_MEM,
> +};
> +
> +static __init int cobalt_led_add(void)
> +{
> + struct platform_device *pdev;
> + int retval;
> +
> + pdev = platform_device_alloc("Cobalt Raq LEDs", -1);
Can you make that string something all lowercase without spaces? The
device driver side (patch 2/6) would obviously need the same change.
Thanks,
ralf
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH][4/6] led: update Cobalt Qube series front LED support
2007-09-20 14:06 ` [PATCH][4/6] led: update Cobalt Qube series front LED support Yoichi Yuasa
2007-09-20 14:08 ` [PATCH][5/6] led: add Cobalt Qube series front LED support to platform register Yoichi Yuasa
@ 2007-09-20 16:38 ` Ralf Baechle
1 sibling, 0 replies; 15+ messages in thread
From: Ralf Baechle @ 2007-09-20 16:38 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: Richard Purdie, linux-mips
On Thu, Sep 20, 2007 at 11:06:56PM +0900, Yoichi Yuasa wrote:
> Update Cobalt Qube series front LED support.
>
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
>
> diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
> --- mips-orig/drivers/leds/leds-cobalt-qube.c 2007-09-14 11:16:22.397075500 +0900
> +++ mips/drivers/leds/leds-cobalt-qube.c 2007-09-14 11:38:52.797470250 +0900
> @@ -3,40 +3,100 @@
> *
> * Control the Cobalt Qube series front LED
> */
> -
> +#include <linux/init.h>
> +#include <linux/ioport.h>
> +#include <linux/leds.h>
> #include <linux/module.h>
> +#include <linux/platform_device.h>
> #include <linux/types.h>
> -#include <linux/kernel.h>
> -#include <linux/device.h>
> -#include <linux/leds.h>
> -#include <asm/mach-cobalt/cobalt.h>
>
> -static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness brightness)
> +#include <asm/io.h>
<linux/io.h>
> +
> +#define LED_FRONT_LEFT 0x01
> +#define LED_FRONT_RIGHT 0x02
> +
> +static void __iomem *led_port;
> +static u8 led_value;
> +
> +static void qube_front_led_set(struct led_classdev *led_cdev,
> + enum led_brightness brightness)
> {
> if (brightness)
> - COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
> + led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT;
> else
> - COBALT_LED_PORT = 0;
> + led_value = ~(LED_FRONT_LEFT | LED_FRONT_RIGHT);
> + writeb(led_value, led_port);
> +}
> +
> +static struct led_classdev qube_front_led = {
> + .name = "qube-front",
> + .brightness = LED_FULL,
> + .brightness_set = qube_front_led_set,
> + .default_trigger = "ide-disk",
> +};
> +
> +static int __devinit cobalt_qube_led_probe(struct platform_device *pdev)
> +{
> + struct resource *res;
> + int retval;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res)
> + return -EBUSY;
> +
> + led_port = ioremap(res->start, res->end - res->start + 1);
> + if (!led_port)
> + return -ENOMEM;
> +
> + led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT;
> + writeb(led_value, led_port);
> +
> + retval = led_classdev_register(&pdev->dev, &qube_front_led);
> + if (retval)
> + goto err_iounmap;
> +
> + return 0;
> +
> +err_iounmap:
> + iounmap(led_port);
> + led_port = NULL;
> +
> + return retval;
> +}
> +
> +static int __devexit cobalt_qube_led_remove(struct platform_device *pdev)
> +{
> + led_classdev_unregister(&qube_front_led);
> +
> + if (led_port) {
> + iounmap(led_port);
> + led_port = NULL;
> + }
> +
> + return 0;
> }
>
> -static struct led_classdev cobalt_led = {
> - .name = "cobalt-front-led",
> - .brightness_set = cobalt_led_set,
> - .default_trigger = "ide-disk",
> +static struct platform_driver cobalt_qube_led_driver = {
> + .probe = cobalt_qube_led_probe,
> + .remove = __devexit_p(cobalt_qube_led_remove),
> + .driver = {
> + .name = "Cobalt Qube LEDs",
Again, please make this something lowercase without spaces.
> + .owner = THIS_MODULE,
> + },
> };
>
> -static int __init cobalt_led_init(void)
> +static int __init cobalt_qube_led_init(void)
> {
> - return led_classdev_register(NULL, &cobalt_led);
> + return platform_driver_register(&cobalt_qube_led_driver);
> }
>
> -static void __exit cobalt_led_exit(void)
> +static void __exit cobalt_qube_led_exit(void)
> {
> - led_classdev_unregister(&cobalt_led);
> + platform_driver_unregister(&cobalt_qube_led_driver);
> }
>
> -module_init(cobalt_led_init);
> -module_exit(cobalt_led_exit);
> +module_init(cobalt_qube_led_init);
> +module_exit(cobalt_qube_led_exit);
>
> MODULE_LICENSE("GPL");
> MODULE_DESCRIPTION("Front LED support for Cobalt Qube series");
Ralf
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH][5/6] led: add Cobalt Qube series front LED support to platform register
2007-09-20 14:08 ` [PATCH][5/6] led: add Cobalt Qube series front LED support to platform register Yoichi Yuasa
2007-09-20 14:10 ` [PATCH][6/6] led: add LED support to cobalt_defconfig Yoichi Yuasa
@ 2007-09-20 16:40 ` Ralf Baechle
1 sibling, 0 replies; 15+ messages in thread
From: Ralf Baechle @ 2007-09-20 16:40 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: Richard Purdie, linux-mips
On Thu, Sep 20, 2007 at 11:08:41PM +0900, Yoichi Yuasa wrote:
> Add Cobalt Qube series front LED support to platform register.
>
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
>
> diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/cobalt/led.c mips/arch/mips/cobalt/led.c
> --- mips-orig/arch/mips/cobalt/led.c 2007-09-12 13:48:40.740621250 +0900
> +++ mips/arch/mips/cobalt/led.c 2007-09-12 13:47:59.474042250 +0900
> @@ -22,6 +22,8 @@
> #include <linux/ioport.h>
> #include <linux/platform_device.h>
>
> +#include <cobalt.h>
> +
> static struct resource cobalt_led_resource __initdata = {
> .start = 0x1c000000,
> .end = 0x1c000000,
> @@ -33,7 +35,11 @@ static __init int cobalt_led_add(void)
> struct platform_device *pdev;
> int retval;
>
> - pdev = platform_device_alloc("Cobalt Raq LEDs", -1);
> + if (cobalt_board_id == COBALT_BRD_ID_QUBE1 ||
> + cobalt_board_id == COBALT_BRD_ID_QUBE2)
> + pdev = platform_device_alloc("Cobalt Qube LEDs", -1);
> + else
> + pdev = platform_device_alloc("Cobalt Raq LEDs", -1);
Same thing - can you make that string something all lowercase without
spaces?
>
> if (!pdev)
> return -ENOMEM;
Ralf
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH][6/6] led: add LED support to cobalt_defconfig
2007-09-20 14:10 ` [PATCH][6/6] led: add LED support to cobalt_defconfig Yoichi Yuasa
@ 2007-09-20 16:41 ` Ralf Baechle
0 siblings, 0 replies; 15+ messages in thread
From: Ralf Baechle @ 2007-09-20 16:41 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: Richard Purdie, linux-mips
On Thu, Sep 20, 2007 at 11:10:01PM +0900, Yoichi Yuasa wrote:
> Add LED support to cobalt_defconfig.
>
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Looks ok - will apply when you resubmit the others.
Ralf
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH][2/6] led: add Cobalt Raq series LEDs support
2007-09-20 14:03 ` [PATCH][2/6] led: add Cobalt Raq series LEDs support Yoichi Yuasa
2007-09-20 14:05 ` [PATCH][3/6]led: add Cobalt Raq LEDs platform register Yoichi Yuasa
2007-09-20 16:00 ` [PATCH][2/6] led: add Cobalt Raq series LEDs support Ralf Baechle
@ 2007-09-20 22:51 ` Richard Purdie
2 siblings, 0 replies; 15+ messages in thread
From: Richard Purdie @ 2007-09-20 22:51 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: Ralf Baechle, linux-mips
On Thu, 2007-09-20 at 23:03 +0900, Yoichi Yuasa wrote:
> Add Cobalt Raq series LEDs support.
>
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
>
[...]
> diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
> --- mips-orig/drivers/leds/leds-cobalt-raq.c 1970-01-01 09:00:00.000000000 +0900
> +++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-14 13:06:03.900173500 +0900
> @@ -0,0 +1,135 @@
[...]
> +static void __iomem *led_port;
> +static u8 led_value;
> +static DEFINE_SPINLOCK(led_value_lock);
> +
> +static void raq_web_led_set(struct led_classdev *led_cdev,
> + enum led_brightness brightness)
> +{
> + spin_lock_irq(&led_value_lock);
> +
> + if (brightness)
> + led_value |= LED_WEB;
> + else
> + led_value &= ~LED_WEB;
> + writeb(led_value, led_port);
> +
> + spin_unlock_irq(&led_value_lock);
> +}
You can't use the spin lock like that since the set function can get
called in interrupt context, you need to use irqsave/irqrestore
versions. I've already said this once...
Richard
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH][1/6] led: rename leds-cobalt
2007-09-20 14:17 ` [PATCH][1/6] led: rename leds-cobalt Florian Fainelli
@ 2007-09-20 23:05 ` Richard Purdie
0 siblings, 0 replies; 15+ messages in thread
From: Richard Purdie @ 2007-09-20 23:05 UTC (permalink / raw)
To: Florian Fainelli; +Cc: Yoichi Yuasa, Ralf Baechle, linux-mips
On Thu, 2007-09-20 at 16:17 +0200, Florian Fainelli wrote:
> Le jeudi 20 septembre 2007, Yoichi Yuasa a écrit :
> > The leds-cobalt driver only supports the Coable Qube series
> > (not included in Cobalt Raq series).
> > This patch has fixed Kconfig and renamed the driver.
> >
> > Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> >
> Acked-by: Florian Fainelli <florian.fainelli@telecomint.eu>
>
> Thanks Yoichi !
I've queued this on in the LEDs tree.
Cheers,
Richard
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH][2/6] led: add Cobalt Raq series LEDs support
2007-09-20 16:00 ` [PATCH][2/6] led: add Cobalt Raq series LEDs support Ralf Baechle
@ 2007-09-21 2:29 ` Yoichi Yuasa
0 siblings, 0 replies; 15+ messages in thread
From: Yoichi Yuasa @ 2007-09-21 2:29 UTC (permalink / raw)
To: Ralf Baechle; +Cc: yoichi_yuasa, Richard Purdie, linux-mips
On Thu, 20 Sep 2007 17:00:34 +0100
Ralf Baechle <ralf@linux-mips.org> wrote:
> On Thu, Sep 20, 2007 at 11:03:22PM +0900, Yoichi Yuasa wrote:
>
> > diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
> > --- mips-orig/drivers/leds/leds-cobalt-raq.c 1970-01-01 09:00:00.000000000 +0900
> > +++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-14 13:06:03.900173500 +0900
> > @@ -0,0 +1,135 @@
> > +/*
> > + * LEDs driver for the Cobalt Raq series.
> > + *
> > + * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
>
> Do you really want to allow version 2 or newer? (Just checking)
Yes I do.
Thank you for your comments.
I'll update soon.
Yoichi
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2007-09-21 2:29 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-20 14:02 [PATCH][1/6] led: rename leds-cobalt Yoichi Yuasa
2007-09-20 14:03 ` [PATCH][2/6] led: add Cobalt Raq series LEDs support Yoichi Yuasa
2007-09-20 14:05 ` [PATCH][3/6]led: add Cobalt Raq LEDs platform register Yoichi Yuasa
2007-09-20 14:06 ` [PATCH][4/6] led: update Cobalt Qube series front LED support Yoichi Yuasa
2007-09-20 14:08 ` [PATCH][5/6] led: add Cobalt Qube series front LED support to platform register Yoichi Yuasa
2007-09-20 14:10 ` [PATCH][6/6] led: add LED support to cobalt_defconfig Yoichi Yuasa
2007-09-20 16:41 ` Ralf Baechle
2007-09-20 16:40 ` [PATCH][5/6] led: add Cobalt Qube series front LED support to platform register Ralf Baechle
2007-09-20 16:38 ` [PATCH][4/6] led: update Cobalt Qube series front LED support Ralf Baechle
2007-09-20 16:31 ` [PATCH][3/6]led: add Cobalt Raq LEDs platform register Ralf Baechle
2007-09-20 16:00 ` [PATCH][2/6] led: add Cobalt Raq series LEDs support Ralf Baechle
2007-09-21 2:29 ` Yoichi Yuasa
2007-09-20 22:51 ` Richard Purdie
2007-09-20 14:17 ` [PATCH][1/6] led: rename leds-cobalt Florian Fainelli
2007-09-20 23:05 ` Richard Purdie
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.