summaryrefslogtreecommitdiff
path: root/packages/linux/linux-ezx
diff options
context:
space:
mode:
authorMichael Lauer <mickey@vanille-media.de>2006-06-07 08:48:36 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-06-07 08:48:36 +0000
commit31c9b1a52ca1136c19df230aa014d307d782c7d0 (patch)
tree964be977afadc7907cb29b44ab731d23885c58ea /packages/linux/linux-ezx
parent9de23e2f05f56050f71428ce21bc1263c677ecdb (diff)
linux-ezx: first shot at backlight class driver for EZX platform
Diffstat (limited to 'packages/linux/linux-ezx')
-rw-r--r--packages/linux/linux-ezx/defconfig-a7803
-rw-r--r--packages/linux/linux-ezx/defconfig-e6803
-rw-r--r--packages/linux/linux-ezx/ezx-backlight-r0.patch204
3 files changed, 208 insertions, 2 deletions
diff --git a/packages/linux/linux-ezx/defconfig-a780 b/packages/linux/linux-ezx/defconfig-a780
index e1aa2db375..550ba4a786 100644
--- a/packages/linux/linux-ezx/defconfig-a780
+++ b/packages/linux/linux-ezx/defconfig-a780
@@ -912,8 +912,9 @@ CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_CLUT224=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
-CONFIG_BACKLIGHT_CLASS_DEVICE=m
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_DEVICE=y
+CONFIG_BACKLIGHT_EZX=m
CONFIG_LCD_CLASS_DEVICE=m
CONFIG_LCD_DEVICE=y
diff --git a/packages/linux/linux-ezx/defconfig-e680 b/packages/linux/linux-ezx/defconfig-e680
index 4ecdfc9220..97d1602f20 100644
--- a/packages/linux/linux-ezx/defconfig-e680
+++ b/packages/linux/linux-ezx/defconfig-e680
@@ -912,8 +912,9 @@ CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_CLUT224=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
-CONFIG_BACKLIGHT_CLASS_DEVICE=m
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_DEVICE=y
+CONFIG_BACKLIGHT_EZX=m
CONFIG_LCD_CLASS_DEVICE=m
CONFIG_LCD_DEVICE=y
diff --git a/packages/linux/linux-ezx/ezx-backlight-r0.patch b/packages/linux/linux-ezx/ezx-backlight-r0.patch
new file mode 100644
index 0000000000..014cd1784c
--- /dev/null
+++ b/packages/linux/linux-ezx/ezx-backlight-r0.patch
@@ -0,0 +1,204 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- linux-2.6.16/arch/arm/mach-pxa/ezx.c~ezx-backlight-r0.patch
++++ linux-2.6.16/arch/arm/mach-pxa/ezx.c
+@@ -344,17 +344,12 @@
+ .pxafb_lcd_power = &pxafb_lcd_power,
+ };
+
+-
+-/* backlight for lcd */
+-
+-static struct resource ezx_backlight_resources[] = {
+-};
+-
+-static struct platform_device ezx_backlight_device = {
+- .name = "ezx-lcd-backlight",
++/*
++ * EZX LCD Backlight
++ */
++static struct platform_device ezxbacklight_device = {
++ .name = "ezx-bl",
+ .id = -1,
+- .resource = ezx_backlight_resources,
+- .num_resources = ARRAY_SIZE(ezx_backlight_resources),
+ };
+
+ #ifdef CONFIG_PXA_EZX_E680
+--- linux-2.6.16/drivers/video/backlight/Kconfig~ezx-backlight-r0.patch
++++ linux-2.6.16/drivers/video/backlight/Kconfig
+@@ -58,3 +58,12 @@
+ If you have a HP Jornada 680, say y to enable the
+ backlight driver.
+
++config BACKLIGHT_EZX
++ tristate "Motorola EXZ Backlight Driver (A780/E680/E680i)"
++ depends on BACKLIGHT_DEVICE && PXA_EZX
++ default y
++ help
++ If you have a Motorola A780 or E680(i), say y to enable the
++ backlight driver.
++
++
+--- linux-2.6.16/drivers/video/backlight/Makefile~ezx-backlight-r0.patch
++++ linux-2.6.16/drivers/video/backlight/Makefile
+@@ -5,3 +5,5 @@
+ obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o
+ obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o
+ obj-$(CONFIG_SHARP_LOCOMO) += locomolcd.o
++obj-$(CONFIG_BACKLIGHT_EZX) += ezx_bl.o
++
+--- /dev/null
++++ linux-2.6.16/drivers/video/backlight/ezx_bl.c
+@@ -0,0 +1,148 @@
++/*
++ * Backlight Driver for Motorola A780 and E680(i) GSM Phones.
++ *
++ * Copyright 2006 Vanille Media
++ *
++ * Author: Michael Lauer <mickey@Vanille.de>
++ *
++ * 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/module.h>
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/platform_device.h>
++#include <linux/spinlock.h>
++#include <linux/fb.h>
++#include <linux/backlight.h>
++
++#include <asm/arch/pxa-regs.h>
++#include <asm/arch/ezx.h>
++
++#define EZX_MAX_INTENSITY 50
++#define EZX_DEFAULT_INTENSITY 25
++
++static spinlock_t bl_lock = SPIN_LOCK_UNLOCKED;
++static struct backlight_properties ezxbl_data;
++static struct backlight_device *ezx_backlight_device;
++static int current_intensity;
++
++static int ezx_send_intensity(struct backlight_device *bd)
++{
++ unsigned long flags;
++ int intensity = bd->props->brightness;
++
++ printk( KERN_DEBUG "ezx_set_intensity to %d", intensity );
++
++ if (bd->props->power != FB_BLANK_UNBLANK)
++ intensity = 0;
++ if (bd->props->fb_blank != FB_BLANK_UNBLANK)
++ intensity = 0;
++
++ spin_lock_irqsave(&bl_lock, flags);
++
++ PWM_CTRL0 = 2; /* pre-scaler */
++ PWM_PWDUTY0 = intensity; /* duty cycle */
++ PWM_PERVAL0 = 49; /* period */
++
++ if (intensity) {
++ //pxa_set_cken(CKEN0_PWM0, 1);
++ //FIXME: Set PWM0 GPIO as output
++ } else {
++ //pxa_set_cken(CKEN0_PWM0, 0);
++ //FIXME: Set PWM0 GPIO as input
++ }
++
++ spin_unlock_irqrestore(&bl_lock, flags);
++ current_intensity = intensity;
++ return 0;
++}
++
++static int ezx_get_intensity(struct backlight_device *bd)
++{
++ return current_intensity;
++}
++
++static int ezx_set_intensity(struct backlight_device *bd)
++{
++ return ezx_send_intensity(ezx_backlight_device);
++}
++
++#ifdef CONFIG_PM
++static int ezx_bl_suspend(struct platform_device *pdev, pm_message_t state)
++{
++ //set suspend flag
++ ezx_set_intensity(ezx_backlight_device);
++ return 0;
++}
++
++static int ezx_bl_resume(struct platform_device *pdev)
++{
++ // set resume flag
++ ezx_set_intensity(ezx_backlight_device);
++ return 0;
++}
++#else
++#define ezx_bl_suspend NULL
++#define ezx_bl_resume NULL
++#endif
++
++static struct backlight_properties ezx_bl_data = {
++ .owner = THIS_MODULE,
++ .get_brightness = ezx_get_intensity,
++ .max_brightness = EZX_MAX_INTENSITY,
++ .update_status = ezx_set_intensity,
++};
++
++static int __init ezx_bl_probe(struct platform_device *pdev)
++{
++ ezx_backlight_device = backlight_device_register ("ezx-bl",
++ NULL, &ezx_bl_data);
++ if (IS_ERR (ezx_backlight_device))
++ return PTR_ERR (ezx_backlight_device);
++
++ //ezx_bl_data.requested_brightness = EZX_DEFAULT_INTENSITY;
++ //ezx_bl_data.requested_power = FB_BLANK_UNBLANK;
++ //ezx_set_intensity(ezx_backlight_device, ezx_bl_data.requested_brightness);
++
++ printk("EZX Backlight Driver Initialized.\n");
++ return 0;
++}
++
++static int ezx_bl_remove(struct platform_device *pdev)
++{
++ backlight_device_unregister(ezx_backlight_device);
++
++ printk("EZX Backlight Driver Unloaded.\n");
++ return 0;
++}
++
++static struct platform_driver ezx_bl_driver = {
++ .probe = ezx_bl_probe,
++ .remove = ezx_bl_remove,
++ .suspend = ezx_bl_suspend,
++ .resume = ezx_bl_resume,
++ .driver = {
++ .name = "ezx-bl",
++ },
++};
++
++static int __init ezx_bl_init(void)
++{
++ return platform_driver_register(&ezx_bl_driver);
++}
++
++static void __exit ezx_bl_exit(void)
++{
++ platform_driver_unregister(&ezx_bl_driver);
++}
++
++module_init(ezx_bl_init);
++module_exit(ezx_bl_exit);
++
++MODULE_AUTHOR("Michael Lauer <mickey@Vanille.de>");
++MODULE_DESCRIPTION("Backlight Driver for Motorola A780|E680(i)");
++MODULE_LICENSE("GPL");