From: <p3t...@us...> - 2007-05-20 18:55:18
|
Revision: 986 http://svn.sourceforge.net/hackndev/?rev=986&view=rev Author: p3t3-dev Date: 2007-05-20 11:55:17 -0700 (Sun, 20 May 2007) Log Message: ----------- Treo650: backlight changed from Corgi to PXA driver Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c 2007-05-20 18:52:57 UTC (rev 985) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c 2007-05-20 18:55:17 UTC (rev 986) @@ -3,7 +3,8 @@ * * Support for the Palm Treo 650. * - * Author: Alex Osborne <bob...@gm...> 2005-2006 + * Author: Alex Osborne <bob...@gm...> 2005-2006 + * P3T3, Petr Blaha <pb...@p3...> 2007 * */ @@ -24,8 +25,8 @@ #include <asm/arch/mmc.h> #include <asm/arch/pxafb.h> #include <asm/arch/pxa-regs.h> -#include <asm/arch/palmt650-gpio.h> #include <asm/arch/pxa27x_keyboard.h> +#include <asm/arch/pxapwm-bl.h> #include <asm/arch/irda.h> #include <asm/arch/sharpsl.h> #include <asm/arch/udc.h> @@ -36,6 +37,9 @@ #include <sound/initval.h> #include <sound/ac97_codec.h> +#include <asm/arch/palmt650-gpio.h> +#include <asm/arch/palmt650-init.h> + #include "../generic.h" /********************************************************* @@ -116,32 +120,31 @@ * Backlight *********************************************************/ -static void palmt650_set_bl_intensity(int intensity) -{ - PWM_CTRL0 = 0; /* pre-scalar */ - PWM_PWDUTY0 = intensity; /* duty cycle */ - PWM_PERVAL0 = 0x1b1; /* period */ - - if (intensity > 0) { - pxa_set_cken(CKEN0_PWM0, 1); - } else { - pxa_set_cken(CKEN0_PWM0, 0); - } -} - -static struct corgibl_machinfo palmt650_bl_machinfo = { - .max_intensity = 0x1ad, - .default_intensity = 0xe5, - .limit_mask = 0x7f, - .set_bl_intensity = palmt650_set_bl_intensity, +static struct pxapwmbl_platform_data palmt650_backlight_data = { + .pwm = 0, + .max_intensity = PALMT650_MAX_INTENSITY, + .default_intensity = PALMT650_DEFAULT_INTENSITY, + .limit_mask = PALMT650_LIMIT_MASK, + .prescaler = 1, + .period = 0x12C, }; -static struct platform_device palmt650_bl = { - .name = "corgi-bl", +static struct platform_device palmt650_backlight = { + .name = "pxapwm-bl", .dev = { - .platform_data = &palmt650_bl_machinfo, + .platform_data = &palmt650_backlight_data, }, }; +/********************************************************* + * Power management + *********************************************************/ +struct platform_device palmt650_pm = { + .name = "palmt650-pm", + .id = -1, + .dev = { + .platform_data = NULL, + }, +}; /********************************************************* * USB Device Controller @@ -191,7 +194,7 @@ KEY_L, /* "L" */ KEY_A, /* "A" */ KEY_Q, /* "Q" */ - KEY_RIGHTCTRL, /* "Right Shift" */ + KEY_LEFTCTRL, /* "Right Shift" */ }, { /* row 1 */ KEY_P, /* "P" */ KEY_UP, /* "5-Way Right" */ @@ -225,7 +228,7 @@ KEY_T, /* "T" */ -1, /* "Unused" */ }, { /* row 5 */ - -1, /* "Off" */ + KEY_F8, /* "Off" */ KEY_VOLUMEUP, /* "Volume Up" */ KEY_DOT, /* "." */ KEY_B, /* "B" */ @@ -277,12 +280,15 @@ }, }; +/********************************************************* + * Machine initalisation + *********************************************************/ - static struct platform_device *devices[] __initdata = { + &palmt650_ac97, + &palmt650_pm, &palmt650_kbd, - &palmt650_ac97, - &palmt650_bl, + &palmt650_backlight, &palmt650_led, }; @@ -292,7 +298,7 @@ static struct pxafb_mode_info palmt650_lcd_mode __initdata = { /* pixclock is set by lccr3 below */ - .pixclock = 50000, + .pixclock = 0, .xres = 320, .yres = 320, .bpp = 16, @@ -302,8 +308,8 @@ /* fixme: these are the margins PalmOS has set, * they seem to work but could be better. */ - .left_margin = 20, - .right_margin = 8, + .left_margin = 24, + .right_margin = 4, .upper_margin = 8, .lower_margin = 5, .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, @@ -311,9 +317,9 @@ static struct pxafb_mach_info palmt650_lcd __initdata = { .lccr0 = 0x4000080, - .lccr3 = 0x4700003, + .lccr3 = 0x4400003, - /* .pxafb_backlight_power = palm_backlight_power, */ + .pxafb_backlight_power = NULL, .num_modes = 1, .modes = &palmt650_lcd_mode, @@ -338,17 +344,20 @@ { /* Disable PRIRDY interrupt to avoid hanging when loading AC97 */ GCR &= ~GCR_PRIRDY_IEN; + + /* set AC97's GPIOs */ + + pxa_gpio_mode(GPIO28_BITCLK_AC97_MD); + pxa_gpio_mode(GPIO29_SDATA_IN_AC97_MD); + pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD); + pxa_gpio_mode(GPIO31_SYNC_AC97_MD); + set_pxa_fb_info(&palmt650_lcd); pxa_set_mci_info(&palmt650_mci_platform_data); pxa_set_ficp_info(&palmt650_ficp_platform_data); pxa_set_udc_info( &palmt650_udc_mach_info ); + platform_add_devices(devices, ARRAY_SIZE(devices)); - -#if 0 - /* configure power switch to resume from standby */ - PWER |= PWER_GPIO12; - PRER |= PWER_GPIO12; -#endif } MACHINE_START(XSCALE_PALMTREO650, "Palm Treo 650") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |