Led driver for technologic systems 5500
PATCH 1/1 Led driver for technologic systems 5500
Here is a patch for the led on the Technologic Systems 5500 board. Detection is a bit flimsy; Is there anything that can be done about that?
---
home/sean/tiger/linux-2.6.26/drivers/leds/Kconfig renamed from drivers/leds/Kconfig +10 -0
@@ -147,6 +147,16 @@ config LEDS_CLEVO_MAIL To compile this driver as a module, choose M here: the module will be called leds-clevo-mail. +config LEDS_TS5500 + tristate "LED Support for the TS-5500" + depends on LEDS_CLASS && X86 + help + This driver makes the led on the Technology Systems 5500 + (and possibly other models) accessible for userspace. + + Note that this led is hardwired to be xor'ed with Compact Flash + activity. + comment "LED Triggers" config LEDS_TRIGGERS
home/sean/tiger/linux-2.6.26/drivers/leds/leds-ts5500.c renamed from drivers/leds/leds-ts5500.c +99 -0
99 lines not on this page · raw message
home/sean/tiger/linux-2.6.26/drivers/leds/Makefile renamed from drivers/leds/Makefile +1 -0
@@ -21,6 +21,7 @@ obj-$(CONFIG_LEDS_CM_X270) obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o obj-$(CONFIG_LEDS_FSG) += leds-fsg.o +obj-$(CONFIG_LEDS_TS5500) += leds-ts5500.o # LED Triggers obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
Quoted 2 lines · Sean Young
Here is a patch for the led on the Technologic Systems 5500 board. Detection is a bit flimsy; Is there anything that can be done about that?
Does this system contain usable DMI info ? If yes, use dmi_check_system().
Quoted 142 lines
Signed-off-by Sean Young <[email protected]>---
diff -urpN linux-2.6.26/drivers/leds/Kconfig/home/sean/tiger/linux-2.6.26/drivers/leds/Kconfighome/sean/tiger/linux-2.6.26/drivers/leds/Kconfig renamed from drivers/leds/Kconfig +10
-0@@ -147,6 +147,16 @@ config LEDS_CLEVO_MAIL To compile this driver as a module, choose M here: the module will be called leds-clevo-mail. +config LEDS_TS5500 + tristate "LED Support for the TS-5500" + depends on LEDS_CLASS && X86 + help + This driver makes the led on the Technology Systems 5500 + (and possibly other models) accessible for userspace. + + Note that this led is hardwired to be xor'ed with Compact Flash + activity. + comment "LED Triggers" config LEDS_TRIGGERSdiff -urpN
linux-2.6.26/drivers/leds/leds-ts5500.c/home/sean/tiger/linux-2.6.26/drivers/leds/leds-ts5500.chome/sean/tiger/linux-2.6.26/drivers/leds/leds-ts5500.c renamed from drivers/leds/leds-ts5500.c +99
-0@@ -0,0 +1,99 @@ +/* +* Copyright (C) 2008 Sean Young <[email protected]> +*/ + +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/delay.h> +#include <linux/string.h> +#include <linux/io.h> +#include <linux/leds.h> + +static struct platform_device *ts5500_platform_device; + +static void ts5500_led_set (struct led_classdev *led_dev,enum led_brightness value) +{ +outb (value ?1 :0 ,0x77 ); +} + +static struct led_classdev ts5500_led = { + .name ="ts5500:green" , + .brightness_set = ts5500_led_set, +}; + +static int __devinit ts5500leds_probe (struct platform_device *pdev) +{ +return led_classdev_register (&pdev->dev, &ts5500_led); +} + +static int __devexit ts5500leds_remove(struct platform_device *pdev) +{ +led_classdev_unregister (&ts5500_led); +return 0 ; +} + +static struct platform_driver ts5500leds_driver = { + .driver = { + .name ="ts5500-leds" , + .owner =THIS_MODULE , + }, + .probe = ts5500leds_probe, + .remove =__devexit_p (ts5500leds_remove), +}; + + +static int __init ts5500leds_init (void ) +{ +int rc; +uint8_t product_code; + +if (!request_region (0x74 ,1 ,"ts5500-leds" )) +return -ENODEV ; + + product_code =inb (0x74 ); + +release_region (0x74 ,1 ); + +if (product_code !=0x60 ) +return -ENODEV ; + +if (!request_region (0x77 ,1 ,"ts5500-leds" )) +return -ENODEV ; + + rc =platform_driver_register (&ts5500leds_driver); +if (rc) + goto free_port; + + ts5500_platform_device =platform_device_alloc ("ts5500-leds" ,-1 ); +if (!ts5500_platform_device) + goto driver_unreg; + + rc =platform_device_add (ts5500_platform_device); +if (rc) + goto free_device; + +return 0 ; + +free_port: +release_region (0x77 ,1 ); +free_device: +platform_device_put (ts5500_platform_device); +driver_unreg: +platform_driver_unregister (&ts5500leds_driver); + +return rc; +} + +static void __exit ts5500leds_exit(void) +{ +platform_device_unregister (ts5500_platform_device); +platform_driver_unregister (&ts5500leds_driver); +release_region (0x77 ,1 ); +} + +module_init (ts5500leds_init); +module_exit (ts5500leds_exit); + +MODULE_AUTHOR ("Sean Young <[email protected]>" ); +MODULE_DESCRIPTION ("LED driver for the Technology Systems 5500" ); +MODULE_LICENSE ("GPL" );diff -urpN linux-2.6.26/drivers/leds/Makefile
/home/sean/tiger/linux-2.6.26/drivers/leds/Makefilehome/sean/tiger/linux-2.6.26/drivers/leds/Makefile renamed from drivers/leds/Makefile +1
-1@@ -21,6 +21,7 @@ obj-$(CONFIG_LEDS_CM_X270) obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o obj-$(CONFIG_LEDS_FSG) += leds-fsg.o +obj-$(CONFIG_LEDS_TS5500) += leds-ts5500.o # LED Triggers obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 2 lines
Andrey Panin | Linux and UNIX system administrator [email protected] | PGP key: wwwkeys.pgp.net
Quoted 5 lines · Andrey Panin
Quoted 2 lines · Sean Young
Here is a patch for the led on the Technologic Systems 5500 board. Detection is a bit flimsy; Is there anything that can be done about that?
Does this system contain usable DMI info ? If yes, use
dmi_check_system().
Unfortunately there is no DMI whatsoever.
Sean