Now i have but the LCD Stuff from aximx50.c to a separate aximx50_lcd.c. We 
only have to find a display detection method now.

defconfigman file and kernel sources patch is included.

regards,
 patrick

On Friday, 6. July 2007 18:13:40 Patrick Steiner wrote:
> hi,
>
> has anyone a idea how we can detect if its a vga or qvga axim on kernel
> base? perhaps there is any GPIO?
>
> So we can build one Kernel for the device.
> --
> Patrick Steiner | [EMAIL PROTECTED]
> ICQ: 128261350
> WWW: http://helmsdeep.homelinux.net/~pat
>
> working on (tux4u.skynet):
> Fedora release 7 (Moonshine)
> GNU/Linux 2.6.21-1.3228.fc7



-- 
Patrick Steiner | [EMAIL PROTECTED]
ICQ: 128261350
WWW: http://helmsdeep.homelinux.net/~pat
 
working on (tux4u.skynet):
Fedora release 7 (Moonshine)
GNU/Linux 2.6.21-1.3228.fc7
# Config file for the Dell Aximx50v and the Aximx51v

include machine/hardware.conf
include machine/crossport.conf


# Some unalienable parts, like CPU/Perephiral controllers
[machine.builtin]
hw.cpu.pxa27x=y
MACH_X50=y
DRAM_BASE=0xa8000000

# Screen
[machine.lcd]
FB_PXA=y
X50_LCD=y
X50_VGA=y
kernel.fonts.vga = y

# Screen goes with backlight
[machine.backlight]
BACKLIGHT_CORGI = $1

# Other HID output
[machine.leds]
LEDS_TRIGGER_HWTIMER=y

# Sound is a related but separate thing, of course ;-)
[machine.sound]

# HID input
[machine.keys]
X50_BUTTONS=y

[machine.touchscreen]
driver.input.ts.adc-debounce ?= $1
X50_TS = $1

# Builtin non-volatile storage
[machine.flash]

# External device interfaces, in particular, secondary storage
[machine.mmc]
MMC_PXA=$1

[machine.pcmcia]

# Communicational interfaces
[machine.usb.client]
driver.pxa27x.udc ?= $1

[machine.usb.host]
[machine.serial]
[machine.irda]
[machine.bluetooth]
[machine.wifi]
[machine.phone]

# Machine support stuff
[machine.adc]
ADC_ADS7846_SSP=y

[machine.battery]
driver.subsys.power.pda = $1

[machine.hwmon]
[machine.rtc]

/*
 * LCD support for Dell Aximx50(v)
 *
 * Copyright (c) 2007 Patrick Steiner
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file COPYING in the main directory of this archive for
 * more details.
 *
 * 06-Jul-2007      Patrick Steiner <[EMAIL PROTECTED]>
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/notifier.h>
#include <linux/lcd.h>
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/platform_device.h>

#include <asm/gpio.h>

#include <asm/arch/aximx50.h>
#include <asm/mach-types.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxafb.h>

static int lcd_vga;

/* Axim X50 VGA Version */
static struct pxafb_mode_info aximx50_pxafb_modes_vga[] = {
{
    .pixclock       = 96153,
    .bpp            = 16,
    .xres           = 480,
    .yres           = 640,
    .hsync_len      = 64,
    .vsync_len      = 5,
    .left_margin    = 17,
    .upper_margin   = 1,
    .right_margin   = 87,
    .lower_margin   = 4,
},
};


static struct pxafb_mach_info aximx50_fb_info_vga = {
    .modes      = aximx50_pxafb_modes_vga,
    .num_modes  = ARRAY_SIZE(aximx50_pxafb_modes_vga),
    .lccr0      = LCCR0_ENB | LCCR0_LDM |                           // 0x9
            LCCR0_SFM | LCCR0_IUM | LCCR0_EFM | LCCR0_Act | // 0xf
            LCCR0_QDM |                                     // 0x8
                                    // 0x0
                                    // 0x0
            LCCR0_BM  | LCCR0_OUM | LCCR0_RDSTM |           // 0xb
            LCCR0_CMDIM                                     // 0x1
            ,                                               // 0x0
            //0x01b008f9,
    .lccr3      = 0x04f00001,
};


/* Axim X50 QVGA Version */
static struct pxafb_mode_info aximx50_pxafb_modes_qvga[] = {
{
    .pixclock       = 96153,
    .bpp            = 16,
    .xres           = 240,
    .yres           = 320,
    .hsync_len      = 20,
    .vsync_len      = 4,
    .left_margin    = 59,
    .upper_margin   = 4,
    .right_margin   = 16,
    .lower_margin   = 0,
},
};


