Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Backlight Lowlevel Control Abstraction |
| 3 | * |
| 4 | * Copyright (C) 2003,2004 Hewlett-Packard Company |
| 5 | * |
| 6 | */ |
| 7 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #include <linux/module.h> |
| 9 | #include <linux/init.h> |
| 10 | #include <linux/device.h> |
| 11 | #include <linux/backlight.h> |
| 12 | #include <linux/notifier.h> |
| 13 | #include <linux/ctype.h> |
| 14 | #include <linux/err.h> |
| 15 | #include <linux/fb.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
Richard Purdie | 321709c | 2007-02-10 15:04:08 +0000 | [diff] [blame] | 17 | #ifdef CONFIG_PMAC_BACKLIGHT |
| 18 | #include <asm/backlight.h> |
| 19 | #endif |
James Simmons | 3d5eead | 2006-12-08 02:40:47 -0800 | [diff] [blame] | 20 | |
| 21 | #if defined(CONFIG_FB) || (defined(CONFIG_FB_MODULE) && \ |
| 22 | defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)) |
| 23 | /* This callback gets called when something important happens inside a |
| 24 | * framebuffer driver. We're looking if that important event is blanking, |
| 25 | * and if it is, we're switching backlight power as well ... |
| 26 | */ |
| 27 | static int fb_notifier_callback(struct notifier_block *self, |
| 28 | unsigned long event, void *data) |
| 29 | { |
| 30 | struct backlight_device *bd; |
| 31 | struct fb_event *evdata = data; |
| 32 | |
| 33 | /* If we aren't interested in this event, skip it immediately ... */ |
Richard Purdie | 994efac | 2007-02-09 09:46:45 +0000 | [diff] [blame] | 34 | if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK) |
James Simmons | 3d5eead | 2006-12-08 02:40:47 -0800 | [diff] [blame] | 35 | return 0; |
| 36 | |
| 37 | bd = container_of(self, struct backlight_device, fb_notif); |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 38 | mutex_lock(&bd->ops_lock); |
| 39 | if (bd->ops) |
| 40 | if (!bd->ops->check_fb || |
| 41 | bd->ops->check_fb(evdata->info)) { |
| 42 | bd->props.fb_blank = *(int *)evdata->data; |
Richard Purdie | 28ee086 | 2007-02-08 22:25:09 +0000 | [diff] [blame] | 43 | backlight_update_status(bd); |
James Simmons | 3d5eead | 2006-12-08 02:40:47 -0800 | [diff] [blame] | 44 | } |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 45 | mutex_unlock(&bd->ops_lock); |
James Simmons | 3d5eead | 2006-12-08 02:40:47 -0800 | [diff] [blame] | 46 | return 0; |
| 47 | } |
| 48 | |
| 49 | static int backlight_register_fb(struct backlight_device *bd) |
| 50 | { |
| 51 | memset(&bd->fb_notif, 0, sizeof(bd->fb_notif)); |
| 52 | bd->fb_notif.notifier_call = fb_notifier_callback; |
| 53 | |
| 54 | return fb_register_client(&bd->fb_notif); |
| 55 | } |
| 56 | |
| 57 | static void backlight_unregister_fb(struct backlight_device *bd) |
| 58 | { |
| 59 | fb_unregister_client(&bd->fb_notif); |
| 60 | } |
| 61 | #else |
| 62 | static inline int backlight_register_fb(struct backlight_device *bd) |
| 63 | { |
| 64 | return 0; |
| 65 | } |
| 66 | |
| 67 | static inline void backlight_unregister_fb(struct backlight_device *bd) |
| 68 | { |
| 69 | } |
| 70 | #endif /* CONFIG_FB */ |
| 71 | |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 72 | static ssize_t backlight_show_power(struct device *dev, |
| 73 | struct device_attribute *attr,char *buf) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | { |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 75 | struct backlight_device *bd = to_backlight_device(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 77 | return sprintf(buf, "%d\n", bd->props.power); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | } |
| 79 | |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 80 | static ssize_t backlight_store_power(struct device *dev, |
| 81 | struct device_attribute *attr, const char *buf, size_t count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | { |
Richard Purdie | 68673af | 2006-05-15 09:44:15 -0700 | [diff] [blame] | 83 | int rc = -ENXIO; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | char *endp; |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 85 | struct backlight_device *bd = to_backlight_device(dev); |
Richard Purdie | 68673af | 2006-05-15 09:44:15 -0700 | [diff] [blame] | 86 | int power = simple_strtoul(buf, &endp, 0); |
| 87 | size_t size = endp - buf; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | |
Richard Purdie | 68673af | 2006-05-15 09:44:15 -0700 | [diff] [blame] | 89 | if (*endp && isspace(*endp)) |
| 90 | size++; |
| 91 | if (size != count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | return -EINVAL; |
| 93 | |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 94 | mutex_lock(&bd->ops_lock); |
| 95 | if (bd->ops) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | pr_debug("backlight: set power to %d\n", power); |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 97 | bd->props.power = power; |
Richard Purdie | 28ee086 | 2007-02-08 22:25:09 +0000 | [diff] [blame] | 98 | backlight_update_status(bd); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | rc = count; |
Richard Purdie | 6ca0176 | 2006-03-31 02:31:49 -0800 | [diff] [blame] | 100 | } |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 101 | mutex_unlock(&bd->ops_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | |
| 103 | return rc; |
| 104 | } |
| 105 | |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 106 | static ssize_t backlight_show_brightness(struct device *dev, |
| 107 | struct device_attribute *attr, char *buf) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | { |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 109 | struct backlight_device *bd = to_backlight_device(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 111 | return sprintf(buf, "%d\n", bd->props.brightness); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | } |
| 113 | |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 114 | static ssize_t backlight_store_brightness(struct device *dev, |
| 115 | struct device_attribute *attr, const char *buf, size_t count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | { |
Richard Purdie | 68673af | 2006-05-15 09:44:15 -0700 | [diff] [blame] | 117 | int rc = -ENXIO; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | char *endp; |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 119 | struct backlight_device *bd = to_backlight_device(dev); |
Richard Purdie | 68673af | 2006-05-15 09:44:15 -0700 | [diff] [blame] | 120 | int brightness = simple_strtoul(buf, &endp, 0); |
| 121 | size_t size = endp - buf; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | |
Richard Purdie | 68673af | 2006-05-15 09:44:15 -0700 | [diff] [blame] | 123 | if (*endp && isspace(*endp)) |
| 124 | size++; |
| 125 | if (size != count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | return -EINVAL; |
| 127 | |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 128 | mutex_lock(&bd->ops_lock); |
| 129 | if (bd->ops) { |
| 130 | if (brightness > bd->props.max_brightness) |
Richard Purdie | 6ca0176 | 2006-03-31 02:31:49 -0800 | [diff] [blame] | 131 | rc = -EINVAL; |
| 132 | else { |
| 133 | pr_debug("backlight: set brightness to %d\n", |
| 134 | brightness); |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 135 | bd->props.brightness = brightness; |
Richard Purdie | 28ee086 | 2007-02-08 22:25:09 +0000 | [diff] [blame] | 136 | backlight_update_status(bd); |
Richard Purdie | 6ca0176 | 2006-03-31 02:31:49 -0800 | [diff] [blame] | 137 | rc = count; |
| 138 | } |
| 139 | } |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 140 | mutex_unlock(&bd->ops_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | |
| 142 | return rc; |
| 143 | } |
| 144 | |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 145 | static ssize_t backlight_show_max_brightness(struct device *dev, |
| 146 | struct device_attribute *attr, char *buf) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | { |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 148 | struct backlight_device *bd = to_backlight_device(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 149 | |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 150 | return sprintf(buf, "%d\n", bd->props.max_brightness); |
Richard Purdie | 6ca0176 | 2006-03-31 02:31:49 -0800 | [diff] [blame] | 151 | } |
| 152 | |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 153 | static ssize_t backlight_show_actual_brightness(struct device *dev, |
| 154 | struct device_attribute *attr, char *buf) |
Richard Purdie | 6ca0176 | 2006-03-31 02:31:49 -0800 | [diff] [blame] | 155 | { |
| 156 | int rc = -ENXIO; |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 157 | struct backlight_device *bd = to_backlight_device(dev); |
Richard Purdie | 6ca0176 | 2006-03-31 02:31:49 -0800 | [diff] [blame] | 158 | |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 159 | mutex_lock(&bd->ops_lock); |
| 160 | if (bd->ops && bd->ops->get_brightness) |
| 161 | rc = sprintf(buf, "%d\n", bd->ops->get_brightness(bd)); |
| 162 | mutex_unlock(&bd->ops_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | |
| 164 | return rc; |
| 165 | } |
| 166 | |
Adrian Bunk | 0ad90ef | 2007-08-11 10:27:19 +0100 | [diff] [blame^] | 167 | static struct class *backlight_class; |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 168 | |
| 169 | static void bl_device_release(struct device *dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | { |
| 171 | struct backlight_device *bd = to_backlight_device(dev); |
| 172 | kfree(bd); |
| 173 | } |
| 174 | |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 175 | static struct device_attribute bl_device_attributes[] = { |
| 176 | __ATTR(bl_power, 0644, backlight_show_power, backlight_store_power), |
| 177 | __ATTR(brightness, 0644, backlight_show_brightness, |
Richard Purdie | 6ca0176 | 2006-03-31 02:31:49 -0800 | [diff] [blame] | 178 | backlight_store_brightness), |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 179 | __ATTR(actual_brightness, 0444, backlight_show_actual_brightness, |
Richard Purdie | 6ca0176 | 2006-03-31 02:31:49 -0800 | [diff] [blame] | 180 | NULL), |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 181 | __ATTR(max_brightness, 0444, backlight_show_max_brightness, NULL), |
| 182 | __ATTR_NULL, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | }; |
| 184 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | /** |
| 186 | * backlight_device_register - create and register a new object of |
| 187 | * backlight_device class. |
| 188 | * @name: the name of the new object(must be the same as the name of the |
| 189 | * respective framebuffer device). |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 190 | * @devdata: an optional pointer to be stored for private driver use. The |
| 191 | * methods may retrieve it by using bl_get_data(bd). |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 192 | * @ops: the backlight operations structure. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | * |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 194 | * Creates and registers new backlight device. Returns either an |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 195 | * ERR_PTR() or a pointer to the newly allocated device. |
| 196 | */ |
Yu Luming | 519ab5f | 2006-12-19 12:56:15 -0800 | [diff] [blame] | 197 | struct backlight_device *backlight_device_register(const char *name, |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 198 | struct device *parent, void *devdata, struct backlight_ops *ops) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 199 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | struct backlight_device *new_bd; |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 201 | int rc; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 | |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 203 | pr_debug("backlight_device_register: name=%s\n", name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 205 | new_bd = kzalloc(sizeof(struct backlight_device), GFP_KERNEL); |
Dmitry Torokhov | 90968e8 | 2007-02-08 00:12:28 +0000 | [diff] [blame] | 206 | if (!new_bd) |
Jean Delvare | 10ad1b7 | 2006-03-09 17:33:36 -0800 | [diff] [blame] | 207 | return ERR_PTR(-ENOMEM); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | |
Richard Purdie | 28ee086 | 2007-02-08 22:25:09 +0000 | [diff] [blame] | 209 | mutex_init(&new_bd->update_lock); |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 210 | mutex_init(&new_bd->ops_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 211 | |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 212 | new_bd->dev.class = backlight_class; |
| 213 | new_bd->dev.parent = parent; |
| 214 | new_bd->dev.release = bl_device_release; |
| 215 | strlcpy(new_bd->dev.bus_id, name, BUS_ID_SIZE); |
| 216 | dev_set_drvdata(&new_bd->dev, devdata); |
| 217 | |
| 218 | rc = device_register(&new_bd->dev); |
Dmitry Torokhov | 90968e8 | 2007-02-08 00:12:28 +0000 | [diff] [blame] | 219 | if (rc) { |
Dmitry Torokhov | 2fd5a15 | 2007-02-07 22:25:50 +0000 | [diff] [blame] | 220 | kfree(new_bd); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | return ERR_PTR(rc); |
| 222 | } |
| 223 | |
James Simmons | 3d5eead | 2006-12-08 02:40:47 -0800 | [diff] [blame] | 224 | rc = backlight_register_fb(new_bd); |
Dmitry Torokhov | 2fd5a15 | 2007-02-07 22:25:50 +0000 | [diff] [blame] | 225 | if (rc) { |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 226 | device_unregister(&new_bd->dev); |
Dmitry Torokhov | 2fd5a15 | 2007-02-07 22:25:50 +0000 | [diff] [blame] | 227 | return ERR_PTR(rc); |
| 228 | } |
| 229 | |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 230 | new_bd->ops = ops; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | |
Richard Purdie | 321709c | 2007-02-10 15:04:08 +0000 | [diff] [blame] | 232 | #ifdef CONFIG_PMAC_BACKLIGHT |
| 233 | mutex_lock(&pmac_backlight_mutex); |
| 234 | if (!pmac_backlight) |
| 235 | pmac_backlight = new_bd; |
| 236 | mutex_unlock(&pmac_backlight_mutex); |
| 237 | #endif |
| 238 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | return new_bd; |
| 240 | } |
| 241 | EXPORT_SYMBOL(backlight_device_register); |
| 242 | |
| 243 | /** |
| 244 | * backlight_device_unregister - unregisters a backlight device object. |
| 245 | * @bd: the backlight device object to be unregistered and freed. |
| 246 | * |
| 247 | * Unregisters a previously registered via backlight_device_register object. |
| 248 | */ |
| 249 | void backlight_device_unregister(struct backlight_device *bd) |
| 250 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | if (!bd) |
| 252 | return; |
| 253 | |
Richard Purdie | 321709c | 2007-02-10 15:04:08 +0000 | [diff] [blame] | 254 | #ifdef CONFIG_PMAC_BACKLIGHT |
| 255 | mutex_lock(&pmac_backlight_mutex); |
| 256 | if (pmac_backlight == bd) |
| 257 | pmac_backlight = NULL; |
| 258 | mutex_unlock(&pmac_backlight_mutex); |
| 259 | #endif |
Richard Purdie | 599a52d | 2007-02-10 23:07:48 +0000 | [diff] [blame] | 260 | mutex_lock(&bd->ops_lock); |
| 261 | bd->ops = NULL; |
| 262 | mutex_unlock(&bd->ops_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 263 | |
James Simmons | 3d5eead | 2006-12-08 02:40:47 -0800 | [diff] [blame] | 264 | backlight_unregister_fb(bd); |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 265 | device_unregister(&bd->dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | } |
| 267 | EXPORT_SYMBOL(backlight_device_unregister); |
| 268 | |
| 269 | static void __exit backlight_class_exit(void) |
| 270 | { |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 271 | class_destroy(backlight_class); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | } |
| 273 | |
| 274 | static int __init backlight_class_init(void) |
| 275 | { |
Richard Purdie | 655bfd7 | 2007-07-09 12:17:24 +0100 | [diff] [blame] | 276 | backlight_class = class_create(THIS_MODULE, "backlight"); |
| 277 | if (IS_ERR(backlight_class)) { |
| 278 | printk(KERN_WARNING "Unable to create backlight class; errno = %ld\n", |
| 279 | PTR_ERR(backlight_class)); |
| 280 | return PTR_ERR(backlight_class); |
| 281 | } |
| 282 | |
| 283 | backlight_class->dev_attrs = bl_device_attributes; |
| 284 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | } |
| 286 | |
| 287 | /* |
| 288 | * if this is compiled into the kernel, we need to ensure that the |
| 289 | * class is registered before users of the class try to register lcd's |
| 290 | */ |
| 291 | postcore_initcall(backlight_class_init); |
| 292 | module_exit(backlight_class_exit); |
| 293 | |
| 294 | MODULE_LICENSE("GPL"); |
| 295 | MODULE_AUTHOR("Jamey Hicks <jamey.hicks@hp.com>, Andrew Zabolotny <zap@homelink.ru>"); |
| 296 | MODULE_DESCRIPTION("Backlight Lowlevel Control Abstraction"); |