there was an error in the first file...

 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
/*
 * 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/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");                                   
-- 
_______________________________________________
Aximx50-port mailing list
[email protected]
https://www.handhelds.org/mailman/listinfo/aximx50-port

Reply via email to