static struct pxafb_mach_info aximx50_fb_info_qvga = {
    .modes      = aximx50_pxafb_modes_qvga,
    .num_modes  = ARRAY_SIZE(aximx50_pxafb_modes_qvga),
    .lccr0      = LCCR0_ENB | LCCR0_LDM |                          // 0x9
            LCCR0_SFM | LCCR0_IUM | LCCR0_EFM | LCCR0_Act |  // 0xf
            LCCR0_QDM |                                      // 0x8
                                    // 0x0
                                    // 0x0
            LCCR0_BM  | LCCR0_OUM                            // 0x3
                                    // 0x0
            ,                                                // 0x0
            //0x003008f9,
    .lccr3      = 0x04900008,
};                                  

static int aximx50_lcd_probe(struct platform_device *dev)
{
    #ifdef CONFIG_X50_VGA
        lcd_vga = 1;
    #endif

    if (lcd_vga) {
        printk(KERN_NOTICE "DELL AXIMX50 VGA LCD driver\n");
        set_pxa_fb_info(&aximx50_fb_info_vga);
    } else {
        printk(KERN_NOTICE "DELL AXIMX50 QVGA LCD driver\n");
        set_pxa_fb_info(&aximx50_fb_info_qvga);
    }

    return 0;
}

static int aximx50_lcd_remove(struct platform_device *dev)
{
    return 0;
}

#ifdef CONFIG_PM
static int aximx50_lcd_suspend(struct platform_device *dev, pm_message_t state)
{
    return 0;
}

static int aximx50_lcd_resume(struct platform_device *dev)
{
    return 0;
}
#endif

static struct platform_driver aximx50_lcd_driver = {
    .driver = {
        .name = "aximx50-lcd",
    },
    .probe = aximx50_lcd_probe,
    .remove = aximx50_lcd_remove,
#ifdef CONFIG_PM
    .suspend = aximx50_lcd_suspend,
    .resume = aximx50_lcd_resume,
#endif
};

static __init int aximx50_lcd_init(void)
{
    if (!machine_is_x50())
        return -ENODEV;

    return platform_driver_register(&aximx50_lcd_driver);
}

static __exit void aximx50_lcd_exit(void)
{
    platform_driver_unregister(&aximx50_lcd_driver);
}

module_init(aximx50_lcd_init);
module_exit(aximx50_lcd_exit);

MODULE_AUTHOR("Patrick Steiner <[EMAIL PROTECTED]>");
MODULE_DESCRIPTION("DELL AXIMX50 LCD driver");
MODULE_LICENSE("GPL");                                   
diff -ur kernel26_ori/arch/arm/mach-pxa/aximx50/aximx50.c kernel26/arch/arm/mach-pxa/aximx50/aximx50.c
--- kernel26_ori/arch/arm/mach-pxa/aximx50/aximx50.c	2007-06-17 10:52:55.000000000 +0200
+++ kernel26/arch/arm/mach-pxa/aximx50/aximx50.c	2007-07-06 19:38:38.000000000 +0200
@@ -37,80 +37,11 @@
 
 #include <asm/arch/aximx50-gpio.h>
 #include <asm/arch/pxa-regs.h>
-#include <asm/arch/pxafb.h>
 #include <asm/arch/udc.h>
 
 #include "../generic.h"
 
