2 * Use consistent with the GNU GPL is permitted,
3 * provided that this copyright notice is
4 * preserved in its entirety in all copies and derived works.
6 * Copyright (C) 2006 Serge Nikolaenko
10 #include <linux/types.h>
11 #include <asm/arch/hardware.h> /* for pxa-regs.h (__REG) */
12 #include <linux/platform_device.h>
13 #include <asm/arch/pxa-regs.h> /* LCCR[0,1,2,3]* */
14 #include <asm/mach-types.h>
15 #include <linux/backlight.h> /* backlight_device */
16 #include <linux/err.h>
18 #include <asm/arch/asus730-gpio.h>
19 #include <asm/arch/sharpsl.h> /* for struct corgibl_machinfo */
21 #include "../generic.h"
23 #define A730_MAX_INTENSITY 0xff
24 #define A730_DEFAULT_INTENSITY (A730_MAX_INTENSITY / 4)
28 static void a730_set_bl_intensity(int intensity
)
30 printk("intensity=0x%x\n", intensity
);
31 if (intensity
< 0 || intensity
> 255) return;
34 pxa_gpio_mode(GPIO_NR_A730_BACKLIGHT_EN
| GPIO_OUT
);
35 SET_A730_GPIO(BACKLIGHT_EN
, intensity
!= 0);
37 //PWM_PWDUTY0 = intensity;
38 //PWM_PERVAL0 = A730_MAX_INTENSITY;
42 pxa_set_cken(CKEN0_PWM0
, 1);
43 PWM_PWDUTY0
= intensity
;
44 PWM_PERVAL0
= A730_MAX_INTENSITY
;
48 PWM_PWDUTY0
= A730_MAX_INTENSITY
;
50 pxa_set_cken(CKEN0_PWM0
, 0);
54 static struct corgibl_machinfo a730_bl_machinfo
= {
55 .default_intensity
= A730_DEFAULT_INTENSITY
,
57 .max_intensity
= A730_MAX_INTENSITY
,
58 .set_bl_intensity
= a730_set_bl_intensity
,
61 struct platform_device a730_bl
= {
64 .platform_data
= &a730_bl_machinfo
,
68 MODULE_AUTHOR("Serge Nikolaenko <mypal_hh@utl.ru>");
69 MODULE_DESCRIPTION("Backlight driver for ASUS A730(W)");
70 MODULE_LICENSE("GPL");