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
14 * 2004-11-07: Vitaliy Sardyko
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> */
29 #include <asm/arch/pxafb.h>
36 # define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
38 # define DPRINTK(fmt, args...)
42 static int roverp1_lcd_set_power (struct lcd_device
*lm
, int setp
)
47 static int roverp1_lcd_get_power (struct lcd_device
*lm
)
51 struct lcd_properties roverp1_lcd_properties
=
54 .set_power
= roverp1_lcd_set_power
,
55 .get_power
= roverp1_lcd_get_power
,
58 static void roverp1_backlight_power(int on
)
63 static struct pxafb_mach_info roverp1_fb_info
= {
74 .sync
= FB_SYNC_HOR_HIGH_ACT
|FB_SYNC_VERT_HIGH_ACT
,
77 .pxafb_backlight_power
= roverp1_backlight_power
80 static int roverp1_backlight_set_power (struct backlight_device
*bm
, int on
)
85 static int roverp1_backlight_get_power (struct backlight_device
*bm
)
90 static struct backlight_properties roverp1_backlight_properties
=
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");