hh.org updates
[hh.org.git] / arch / arm / mach-pxa / rover / roverp1_lcd.c
blobb24ae4bbc5fcab87dd30ff22015fa1ec1f8eaff6
1 /*
2 * linux/arch/arm/mach-pxa/roverp1_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
10 * Copyright(C) 2004 Konstantine A Beklemishev
12 * 2003-12-03: Adam Turowski
13 * initial code.
14 * 2004-11-07: Vitaliy Sardyko
15 * updated to 2.6.7
16 * 2005-01-10: Konstantine A Beklemishev
17 * adapted for RoverPC P1 (MitacMio336)
20 #include <linux/module.h>
21 #include <linux/init.h>
22 #include <linux/notifier.h>
23 #include <linux/lcd.h>
24 #include <linux/backlight.h>
26 /* #include <asm/arch/roverp1-init.h>
27 * #include <asm/arch/roverp1-gpio.h> */
28 #include <linux/fb.h>
29 #include <asm/arch/pxafb.h>
31 #define DEBUG 1
35 #if DEBUG
36 # define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
37 #else
38 # define DPRINTK(fmt, args...)
39 #endif
42 static int roverp1_lcd_set_power (struct lcd_device *lm, int setp)
44 return 0;
47 static int roverp1_lcd_get_power (struct lcd_device *lm)
49 return 0;
51 struct lcd_properties roverp1_lcd_properties =
53 .owner = THIS_MODULE,
54 .set_power = roverp1_lcd_set_power,
55 .get_power = roverp1_lcd_get_power,
56 };
58 static void roverp1_backlight_power(int on)
63 static struct pxafb_mach_info roverp1_fb_info = {
64 .pixclock = 156551,
65 .bpp = 16,
66 .xres = 240,
67 .yres = 320,
68 .hsync_len = 24,
69 .vsync_len = 2,
70 .left_margin= 20,
71 .upper_margin = 5,
72 .right_margin = 12,
73 .lower_margin = 5,
74 .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
75 .lccr0 = 0x003008f0,
76 .lccr3 = 0x04400008,
77 .pxafb_backlight_power = roverp1_backlight_power
80 static int roverp1_backlight_set_power (struct backlight_device *bm, int on)
82 return 0;
85 static int roverp1_backlight_get_power (struct backlight_device *bm)
87 return 0;
90 static struct backlight_properties roverp1_backlight_properties =
92 .owner = THIS_MODULE,
93 .set_power = roverp1_backlight_set_power,
94 .get_power = roverp1_backlight_get_power,
97 static struct lcd_device *pxafb_lcd_device;
98 static struct backlight_device *pxafb_backlight_device;
100 int roverp1_lcd_init (void)
102 set_pxa_fb_info (&roverp1_fb_info);
104 pxafb_lcd_device = lcd_device_register("pxafb", NULL, &roverp1_lcd_properties);
105 if (IS_ERR (pxafb_lcd_device))
107 DPRINTK(" LCD device doesn't registered, booting failed !\n");
108 return IS_ERR (pxafb_lcd_device);
111 pxafb_backlight_device = backlight_device_register("pxafb", NULL, &roverp1_backlight_properties);
113 return IS_ERR (pxafb_backlight_device);
117 static void roverp1_lcd_exit (void)
119 lcd_device_unregister (pxafb_lcd_device);
120 backlight_device_unregister (pxafb_backlight_device);
123 module_init(roverp1_lcd_init);
124 module_exit(roverp1_lcd_exit);
126 MODULE_AUTHOR("Adam Turowski, Konstantine A Beklemishev");
127 MODULE_DESCRIPTION("LCD driver for RoverPC P1 (MitacMio336)");
128 MODULE_LICENSE("GPL");