-/* Description of the X50(v)/X51(v) display modes */
-#ifdef CONFIG_X50_VGA
-static struct pxafb_mode_info aximx50_pxafb_modes[] = {
-{
-	.pixclock       = 96153,
-	.bpp            = 16,
-	.xres           = 480,
-	.yres           = 640,
-	.hsync_len      = 64,
-	.vsync_len      = 5,
-	.left_margin    = 17,
-	.upper_margin   = 1,
-	.right_margin   = 87,
-	.lower_margin   = 4,
-},
-};
-
-
-static struct pxafb_mach_info aximx50_fb_info = {
-	.modes      = aximx50_pxafb_modes,
-	.num_modes  = ARRAY_SIZE(aximx50_pxafb_modes),
-	.lccr0      = LCCR0_ENB | LCCR0_LDM |                           // 0x9
-			LCCR0_SFM | LCCR0_IUM | LCCR0_EFM | LCCR0_Act | // 0xf
-			LCCR0_QDM |                                     // 0x8
-									// 0x0
-									// 0x0
-			LCCR0_BM  | LCCR0_OUM | LCCR0_RDSTM |           // 0xb
-			LCCR0_CMDIM                                     // 0x1
-			,                                               // 0x0
-		//0x01b008f9,
-	.lccr3      = 0x04f00001,
-};
-
-#else /* undef CONFIG_X50_VGA */
-
-/* Description of the X50/X51 display modes */
-static struct pxafb_mode_info aximx50_pxafb_modes[] = {
-{
-	.pixclock       = 96153,
-	.bpp            = 16,
-	.xres           = 240,
-	.yres           = 320,
-	.hsync_len      = 20,
-	.vsync_len      = 4,
-	.left_margin    = 59,
-	.upper_margin   = 4,
-	.right_margin   = 16,
-	.lower_margin   = 0,
-},
-};
-
-
-static struct pxafb_mach_info aximx50_fb_info = {
-	.modes      = aximx50_pxafb_modes,
-	.num_modes  = ARRAY_SIZE(aximx50_pxafb_modes),
-	.lccr0      = LCCR0_ENB | LCCR0_LDM |                          // 0x9
-			LCCR0_SFM | LCCR0_IUM | LCCR0_EFM | LCCR0_Act |  // 0xf
-			LCCR0_QDM |                                      // 0x8
-									// 0x0
-									// 0x0
-			LCCR0_BM  | LCCR0_OUM                            // 0x3
-									// 0x0
-			,                                                // 0x0
-		//0x003008f9,
-	.lccr3      = 0x04900008,
-};
-
 
-#endif
 
 
 /* Initialization code */
@@ -199,10 +130,19 @@
 	.name = "aximx50-ts", 
 };
 
+static struct platform_device aximx50_lcd = {
+    .name = "aximx50-lcd",
+    .dev  = {
+        .platform_data = NULL,
+    },
+    .id   = -1,
+};
+
 static struct platform_device *devices[] __initdata = {
 	&x50_buttons,
 	&x50_ts,
 	&aximx50_bl,
+    &aximx50_lcd,
 };
 
 static void __init x50_init( void )
@@ -233,7 +173,6 @@
 	MSC2 = 0x16dc7ffc;
 #endif
 
-	set_pxa_fb_info(&aximx50_fb_info);
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 	pxa_set_udc_info(&x50_udc_mach_info);
 }
Only in kernel26/arch/arm/mach-pxa/aximx50: aximx50_lcd.c
diff -ur kernel26_ori/arch/arm/mach-pxa/aximx50/Kconfig kernel26/arch/arm/mach-pxa/aximx50/Kconfig
--- kernel26_ori/arch/arm/mach-pxa/aximx50/Kconfig	2007-05-12 19:52:17.000000000 +0200
+++ kernel26/arch/arm/mach-pxa/aximx50/Kconfig	2007-07-06 19:25:02.000000000 +0200
@@ -7,12 +7,20 @@
 	  series of PDAs. Currently there is only basic support for this
 	  type of PDAs.
 
-config X50_VGA
-	bool "VGA display"
+config X50_LCD
+	bool "Dell Axim X50 series LCD"
 	depends on MACH_X50
 	default true
 	help
-	  Set this if you have the "v" variant of Axim X50/X51.
+	  This driver provides support for changing power and brightness
+	  of the DELL Axim X50 series display.
+
+config X50_VGA
+    bool "Dell Axim X50 series VGA display"
+    depends on MACH_X50
+    default true
+    help
+      Set this if you have the "v" variant of the DELL Axim X50 series.
 
 config X50_BUTTONS
 	tristate "X50/X51(v) buttons support"
diff -ur kernel26_ori/arch/arm/mach-pxa/aximx50/Makefile kernel26/arch/arm/mach-pxa/aximx50/Makefile
--- kernel26_ori/arch/arm/mach-pxa/aximx50/Makefile	2007-02-18 13:18:48.000000000 +0100
+++ kernel26/arch/arm/mach-pxa/aximx50/Makefile	2007-07-06 19:25:02.000000000 +0200
@@ -3,5 +3,6 @@
 #
 obj-$(CONFIG_MACH_X50)		+= aximx50.o 
 obj-$(CONFIG_X50_BUTTONS)	+= aximx50_buttons.o
+obj-$(CONFIG_X50_LCD)       += aximx50_lcd.o
 obj-$(CONFIG_X50_TS)		+= aximx50_ts.o
 
-- 
_______________________________________________
Aximx50-port mailing list
[email protected]
https://www.handhelds.org/mailman/listinfo/aximx50-port

Reply via email to