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
13 * 2004-11-07: Vitaliy Sardyko
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>
28 #include <asm/arch/pxafb.h>
35 # define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
37 # define DPRINTK(fmt, args...)
41 static int asus620_lcd_set_power (struct lcd_device
*lm
, int setp
)
46 static int asus620_lcd_get_power (struct lcd_device
*lm
)
50 struct lcd_properties asus620_lcd_properties
=
53 .set_power
= asus620_lcd_set_power
,
54 .get_power
= asus620_lcd_get_power
,
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
= {
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
)
82 static int asus620_backlight_get_power (struct backlight_device
*bm
)
87 static struct backlight_properties asus620_backlight_properties
=
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)
101 if (!machine_is_a620 ())
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");
112 pxafb_backlight_device
= backlight_device_register("pxafb", NULL
,
113 &asus620_backlight_properties
);
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");