|
From: <mar...@us...> - 2007-09-02 13:38:35
|
Revision: 1300
http://hackndev.svn.sourceforge.net/hackndev/?rev=1300&view=rev
Author: marex_z71
Date: 2007-09-02 06:11:19 -0700 (Sun, 02 Sep 2007)
Log Message:
-----------
PalmTE2: convert palmte2 to corgi-bl, make some additional corrections
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2.c
Added Paths:
-----------
linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmte2-init.h
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2.c 2007-09-02 13:09:24 UTC (rev 1299)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmte2/palmte2.c 2007-09-02 13:11:19 UTC (rev 1300)
@@ -19,6 +19,7 @@
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/fb.h>
+#include <linux/corgi_bl.h>
#include <asm/arch/audio.h>
#include <asm/arch/hardware.h>
@@ -27,9 +28,9 @@
#include <asm/arch/pxa-regs.h>
#include <asm/arch/udc.h>
#include <asm/arch/mmc.h>
-#include <asm/arch/pxapwm-bl.h>
#include <asm/arch/serial.h>
#include <asm/arch/palmte2-gpio.h>
+#include <asm/arch/palmte2-init.h>
#include <linux/gpio_keys.h>
#include <sound/driver.h>
@@ -66,20 +67,29 @@
/*
* Backlight
*/
-static struct pxapwmbl_platform_data palmte2_backlight_data = {
- .pwm = 0,
- .max_intensity = 0x160,
- .default_intensity = 0x11a,
- .limit_mask = 0x7f,
- .prescaler = 7,
- .period = 0x16c,
+
+static void palmte2_set_bl_intensity(int intensity)
+{
+ if(intensity) {
+ PWM_CTRL0 = 0x7;
+ PWM_PERVAL0 = PALMTE2_PERIOD;
+ PWM_PWDUTY0 = intensity;
+ }
+}
+
+static struct corgibl_machinfo palmte2_bl_machinfo = {
+ .max_intensity = PALMTE2_MAX_INTENSITY,
+ .default_intensity = PALMTE2_MAX_INTENSITY,
+ .set_bl_intensity = palmte2_set_bl_intensity,
+ .limit_mask = PALMTE2_LIMIT_MASK,
};
static struct platform_device palmte2_backlight = {
- .name = "pxapwm-bl",
- .dev = {
- .platform_data = &palmte2_backlight_data,
- },
+ .name = "corgi-bl",
+ .id = 0,
+ .dev = {
+ .platform_data = &palmte2_bl_machinfo,
+ },
};
/*
@@ -89,20 +99,14 @@
void bcm2035_bt_reset(int on)
{
printk(KERN_NOTICE "Switch BT reset %d\n", on);
- if (on)
- SET_PALMTE2_GPIO(BT_RESET, 1);
- else
- SET_PALMTE2_GPIO(BT_RESET, 0);
+ SET_PALMTE2_GPIO(BT_RESET, on ? 1 : 0);
}
EXPORT_SYMBOL(bcm2035_bt_reset);
void bcm2035_bt_power(int on)
{
printk(KERN_NOTICE "Switch BT power %d\n", on);
- if (on)
- SET_PALMTE2_GPIO(BT_POWER, 1);
- else
- SET_PALMTE2_GPIO(BT_POWER, 0);
+ SET_PALMTE2_GPIO(BT_POWER, on ? 1 : 0);
}
EXPORT_SYMBOL(bcm2035_bt_power);
Added: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmte2-init.h
===================================================================
--- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmte2-init.h (rev 0)
+++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmte2-init.h 2007-09-02 13:11:19 UTC (rev 1300)
@@ -0,0 +1,29 @@
+/*
+ * palmte2-init.h
+ *
+ * Init values for PalmOne Tungsten E2 Handheld Computer
+ *
+ * Copyright (C) 2007 Marek Vasut <mar...@gm...>
+ *
+ *
+ * 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.
+ *
+ *
+ *
+ */
+
+#ifndef _INCLUDE_PALMTE2_INIT_H_
+
+#define _INCLUDE_PALMTE2_INIT_H_
+
+/* BACKLIGHT */
+
+#define PALMTE2_MAX_INTENSITY 0xFE
+#define PALMTE2_DEFAULT_INTENSITY 0x7E
+#define PALMTE2_LIMIT_MASK 0x7F
+#define PALMTE2_PRESCALER 0x3F
+#define PALMTE2_PERIOD 0x112
+
+#endif /* _INCLUDE_PALMTE2_INIT_H_ */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|