sync hh.org
[hh.org.git] / arch / arm / mach-pxa / asus620 / asus620_lcd.c
blobe6a4dafc0b65ea047e8b16539bd8cfecf6e39e75
1 /*
2 * linux/arch/arm/mach-pxa/asus620_lcd.c
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * Copyright (c) 2003 Adam Turowski
9 * Copyright(C) 2004 Vitaliy Sardyko
11 * 2003-12-03: Adam Turowski
12 * initial code.
13 * 2004-11-07: Vitaliy Sardyko
14 * updated to 2.6.7
17 #include <linux/module.h>
18 #include <linux/init.h>
19 #include <linux/notifier.h>
20 #include <linux/lcd.h>
21 #include <linux/backlight.h>
23 #include <asm/mach-types.h>
24 #include <asm/arch/pxa-regs.h>
25 #include <asm/arch/asus620-init.h>
26 #include <asm/arch/asus620-gpio.h>
27 #include <linux/fb.h>
28 #include <asm/arch/pxafb.h>
30 #define DEBUG 1
34 #if DEBUG
35 # define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
36 #else
37 # define DPRINTK(fmt, args...)
38 #endif
41 static int asus620_lcd_set_power (struct lcd_device *lm, int setp)
43 return 0;
46 static int asus620_lcd_get_power (struct lcd_device *lm)
48 return 0;
50 struct lcd_properties asus620_lcd_properties =
52 .owner = THIS_MODULE,
53 .set_power = asus620_lcd_set_power,
54 .get_power = asus620_lcd_get_power,
55 };
56 /* asus620: LCCR0: 0x003000f9 -- ENB | LDM | SFM | IUM | EFM | PAS | QDM | BM | OUM
57 LCCR1: 0x15150cef -- PPL=0xef, HSW=0x4, ELW=0xA, BLW=0x1A
58 LCCR2: 0x06060d3f -- BFW=0x0, EFW=0x30, VSW=0xC, LPP=0x13F
59 LCCR3: 0x04700007 -- PCD=0x8, ACB=0x0, API=0x0, VSP, HSP, PCP, BPP=0x4 */
61 static struct pxafb_mach_info asus620_fb_info = {
62 .pixclock = 171521,
63 .bpp = 16,
64 .xres = 240,
65 .yres = 320,
66 .hsync_len = 4,
67 .vsync_len = 4,
68 .left_margin = 22,
69 .upper_margin = 6,
70 .right_margin = 22,
71 .lower_margin = 6,
72 .sync = 0,
73 .lccr0 = (LCCR0_LDM | LCCR0_SFM | LCCR0_IUM | LCCR0_EFM | LCCR0_PAS | LCCR0_QDM | LCCR0_BM | LCCR0_OUM),
74 .lccr3 = (LCCR3_HorSnchL | LCCR3_VrtSnchL | LCCR3_16BPP | LCCR3_PCP)
77 static int asus620_backlight_set_power (struct backlight_device *bm, int on)
79 return 0;
82 static int asus620_backlight_get_power (struct backlight_device *bm)
84 return 0;
87 static struct backlight_properties asus620_backlight_properties =
89 .owner = THIS_MODULE,
90 .set_power = asus620_backlight_set_power,
91 .get_power = asus620_backlight_get_power,
94 static struct lcd_device *pxafb_lcd_device;
95 static struct backlight_device *pxafb_backlight_device;
97 int asus620_lcd_init (void)
99 int ret = 0;
101 if (!machine_is_a620 ())
102 return -ENODEV;
104 set_pxa_fb_info (&asus620_fb_info);
106 pxafb_lcd_device = lcd_device_register("pxafb", NULL, &asus620_lcd_properties);
107 if (IS_ERR (pxafb_lcd_device)) {
108 DPRINTK(" LCD device doesn't registered, booting failed !\n");
109 return ret;
112 pxafb_backlight_device = backlight_device_register("pxafb", NULL,
113 &asus620_backlight_properties);
115 return ret;
119 static void asus620_lcd_exit (void)
121 lcd_device_unregister (pxafb_lcd_device);
122 backlight_device_unregister (pxafb_backlight_device);
125 module_init(asus620_lcd_init);
126 module_exit(asus620_lcd_exit);
128 MODULE_AUTHOR("Adam Turowski");
129 MODULE_DESCRIPTION("LCD driver for Asus 620");
130 MODULE_LICENSE("GPL");