|
From: <hol...@us...> - 2007-01-11 12:10:48
|
Revision: 753
http://svn.sourceforge.net/hackndev/?rev=753&view=rev
Author: holger_bocklet
Date: 2007-01-11 04:10:39 -0800 (Thu, 11 Jan 2007)
Log Message:
-----------
minor cleanup for ptc_ucb1400 and enabled backlight-control
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-01-10 17:49:39 UTC (rev 752)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-01-11 12:10:39 UTC (rev 753)
@@ -22,13 +22,14 @@
#include <asm/arch/pxa-dmabounce.h>
#include <asm/arch/pxafb.h>
#include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxapwm-bl.h>
#include "../generic.h"
#include "palmtc-gpio.h"
#define DEBUG
-static void palm_backlight_power(int on)
+static void palmtc_backlight_power(int on)
{
if(on) {
PWM_CTRL1 = 0x1;
@@ -55,7 +56,7 @@
.lccr0 = 0x07B008F9,
.lccr3 = 0x04700004,
- .pxafb_backlight_power = palm_backlight_power,
+ .pxafb_backlight_power = palmtc_backlight_power,
};
@@ -95,7 +96,17 @@
};
+/* Backlight ***/
+static struct pxapwmbl_platform_data palmtc_backlight_data = {
+ .pwm = 1,
+ .max_intensity = 0x100, //120
+ .default_intensity = 0x50, //11a
+ .limit_mask = 0x7F,
+ .prescaler = 1, // 7
+ .period = 0x12B, // 16c
+};
+
static pxa2xx_audio_ops_t palmtc_audio_ops = {
/*
.startup = palmld_audio_startup,
@@ -105,7 +116,14 @@
*/
};
+static struct platform_device palmtc_backlight = {
+ .name = "pxapwm-bl",
+ .dev = {
+ .platform_data = &palmtc_backlight_data,
+ },
+};
+
static struct platform_device palmtc_ac97_device = {
.name = "pxa2xx-ac97",
.id = -1,
@@ -121,6 +139,7 @@
static struct platform_device *devices[] __initdata = {
&palmtc_ac97_device,
&palmtc_keyboard_device,
+ &palmtc_backlight,
};
static void __init palmtc_init(void)
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c 2007-01-10 17:49:39 UTC (rev 752)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c 2007-01-11 12:10:39 UTC (rev 753)
@@ -79,7 +79,7 @@
};
#ifdef CONFIG_APM
-#define APM_MIN_INTERVAL 500
+#define APM_MIN_INTERVAL 1000
struct ucb1400 *ucb_static_copy;
struct mutex apm_mutex;
struct apm_power_info info_cache;
@@ -356,10 +356,15 @@
info->battery_status = APM_BATTERY_STATUS_CRITICAL;
}
}
- info->battery_life = ((battery - UCB_BATT_CRITICAL) * 125) / 100;
- if (info->battery_life>100)
+ info->battery_life = ((battery - UCB_BATT_CRITICAL) / (UCB_BATT_HIGH-UCB_BATT_CRITICAL) ) * 100; //battery_life = %
+ if (info->battery_life>100) {
info->battery_life=100;
- info->time = info->battery_life * 6;
+ } else {
+ if (info->battery_life<0) {
+ info->battery_life=0;
+ }
+ }
+ info->time = info->battery_life * UCB_BATT_DURATION / 100;
info->units = APM_UNITS_MINS;
info_cache.ac_line_status=info->ac_line_status;
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h 2007-01-10 17:49:39 UTC (rev 752)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h 2007-01-11 12:10:39 UTC (rev 753)
@@ -115,11 +115,8 @@
#define UCB_TS_FUZZ 15
#define UCB_BATT_HIGH 560 // adc "ticks" not mV !
-#define UCB_BATT_HIGH_MIN_MUL 20000 // multiplikator adc-ticks => minutes
-#define UCB_BATT_NORM_MIN_MUL 1073 // multiplikator adc-ticks => minutes
#define UCB_BATT_LOW 490
-#define UCB_BATT_LOW_MIN_MUL 2941 // multiplikator adc-ticks => minutes
#define UCB_BATT_CRITICAL 480
-#define UCB_BATT_LIFE 600 // battery duration in minutes
-#define UCB_ADC_TIMEOUT 100
+#define UCB_BATT_DURATION 600 // battery duration in minutes
+#define UCB_ADC_TIMEOUT 50
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|