Revision: 7529 http://sourceforge.net/p/ipcop/svn/7529 Author: owes Date: 2014-05-11 16:41:46 +0000 (Sun, 11 May 2014) Log Message: ----------- Add LED kernel driver for PCEngines APU
Modified Paths: -------------- ipcop/trunk/lfs/linux ipcop/trunk/updates/2.1.6/ROOTFILES.i486-2.1.6 Added Paths: ----------- ipcop/trunk/src/patches/linux-3.4_leds-apu.patch Modified: ipcop/trunk/lfs/linux =================================================================== --- ipcop/trunk/lfs/linux 2014-05-10 21:00:14 UTC (rev 7528) +++ ipcop/trunk/lfs/linux 2014-05-11 16:41:46 UTC (rev 7529) @@ -118,6 +118,9 @@ # LED Netdev Trigger #cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)_ledtrig-netdev.patch + # APU LEDs + cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)_leds-apu.patch + ifeq "$(GRSEC)" "yes" cd $(DIR_APP) && patch -Np1 -i $(DIR_DL)/$(GRSECURITYPATCH) # Remove test for binutils version, --build-id does not work for us and we have binutils > 2.18 Added: ipcop/trunk/src/patches/linux-3.4_leds-apu.patch =================================================================== --- ipcop/trunk/src/patches/linux-3.4_leds-apu.patch (rev 0) +++ ipcop/trunk/src/patches/linux-3.4_leds-apu.patch 2014-05-11 16:41:46 UTC (rev 7529) @@ -0,0 +1,180 @@ +--- null 1970-01-01 01:00:00.000000000 +0100 ++++ a/drivers/leds/leds-apu.c 2013-12-11 11:05:04.000000000 +0100 +@@ -0,0 +1,167 @@ ++/* ++ * LEDs driver for PCEngines apu ++ * ++ * Copyright (C) 2013 Christian Herzog <dad...@daduke.org>, based on ++ * Petr Leibman's leds-alix ++ * Based on leds-wrap.c ++ * Hardware info taken from http://www.dpie.com/manuals/miniboards/kontron/KTD-S0043-0_KTA55_SoftwareGuide.pdf ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include <linux/kernel.h> ++#include <linux/module.h> ++#include <linux/init.h> ++#include <linux/platform_device.h> ++#include <linux/leds.h> ++#include <linux/err.h> ++#include <asm/io.h> ++ ++#define DRVNAME "apu-led" ++#define BASEADDR (0xFED801BD) ++#define LEDON (0x8) ++#define LEDOFF (0xC8) ++ ++static struct platform_device *pdev; ++unsigned int *p1; ++unsigned int *p2; ++unsigned int *p3; ++ ++static void apu_led_set_1(struct led_classdev *led_cdev, ++ enum led_brightness value) { ++ if (value) ++ iowrite8(LEDON, p1); ++ else ++ iowrite8(LEDOFF, p1); ++} ++ ++static void apu_led_set_2(struct led_classdev *led_cdev, ++ enum led_brightness value) { ++ if (value) ++ iowrite8(LEDON, p2); ++ else ++ iowrite8(LEDOFF, p2); ++} ++ ++static void apu_led_set_3(struct led_classdev *led_cdev, ++ enum led_brightness value) { ++ if (value) ++ iowrite8(LEDON, p3); ++ else ++ iowrite8(LEDOFF, p3); ++} ++ ++static struct led_classdev apu_led_1 = { ++ .name = "apu:1", ++ .brightness_set = apu_led_set_1, ++}; ++ ++static struct led_classdev apu_led_2 = { ++ .name = "apu:2", ++ .brightness_set = apu_led_set_2, ++}; ++ ++static struct led_classdev apu_led_3 = { ++ .name = "apu:3", ++ .brightness_set = apu_led_set_3, ++}; ++ ++ ++#ifdef CONFIG_PM ++static int apu_led_suspend(struct platform_device *dev, ++ pm_message_t state) ++{ ++ led_classdev_suspend(&apu_led_1); ++ led_classdev_suspend(&apu_led_2); ++ led_classdev_suspend(&apu_led_3); ++ return 0; ++} ++ ++static int apu_led_resume(struct platform_device *dev) ++{ ++ led_classdev_resume(&apu_led_1); ++ led_classdev_resume(&apu_led_2); ++ led_classdev_resume(&apu_led_3); ++ return 0; ++} ++#else ++#define apu_led_suspend NULL ++#define apu_led_resume NULL ++#endif ++ ++static int apu_led_probe(struct platform_device *pdev) ++{ ++ int ret; ++ ++ ret = led_classdev_register(&pdev->dev, &apu_led_1); ++ if (ret == 0) ++ { ++ ret = led_classdev_register(&pdev->dev, &apu_led_2); ++ if (ret >= 0) ++ { ++ ret = led_classdev_register(&pdev->dev, &apu_led_3); ++ if (ret < 0) ++ led_classdev_unregister(&apu_led_2); ++ } ++ if (ret < 0) ++ led_classdev_unregister(&apu_led_1); ++ } ++ return ret; ++} ++ ++static int apu_led_remove(struct platform_device *pdev) ++{ ++ led_classdev_unregister(&apu_led_1); ++ led_classdev_unregister(&apu_led_2); ++ led_classdev_unregister(&apu_led_3); ++ return 0; ++} ++ ++static struct platform_driver apu_led_driver = { ++ .probe = apu_led_probe, ++ .remove = apu_led_remove, ++ .suspend = apu_led_suspend, ++ .resume = apu_led_resume, ++ .driver = { ++ .name = DRVNAME, ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __init apu_led_init(void) ++{ ++ int ret; ++ ++ ret = platform_driver_register(&apu_led_driver); ++ if (ret < 0) ++ goto out; ++ ++ pdev = platform_device_register_simple(DRVNAME, -1, NULL, 0); ++ if (IS_ERR(pdev)) { ++ ret = PTR_ERR(pdev); ++ platform_driver_unregister(&apu_led_driver); ++ goto out; ++ } ++ ++ p1 = ioremap(BASEADDR, 1); ++ p2 = ioremap(BASEADDR+1, 1); ++ p3 = ioremap(BASEADDR+2, 1); ++ ++out: ++ return ret; ++} ++ ++static void __exit apu_led_exit(void) ++{ ++ platform_device_unregister(pdev); ++ platform_driver_unregister(&apu_led_driver); ++} ++ ++module_init(apu_led_init); ++module_exit(apu_led_exit); ++ ++MODULE_AUTHOR("Christian Herzog"); ++MODULE_DESCRIPTION("PCEngines apu LED driver"); ++MODULE_LICENSE("GPL"); +--- a/drivers/leds/Makefile 2014-05-11 00:22:48.993420545 +0200 ++++ a/drivers/leds/Makefile 2014-05-11 00:24:02.000000000 +0200 +@@ -14,6 +14,7 @@ + obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o + obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o + obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o ++obj-m += leds-apu.o + obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o + obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o + obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunfire.o Modified: ipcop/trunk/updates/2.1.6/ROOTFILES.i486-2.1.6 =================================================================== --- ipcop/trunk/updates/2.1.6/ROOTFILES.i486-2.1.6 2014-05-10 21:00:14 UTC (rev 7528) +++ ipcop/trunk/updates/2.1.6/ROOTFILES.i486-2.1.6 2014-05-11 16:41:46 UTC (rev 7529) @@ -7,6 +7,9 @@ /usr/local/bin/restarthttpd /usr/local/bin/setreservedports.pl ## +## kernel module APU LED +/lib/modules/3.4-2/kernel/drivers/leds/leds-apu.ko.gz +## ## openssl patched /usr/lib/libssl.so.1.0.0 ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn