hh.org updates
[hh.org.git] / arch / arm / mach-pxa / aximx30 / aximx30_lcd.c
blob2b9d2d8305b56da7f25248ddcb570403bb4aeee2
1 /*
2 * LCD driver for Dell Axim X30
3 *
4 * Authors: Giuseppe Zompatori <giuseppe_zompatori@yahoo.it>
5 *
6 * based on previous work, see below:
7 *
8 * Machine initialization for Dell Axim X3
10 * Authors: Andrew Zabolotny <zap@homelink.ru>
12 * For now this is mostly a placeholder file; since I don't own an Axim X3
13 * it is supposed the project to be overtaken by somebody else. The code
14 * in here is *supposed* to work so that you can at least boot to the command
15 * line, but there is no guarantee.
17 * This file is subject to the terms and conditions of the GNU General Public
18 * License. See the file COPYING in the main directory of this archive for
19 * more details.
22 #include <linux/module.h>
23 #include <linux/init.h>
24 #include <linux/notifier.h>
25 #include <linux/lcd.h>
26 #include <linux/backlight.h>
27 #include <linux/err.h>
29 #include <asm/arch/aximx3-init.h>
30 #include <asm/arch/aximx3-gpio.h>
31 #include <linux/fb.h>
32 #include <asm/mach-types.h>
33 #include "asm/arch/pxa-regs.h"
34 #include "asm/arch/pxafb.h"
36 static int aximx30_lcd_set_power (struct lcd_device *lm, int setp)
38 return 0;
41 static int aximx30_lcd_get_power (struct lcd_device *lm)
43 return 0;
46 static struct pxafb_mach_info aximx30_fb_info =
48 .pixclock = 0, // --
49 .bpp = 16, // ??
50 .xres = 240, // PPL + 1
51 .yres = 320, // LPP + 1
52 .hsync_len = 20, // HSW + 1
53 .vsync_len = 4, // VSW + 1
54 .left_margin = 59, // BLW + 1
55 .upper_margin = 4, // BFW
56 .right_margin = 16, // ELW + 1
57 .lower_margin = 0, // EFW
58 .sync = 0, // --
59 .lccr0 = 0x003008f9, // yes that's ugly, but it's due a limitation of the
60 .lccr3 = 0x04900008 // pxafb driver assuming pxa25x fbs...
63 struct lcd_properties aximx30_lcd_properties =
65 .owner = THIS_MODULE,
66 .set_power = aximx30_lcd_set_power,
67 .get_power = aximx30_lcd_get_power,
68 /* @@ more here @@ */
71 static int aximx30_backlight_set_power (struct backlight_device *bm, int on)
73 return 0;
76 static int aximx30_backlight_get_power (struct backlight_device *bm)
78 return 0;
81 static struct backlight_properties aximx30_backlight_properties =
83 .owner = THIS_MODULE,
84 .set_power = aximx30_backlight_set_power,
85 .get_power = aximx30_backlight_get_power,
88 static struct lcd_device *pxafb_lcd_device;
89 static struct backlight_device *pxafb_backlight_device;
91 static int __init
92 aximx30_lcd_init (void)
94 // if (! machine_is_x30 ())
95 // return -ENODEV;
97 set_pxa_fb_info(&aximx30_fb_info);
98 pxafb_lcd_device = lcd_device_register("pxafb", NULL, &aximx30_lcd_properties);
99 // if (IS_ERR (pxafb_lcd_device))
100 // return PTR_ERR (pxafb_lcd_device);
101 pxafb_backlight_device = backlight_device_register("pxafb", NULL,
102 &aximx30_backlight_properties);
103 // if (IS_ERR (pxafb_backlight_device)) {
104 // lcd_device_unregister (pxafb_lcd_device);
105 // return PTR_ERR (pxafb_backlight_device);
106 // }
108 return 0;
111 static void __exit
112 aximx30_lcd_exit (void)
114 lcd_device_unregister (pxafb_lcd_device);
115 backlight_device_unregister (pxafb_backlight_device);
118 module_init (aximx30_lcd_init);
119 module_exit (aximx30_lcd_exit);
121 MODULE_AUTHOR("Giuseppe Zompatori <giuseppe_zompatori@yahoo.it>");
122 MODULE_DESCRIPTION("Dell Axim X30 Core frambuffer driver");
123 MODULE_LICENSE("GPL");