13 #include <linux/module.h>
14 #include <linux/kernel.h>
25 #define HP680_MAX_INTENSITY 255
26 #define HP680_DEFAULT_INTENSITY 10
28 static int hp680bl_suspended;
29 static int current_intensity = 0;
36 int intensity = bd->
props.brightness;
42 if (hp680bl_suspended)
46 if (intensity && current_intensity == 0) {
52 }
else if (intensity == 0 && current_intensity != 0) {
58 }
else if (intensity) {
61 spin_unlock_irqrestore(&bl_lock, flags);
63 current_intensity = intensity;
72 hp680bl_suspended = 1;
73 hp680bl_send_intensity(bd);
81 hp680bl_suspended = 0;
82 hp680bl_send_intensity(bd);
86 #define hp680bl_suspend NULL
87 #define hp680bl_resume NULL
92 hp680bl_send_intensity(bd);
98 return current_intensity;
102 .get_brightness = hp680bl_get_intensity,
103 .update_status = hp680bl_set_intensity,
115 &hp680bl_ops, &
props);
119 platform_set_drvdata(pdev, bd);
122 hp680bl_send_intensity(bd);
131 bd->
props.brightness = 0;
133 hp680bl_send_intensity(bd);
141 .probe = hp680bl_probe,
142 .remove = hp680bl_remove,
152 static int __init hp680bl_init(
void)
159 hp680bl_device = platform_device_register_simple(
"hp680-bl", -1,
161 if (IS_ERR(hp680bl_device)) {
163 return PTR_ERR(hp680bl_device);
168 static void __exit hp680bl_exit(
void)