|
From: <mar...@us...> - 2007-07-17 07:23:49
|
Revision: 1168
http://svn.sourceforge.net/hackndev/?rev=1168&view=rev
Author: marex_z71
Date: 2007-07-17 00:23:47 -0700 (Tue, 17 Jul 2007)
Log Message:
-----------
PalmTC: migrate to corgi-bl
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/configs/palmtc_defconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c
Added Paths:
-----------
linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-init.h
Modified: linux4palm/linux/trunk/arch/arm/configs/palmtc_defconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/configs/palmtc_defconfig 2007-07-17 04:44:11 UTC (rev 1167)
+++ linux4palm/linux/trunk/arch/arm/configs/palmtc_defconfig 2007-07-17 07:23:47 UTC (rev 1168)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.21-hnd2
-# Sun Jul 15 05:05:07 2007
+# Tue Jul 17 09:20:33 2007
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -813,8 +813,8 @@
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_LCD_CLASS_DEVICE=m
-# CONFIG_BACKLIGHT_CORGI is not set
-CONFIG_BACKLIGHT_PXAPWM=m
+CONFIG_BACKLIGHT_CORGI=m
+# CONFIG_BACKLIGHT_PXAPWM is not set
CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
# CONFIG_FB_DDC is not set
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-07-17 04:44:11 UTC (rev 1167)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-07-17 07:23:47 UTC (rev 1168)
@@ -20,30 +20,20 @@
#include <linux/fb.h>
#include <linux/irq.h>
#include <linux/delay.h>
+#include <linux/corgi_bl.h>
#include <asm/arch/pxa2xx_udc_gpio.h>
#include <asm/arch/pxa-dmabounce.h>
#include <asm/arch/pxafb.h>
#include <asm/arch/pxa-regs.h>
-#include <asm/arch/pxapwm-bl.h>
#include <asm/arch/palmtc-gpio.h>
+#include <asm/arch/palmtc-init.h>
#include <asm/arch/udc.h>
#include "../generic.h"
#define DEBUG
-static void palmtc_backlight_power(int on)
-{
- if(on) {
- PWM_CTRL1 = 0x1;
- PWM_PWDUTY1 = 0x50;
- PWM_PERVAL1 = 0x12b;
- CKEN |= CKEN1_PWM1;
- } else
- CKEN &= ~CKEN1_PWM1;
-}
-
static struct pxafb_mode_info palmtc_lcd_modes[] = {
{
/* pixclock is set by lccr3 below */
@@ -70,7 +60,7 @@
.lccr0 = 0x07B008F9,
.lccr3 = 0x04700003,
- .pxafb_backlight_power = palmtc_backlight_power,
+ .pxafb_backlight_power = NULL,
};
static int palmtc_mci_init(struct device *dev, irqreturn_t (*palmtc_detect_int)(int, void *), void *data)
@@ -143,16 +133,39 @@
};
/* Backlight ***/
-static struct pxapwmbl_platform_data palmtc_backlight_data = {
- .pwm = 1,
- .max_intensity = 0x100,
- .default_intensity = 0x50,
- .limit_mask = 0x7F,
- .prescaler = 1,
- .period = 0x12B,
+static void palmtc_bl_power(int on)
+{
+/* SET_PALMTC_GPIO(BL_POWER, on); */ /* to be determined */
+ pxa_set_cken(CKEN0_PWM0, on);
+ pxa_set_cken(CKEN1_PWM1, on);
+ mdelay(50);
+}
+
+static void palmtc_set_bl_intensity(int intensity)
+{
+ palmtc_bl_power(intensity ? 1 : 0);
+ if(intensity) {
+ PWM_CTRL1 = 0x7;
+ PWM_PERVAL1 = PALMTC_PERIOD;
+ PWM_PWDUTY1 = intensity;
+ }
+}
+
+static struct corgibl_machinfo palmtc_bl_machinfo = {
+ .max_intensity = PALMTC_MAX_INTENSITY,
+ .default_intensity = PALMTC_MAX_INTENSITY,
+ .set_bl_intensity = palmtc_set_bl_intensity,
+ .limit_mask = PALMTC_LIMIT_MASK,
};
+
+static struct platform_device palmtc_backlight = {
+ .name = "corgi-bl",
+ .id = 0,
+ .dev = {
+ .platform_data = &palmtc_bl_machinfo,
+ },
+};
-
static pxa2xx_audio_ops_t palmtc_audio_ops = {
/*
.startup = palmld_audio_startup,
@@ -162,14 +175,6 @@
*/
};
-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,
Added: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-init.h
===================================================================
--- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-init.h (rev 0)
+++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtc-init.h 2007-07-17 07:23:47 UTC (rev 1168)
@@ -0,0 +1,41 @@
+/*
+ * palmtc-init.h
+ *
+ * Init values for Palm Tungsten|C Handheld Computer
+ *
+ * Author: 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_PALMTC_INIT_H_
+
+#define _INCLUDE_PALMTC_INIT_H_
+
+/* BACKLIGHT */
+
+#define PALMTC_MAX_INTENSITY 0xFE
+#define PALMTC_DEFAULT_INTENSITY 0x7E
+#define PALMTC_LIMIT_MASK 0x7F
+#define PALMTC_PRESCALER 0x3F
+#define PALMTC_PERIOD 0x12C
+
+/* BATTERY */
+
+#define PALMTC_BAT_MAX_VOLTAGE 4000 /* 4.00V current voltage at max charge as from PalmOS */
+#define PALMTC_BAT_MIN_VOLTAGE 3550 /* 3.55V critical voltage */
+#define PALMTC_BAT_MAX_CURRENT 0 /* unknokn */
+#define PALMTC_BAT_MIN_CURRENT 0 /* unknown */
+#define PALMTC_BAT_MAX_CHARGE 1 /* unknown */
+#define PALMTC_BAT_MIN_CHARGE 1 /* unknown */
+#define PALMTC_BAT_MEASURE_DELAY (HZ * 1)
+#define PALMTC_MAX_LIFE_MINS 240 /* my Tungsten|C on-life in minutes */
+
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|