acpi,rfkill,backlight: comapl-laptop update - clarify the code
Subsystems (2)
PATCH RESEND 1/2 acpi,rfkill,backlight: comapl-laptop update - clarify the code
From: Cezary Jackiewicz <[email protected]>
* Clarify the code
* The current LCD brightness after booting should now be reflected in the standard backlight interface sysfs file (previously it was always set to 0).
Signed-off-by Cezary Jackiewicz <[email protected]>
---
drivers/misc/compal-laptop.c +16 -21
@@ -24,19 +24,10 @@*/ /* -* comapl-laptop.c - Compal laptop support. +* compal-laptop.c - Compal laptop support. * -* This driver exports a few files in /sys/devices/platform/compal-laptop/: -* -* wlan - wlan subsystem state: contains 0 or 1 (rw) -* -* bluetooth - Bluetooth subsystem state: contains 0 or 1 (rw) -* -* raw - raw value taken from embedded controller register (ro) -* -* In addition to these platform device attributes the driver -* registers itself in the Linux backlight control subsystem and is -* available to userspace under /sys/class/backlight/compal-laptop/. +* This driver registers itself in the Linux backlight control subsystem +* and rfkill switch subsystem. * * This driver might work on other laptops produced by Compal. If you * want to try it you can pass force=1 as argument to the module which
@@ -53,7 +44,10 @@#include <linux/platform_device.h> #include <linux/autoconf.h> -#define COMPAL_DRIVER_VERSION "0.2.6" +#define COMPAL_DRIVER_VERSION "0.3.0" +#define COMPAL_DRIVER_NAME "compal-laptop" +#define COMPAL_ERR KERN_ERR COMPAL_DRIVER_NAME ": " +#define COMPAL_INFO KERN_INFO COMPAL_DRIVER_NAME ": "#define COMPAL_LCD_LEVEL_MAX 8
@@ -253,7 +247,7 @@static struct platform_driver compal_driver = { .driver = { - .name ="compal-laptop" , + .name =COMPAL_DRIVER_NAME , .owner =THIS_MODULE , } };
@@ -264,7 +258,7 @@static int dmi_check_cb (const struct dmi_system_id *id) { -printk (KERN_INFO "compal-laptop: Identified laptop model '%s'.\n" , +printk (COMPAL_INFO "Identified laptop model '%s'.\n" , id->ident);return 0 ;
@@ -326,12 +320,13 @@/* Register backlight stuff */ - compalbl_device =backlight_device_register ("compal-laptop" ,NULL ,NULL , - &compalbl_ops); + compalbl_device =backlight_device_register (COMPAL_DRIVER_NAME , +NULL ,NULL , &compalbl_ops);if (IS_ERR (compalbl_device))return PTR_ERR (compalbl_device); compalbl_device->props.max_brightness =COMPAL_LCD_LEVEL_MAX -1 ; + compalbl_device->props.brightness =get_lcd_level (); ret =platform_driver_register (&compal_driver);if (ret)
@@ -339,7 +334,7 @@/* Register platform stuff */ - compal_device =platform_device_alloc ("compal-laptop" ,-1 ); + compal_device =platform_device_alloc (COMPAL_DRIVER_NAME ,-1 );if (!compal_device) { ret = -ENOMEM ; goto fail_platform_driver;
@@ -354,8 +349,8 @@if (ret) goto fail_platform_device2; -printk (KERN_INFO "compal-laptop: driver " COMPAL_DRIVER_VERSION -" successfully loaded.\n" ); +printk (COMPAL_INFO "driver " COMPAL_DRIVER_VERSION +" successfully loaded.\n" );return 0 ;
@@ -386,7 +381,7 @@platform_driver_unregister (&compal_driver);backlight_device_unregister (compalbl_device); -printk (KERN_INFO "compal-laptop: driver unloaded.\n" ); +printk (COMPAL_INFO "driver unloaded.\n" ); }module_init (compal_init);