summaryrefslogtreecommitdiff
path: root/packages/linux/linux-ezx-2.6.21/a780-leds.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2007-05-19 09:38:22 +0000
committerKoen Kooi <koen@openembedded.org>2007-05-19 09:38:22 +0000
commitc50fe0c5f0eb2e243a4921e8576ba49db26483fc (patch)
tree45fbe157b566abc7dc092d7d1b5d34d0cdfec4ba /packages/linux/linux-ezx-2.6.21/a780-leds.patch
parenta338dfb607b7a17292b6ec719c2db6528e6a87ad (diff)
linux-ezx 2.6.21: update to r2011:
r2011: call send_readurb on bp_rdy signal from BP to keep BP communication active add asoc pxa2xx-ssp.c driver from asoc-v0.13rc3 r2010: * pxa-kbd.patch: Fix pxakbd bug: direct keys were not passed to userspace * a780-kbd.patch: Cleanup keycodes definition for a780, use unique keycodes so to avoid the double event problem occurring when the same keycode is used more than once. r2003: core: EZX subsystem ezx-phone.c file for each phone BP handshake code on a platform_driver (and another .patch) pm: fully functional suspend/resume (except for BP) reboot/poweroff new: a780 flip e680 lock switch bp: Kconfig entry to disable BP handshake (the watchdog dont start if we dont try to handshake) other: delete obsolete files r2002: * Implement vibrator handling for a780 using the leds class. r1999: * Port and readapt ezx-backlight patch. Let's use again the backlight class to handle lcd brightness. r1998: * Port leds patches for A780 and E680 (we still pollute ezx.c for now)
Diffstat (limited to 'packages/linux/linux-ezx-2.6.21/a780-leds.patch')
-rw-r--r--packages/linux/linux-ezx-2.6.21/a780-leds.patch181
1 files changed, 181 insertions, 0 deletions
diff --git a/packages/linux/linux-ezx-2.6.21/a780-leds.patch b/packages/linux/linux-ezx-2.6.21/a780-leds.patch
new file mode 100644
index 0000000000..09913df2ca
--- /dev/null
+++ b/packages/linux/linux-ezx-2.6.21/a780-leds.patch
@@ -0,0 +1,181 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+Index: linux-2.6.21/drivers/leds/Kconfig
+===================================================================
+--- linux-2.6.21.orig/drivers/leds/Kconfig 2007-05-08 04:09:08.000000000 -0300
++++ linux-2.6.21/drivers/leds/Kconfig 2007-05-08 14:09:03.000000000 -0300
+@@ -104,6 +104,13 @@
+ These triggers allow kernel events to drive the LEDs and can
+ be configured via sysfs. If unsure, say Y.
+
++config LEDS_A780
++ tristate "LED Support for the Motorola A780 GSM Phone"
++ depends LEDS_CLASS && PXA_EZX_A780
++ help
++ This option enables support for the LEDs on the
++ Motorola A780 GSM Phone.
++
+ config LEDS_TRIGGER_TIMER
+ tristate "LED Timer Trigger"
+ depends on LEDS_TRIGGERS
+Index: linux-2.6.21/drivers/leds/Makefile
+===================================================================
+--- linux-2.6.21.orig/drivers/leds/Makefile 2007-05-08 04:09:08.000000000 -0300
++++ linux-2.6.21/drivers/leds/Makefile 2007-05-08 14:09:03.000000000 -0300
+@@ -16,6 +16,7 @@
+ obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
+ obj-$(CONFIG_LEDS_H1940) += leds-h1940.o
+ obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o
++obj-$(CONFIG_LEDS_A780) += leds-a780.o
+
+ # LED Triggers
+ obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
+Index: linux-2.6.21/drivers/leds/leds-a780.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.21/drivers/leds/leds-a780.c 2007-05-08 14:09:03.000000000 -0300
+@@ -0,0 +1,122 @@
++/*
++ * EZX Platform LED Driver for the Motorola A780 GSM Phone
++ *
++ * Copyright 2006 Vanille-Media
++ *
++ * Author: Michael Lauer <mickey@Vanille.de>
++ *
++ * Based on keylight.c by Motorola and leds-corgi.c by Richard Purdie
++ *
++ * 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/platform_device.h>
++#include <linux/leds.h>
++#include <asm/arch/ezx-pcap.h>
++
++static void a780led_main_set(struct led_classdev *led_cdev, enum led_brightness value)
++{
++ if ( value > 31 ) value = 31;
++ printk( KERN_DEBUG "a780led_main_set: %d\n", value );
++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL0, value & 0x01);
++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL1, value & 0x02);
++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL2, value & 0x04);
++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL3, value & 0x08);
++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL_CTRL4, value & 0x10);
++}
++
++static void a780led_aux_set(struct led_classdev *led_cdev, enum led_brightness value)
++{
++ if ( value > 31 ) value = 31;
++ printk( KERN_DEBUG "a780led_aux_set: %d\n", value );
++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL0, value & 0x01);
++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL1, value & 0x02);
++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL2, value & 0x04);
++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL3, value & 0x08);
++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_PERIPH_BL2_CTRL4, value & 0x10);
++}
++
++static struct led_classdev a780_main_led = {
++ .name = "a780:main",
++ .default_trigger = "none",
++ .brightness_set = a780led_main_set,
++};
++
++static struct led_classdev a780_aux_led = {
++ .name = "a780:aux",
++ .default_trigger = "none",
++ .brightness_set = a780led_aux_set,
++};
++
++#ifdef CONFIG_PM
++static int a780led_suspend(struct platform_device *dev, pm_message_t state)
++{
++ led_classdev_suspend(&a780_main_led);
++ led_classdev_suspend(&a780_aux_led);
++ return 0;
++}
++
++static int a780led_resume(struct platform_device *dev)
++{
++ led_classdev_resume(&a780_main_led);
++ led_classdev_resume(&a780_aux_led);
++ return 0;
++}
++#endif
++
++static int a780led_probe(struct platform_device *pdev)
++{
++ int ret;
++
++ ret = led_classdev_register(&pdev->dev, &a780_main_led);
++ if (ret < 0)
++ return ret;
++
++ ret = led_classdev_register(&pdev->dev, &a780_aux_led);
++ if (ret < 0)
++ led_classdev_unregister(&a780_main_led);
++
++ return ret;
++}
++
++static int a780led_remove(struct platform_device *pdev)
++{
++ led_classdev_unregister(&a780_main_led);
++ led_classdev_unregister(&a780_aux_led);
++ return 0;
++}
++
++static struct platform_driver a780led_driver = {
++ .probe = a780led_probe,
++ .remove = a780led_remove,
++#ifdef CONFIG_PM
++ .suspend = a780led_suspend,
++ .resume = a780led_resume,
++#endif
++ .driver = {
++ .name = "a780-led",
++ },
++};
++
++static int __init a780led_init(void)
++{
++ return platform_driver_register(&a780led_driver);
++}
++
++static void __exit a780led_exit(void)
++{
++ a780led_main_set( &a780_main_led, 0 );
++ a780led_aux_set( &a780_aux_led, 0 );
++ platform_driver_unregister(&a780led_driver);
++}
++
++module_init(a780led_init);
++module_exit(a780led_exit);
++
++MODULE_AUTHOR("Michael Lauer <mickey@Vanille.de>");
++MODULE_DESCRIPTION("Motorola A780 LED driver");
++MODULE_LICENSE("GPL");
+Index: linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c
+===================================================================
+--- linux-2.6.21.orig/arch/arm/mach-pxa/ezx-a780.c 2007-05-08 14:09:13.000000000 -0300
++++ linux-2.6.21/arch/arm/mach-pxa/ezx-a780.c 2007-05-08 14:11:37.000000000 -0300
+@@ -215,9 +215,14 @@
+ },
+ };
+
++static struct platform_device a780led_device = {
++ .name = "a780-led",
++ .id = -1,
++};
+
+ static struct platform_device *devices[] __initdata = {
+ &a780flip_device,
++ &a780led_device,
+ };
+
+ static void __init a780_init(void)