|
From: <ke...@us...> - 2007-07-15 22:44:13
|
Revision: 1158
http://svn.sourceforge.net/hackndev/?rev=1158&view=rev
Author: keddar
Date: 2007-07-15 15:44:11 -0700 (Sun, 15 Jul 2007)
Log Message:
-----------
palmtt3: move some value to palmtt3-init.h
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt3/palmtt3.c
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt3/palmtt3_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt3/palmtt3.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt3/palmtt3.c 2007-07-15 22:42:36 UTC (rev 1157)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt3/palmtt3.c 2007-07-15 22:44:11 UTC (rev 1158)
@@ -3,7 +3,7 @@
*
* Author:
* Vladimir "Farcaller" Pouzanov <far...@gm...>
- *
+ *
* Based on Palm LD patch by Alex Osborne
*
*/
@@ -40,6 +40,7 @@
#include <asm/arch/pxa-pm_ll.h>
#include <asm/arch/pxapwm-bl.h>
#include <asm/arch/palmtt3-gpio.h>
+#include <asm/arch/palmtt3-init.h>
#include <asm/arch/tps65010.h>
//#include "palmtt3_bt.h"
@@ -94,11 +95,10 @@
static struct pxafb_mach_info palmtt3_lcd_screen = {
.modes = palmtt3_lcd_modes,
.num_modes = ARRAY_SIZE(palmtt3_lcd_modes),
- .lccr0 = 0x003008F9,
- .lccr3 = 0x03700002,
-
+ .lccr0 = PALMTT3_INIT_LCD_LLC0,
+ .lccr3 = PALMTT3_INIT_LCD_LLC3,
.pxafb_backlight_power = &palmtt3_pxafb_backlight_power,
- .pxafb_lcd_power = &palmtt3_pxafb_lcd_power,
+ .pxafb_lcd_power = &palmtt3_pxafb_lcd_power,
};
/*** SSP ***/
@@ -109,7 +109,7 @@
printk(KERN_WARNING "palmtt3_tsc2101: Resetting SSP, move this to garux?\n");
SSCR0 &= ~SSCR0_SSE;
SSCR1 = SSCR1 & 0x3FFC;
-
+
if (ssp_init(&palmtt3_ssp_dev, 1, 0))
printk(KERN_ERR "palmtt3_tsc2101: Unable to register SSP handler!\n");
else {
@@ -125,14 +125,14 @@
void palmtt3_ssp_suspend(void)
{
ssp_disable(&palmtt3_ssp_dev);
- ssp_save_state(&palmtt3_ssp_dev,&ssp1);
+ ssp_save_state(&palmtt3_ssp_dev,&ssp1);
// FIXME power off TSC2101?
}
void palmtt3_ssp_resume(void)
{
// FIXME power on TSC2101?
- ssp_restore_state(&palmtt3_ssp_dev,&ssp1);
+ ssp_restore_state(&palmtt3_ssp_dev,&ssp1);
ssp_enable(&palmtt3_ssp_dev);
}
@@ -143,9 +143,9 @@
u32 ret;
int i;
-
+
GPCR0 = GPIO_bit(PALMTT3_GPIO_TSC2101_SS);
-
+
ssp_write_word(&palmtt3_ssp_dev, command | read);
ssp_read_word(&palmtt3_ssp_dev, &ret); /* Dummy read */
@@ -161,10 +161,10 @@
GPSR0 = GPIO_bit(PALMTT3_GPIO_TSC2101_SS);
}
-static int palmtt3_tsc2101_pendown(void)
+static int palmtt3_tsc2101_pendown(void)
{
// FIXME PALMT3_GPIO_PENDOWN
- if ((GPLR(PALMTT3_GPIO_PENDOWN) & GPIO_bit(PALMTT3_GPIO_PENDOWN)) == 0)
+ if ((GPLR(PALMTT3_GPIO_PENDOWN) & GPIO_bit(PALMTT3_GPIO_PENDOWN)) == 0)
return 1;
return 0;
}
@@ -194,11 +194,11 @@
/* Backlight ***/
static struct pxapwmbl_platform_data palmtt3_backlight_data = {
.pwm = 1,
- .max_intensity = 0x100,
- .default_intensity = 0x50,
- .limit_mask = 0x7F,
- .prescaler = 1,
- .period = 0x12B,
+ .max_intensity = PALMTT3_MAX_INTENSITY,
+ .default_intensity = PALMTT3_DEFAULT_INTENSITY,
+ .limit_mask = PALMTT3_LIMIT_MASK,
+ .prescaler = PALMTT3_PRESCALER,
+ .period = PALMTT3_PERIOD,
};
/*** LEDs ***/
@@ -223,7 +223,7 @@
if (mode & IR_SIRMODE){
printk ("IrDA: setting mode to SIR\n");
- }
+ }
else if (mode & IR_FIRMODE){
printk ("IrDA: setting mode to FIR\n");
}
@@ -265,12 +265,12 @@
printk (KERN_INFO "palmtt3_udc: device detected [USB_DETECT: %d]\n",ret);
else
printk (KERN_INFO "palmtt3_udc: no device detected [USB_DETECT: %d]\n",ret);
-
+
return ret;
}
static void palmtt3_udc_command (int cmd){
-
+
switch (cmd) {
case PXA2XX_UDC_CMD_DISCONNECT:
SET_GPIO(GPIO_NR_PALMTT3_PUC_USB_POWER, 0);
@@ -405,7 +405,7 @@
void palmtt3_resume(void)
{
unsigned long * addr;
-
+
addr = (unsigned long *) 0xC0000000;
*addr = _PM_backup[0];
@@ -455,7 +455,7 @@
MACHINE_START(T3XSCALE, "Palm Tungsten T3")
/* Maintainer: Vladimir Pouzanov <far...@gm...> */
- .phys_io = 0x40000000,
+ .phys_io = PALMTT3_PHYS_IO_START,
.boot_params = 0xa0000100,
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.map_io = pxa_map_io,
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt3/palmtt3_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt3/palmtt3_battery.c 2007-07-15 22:42:36 UTC (rev 1157)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtt3/palmtt3_battery.c 2007-07-15 22:44:11 UTC (rev 1158)
@@ -34,18 +34,20 @@
#include <linux/soc/tsc2101.h>
#include <asm/arch/tps65010.h>
+#include <asm/arch/palmtt3-gpio.h>
+#include <asm/arch/palmtt3-init.h>
+
#define BATTERY_CHECK_INTERVAL (HZ * 60) /* every 60 seconds */
int palmtt3_battery_get_max_voltage(struct battery *bat)
{
- //return 4147; // approx. 4.21 V, 2718 as returned by TSC
- return 4156; // strange, but this is my current upper limit. so it be.
+ return PALMTT3_BAT_MAX_VOLTAGE;
}
int palmtt3_battery_get_min_voltage(struct battery *bat)
{
- return 3710; // 3.71 V, Critical Threshold set by PalmOS
+ return PALMTT3_BAT_MIN_VOLTAGE;
}
static int match_tsc(struct device * dev, void * data)
@@ -99,8 +101,8 @@
static struct battery palmtt3_battery = {
.name = "palmtt3_batt",
.id = "Li-Ion battery",
- .min_voltage = 3710,
- .max_voltage = 4156,
+ .min_voltage = PALMTT3_BAT_MIN_VOLTAGE,
+ .max_voltage = PALMTT3_BAT_MAX_VOLTAGE,
.v_current = -1,
.temp = -1,
.get_voltage = palmtt3_battery_get_voltage,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|