acer-wmi: schedule threeg and interface sysfs for feature removal
[linux-2.6.git] / drivers / platform / x86 / acer-wmi.c
index 4c82093..089db86 100644 (file)
@@ -22,6 +22,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -46,12 +48,6 @@ MODULE_AUTHOR("Carlos Corbacho");
 MODULE_DESCRIPTION("Acer Laptop WMI Extras Driver");
 MODULE_LICENSE("GPL");
 
-#define ACER_LOGPREFIX "acer-wmi: "
-#define ACER_ERR KERN_ERR ACER_LOGPREFIX
-#define ACER_NOTICE KERN_NOTICE ACER_LOGPREFIX
-#define ACER_INFO KERN_INFO ACER_LOGPREFIX
-#define ACER_WARNING KERN_WARNING ACER_LOGPREFIX
-
 /*
  * Magic Number
  * Meaning is unknown - this number is required for writing to ACPI for AMW0
@@ -84,7 +80,7 @@ MODULE_LICENSE("GPL");
 #define AMW0_GUID1             "67C3371D-95A3-4C37-BB61-DD47B491DAAB"
 #define AMW0_GUID2             "431F16ED-0C2B-444C-B267-27DEB140CF9C"
 #define WMID_GUID1             "6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3"
-#define WMID_GUID2             "95764E09-FB56-4e83-B31A-37761F60994A"
+#define WMID_GUID2             "95764E09-FB56-4E83-B31A-37761F60994A"
 #define WMID_GUID3             "61EF69EA-865C-4BC3-A502-A0DEBA0CB531"
 
 /*
@@ -93,7 +89,7 @@ MODULE_LICENSE("GPL");
 #define ACERWMID_EVENT_GUID "676AA15E-6A47-4D9F-A2CC-1E6D18D14026"
 
 MODULE_ALIAS("wmi:67C3371D-95A3-4C37-BB61-DD47B491DAAB");
-MODULE_ALIAS("wmi:6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3");
+MODULE_ALIAS("wmi:6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3");
 MODULE_ALIAS("wmi:676AA15E-6A47-4D9F-A2CC-1E6D18D14026");
 
 enum acer_wmi_event_ids {
@@ -102,13 +98,26 @@ enum acer_wmi_event_ids {
 
 static const struct key_entry acer_wmi_keymap[] = {
        {KE_KEY, 0x01, {KEY_WLAN} },     /* WiFi */
+       {KE_KEY, 0x03, {KEY_WLAN} },     /* WiFi */
        {KE_KEY, 0x12, {KEY_BLUETOOTH} },       /* BT */
        {KE_KEY, 0x21, {KEY_PROG1} },    /* Backup */
        {KE_KEY, 0x22, {KEY_PROG2} },    /* Arcade */
        {KE_KEY, 0x23, {KEY_PROG3} },    /* P_Key */
        {KE_KEY, 0x24, {KEY_PROG4} },    /* Social networking_Key */
+       {KE_IGNORE, 0x41, {KEY_MUTE} },
+       {KE_IGNORE, 0x42, {KEY_PREVIOUSSONG} },
+       {KE_IGNORE, 0x43, {KEY_NEXTSONG} },
+       {KE_IGNORE, 0x44, {KEY_PLAYPAUSE} },
+       {KE_IGNORE, 0x45, {KEY_STOP} },
+       {KE_IGNORE, 0x48, {KEY_VOLUMEUP} },
+       {KE_IGNORE, 0x49, {KEY_VOLUMEDOWN} },
+       {KE_IGNORE, 0x61, {KEY_SWITCHVIDEOMODE} },
+       {KE_IGNORE, 0x62, {KEY_BRIGHTNESSUP} },
+       {KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} },
        {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */
+       {KE_IGNORE, 0x81, {KEY_SLEEP} },
        {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad On/Off */
+       {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
        {KE_END, 0}
 };
 
@@ -126,6 +135,7 @@ struct event_return_value {
  */
 #define ACER_WMID3_GDS_WIRELESS                (1<<0)  /* WiFi */
 #define ACER_WMID3_GDS_THREEG          (1<<6)  /* 3G */
+#define ACER_WMID3_GDS_WIMAX           (1<<7)  /* WiMAX */
 #define ACER_WMID3_GDS_BLUETOOTH       (1<<11) /* BT */
 
 struct lm_input_params {
@@ -221,6 +231,7 @@ struct acer_debug {
 static struct rfkill *wireless_rfkill;
 static struct rfkill *bluetooth_rfkill;
 static struct rfkill *threeg_rfkill;
+static bool rfkill_inited;
 
 /* Each low-level interface must define at least some of the following */
 struct wmi_interface {
@@ -740,8 +751,11 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out)
 
        obj = (union acpi_object *) result.pointer;
        if (obj && obj->type == ACPI_TYPE_BUFFER &&
-               obj->buffer.length == sizeof(u32)) {
+               (obj->buffer.length == sizeof(u32) ||
+               obj->buffer.length == sizeof(u64))) {
                tmp = *((u32 *) obj->buffer.pointer);
+       } else if (obj->type == ACPI_TYPE_INTEGER) {
+               tmp = (u32) obj->integer.value;
        } else {
                tmp = 0;
        }
@@ -845,7 +859,7 @@ static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
        has_type_aa = true;
        type_aa = (struct hotkey_function_type_aa *) header;
 
-       printk(ACER_INFO "Function bitmap for Communication Button: 0x%x\n",
+       pr_info("Function bitmap for Communication Button: 0x%x\n",
                type_aa->commun_func_bitmap);
 
        if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_WIRELESS)
@@ -869,8 +883,11 @@ static acpi_status WMID_set_capabilities(void)
 
        obj = (union acpi_object *) out.pointer;
        if (obj && obj->type == ACPI_TYPE_BUFFER &&
-               obj->buffer.length == sizeof(u32)) {
+               (obj->buffer.length == sizeof(u32) ||
+               obj->buffer.length == sizeof(u64))) {
                devices = *((u32 *) obj->buffer.pointer);
+       } else if (obj->type == ACPI_TYPE_INTEGER) {
+               devices = (u32) obj->integer.value;
        } else {
                kfree(out.pointer);
                return AE_ERROR;
@@ -879,7 +896,8 @@ static acpi_status WMID_set_capabilities(void)
        dmi_walk(type_aa_dmi_decode, NULL);
        if (!has_type_aa) {
                interface->capability |= ACER_CAP_WIRELESS;
-               interface->capability |= ACER_CAP_THREEG;
+               if (devices & 0x40)
+                       interface->capability |= ACER_CAP_THREEG;
                if (devices & 0x10)
                        interface->capability |= ACER_CAP_BLUETOOTH;
        }
@@ -964,10 +982,12 @@ static void __init acer_commandline_init(void)
         * These will all fail silently if the value given is invalid, or the
         * capability isn't available on the given interface
         */
-       set_u32(mailled, ACER_CAP_MAILLED);
-       if (!has_type_aa)
+       if (mailled >= 0)
+               set_u32(mailled, ACER_CAP_MAILLED);
+       if (!has_type_aa && threeg >= 0)
                set_u32(threeg, ACER_CAP_THREEG);
-       set_u32(brightness, ACER_CAP_BRIGHTNESS);
+       if (brightness >= 0)
+               set_u32(brightness, ACER_CAP_BRIGHTNESS);
 }
 
 /*
@@ -1037,7 +1057,7 @@ static int __devinit acer_backlight_init(struct device *dev)
        bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops,
                                       &props);
        if (IS_ERR(bd)) {
-               printk(ACER_ERR "Could not register Acer backlight device\n");
+               pr_err("Could not register Acer backlight device\n");
                acer_backlight_device = NULL;
                return PTR_ERR(bd);
        }
@@ -1084,8 +1104,7 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
                return AE_ERROR;
        }
        if (obj->buffer.length != 8) {
-               printk(ACER_WARNING "Unknown buffer length %d\n",
-                       obj->buffer.length);
+               pr_warn("Unknown buffer length %d\n", obj->buffer.length);
                kfree(obj);
                return AE_ERROR;
        }
@@ -1094,8 +1113,8 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
        kfree(obj);
 
        if (return_value.error_code || return_value.ec_return_value)
-               printk(ACER_WARNING "Get Device Status failed: "
-                       "0x%x - 0x%x\n", return_value.error_code,
+               pr_warn("Get Device Status failed: 0x%x - 0x%x\n",
+                       return_value.error_code,
                        return_value.ec_return_value);
        else
                *value = !!(return_value.devices & device);
@@ -1128,6 +1147,114 @@ static acpi_status get_device_status(u32 *value, u32 cap)
        }
 }
 
+static acpi_status wmid3_set_device_status(u32 value, u16 device)
+{
+       struct wmid3_gds_return_value return_value;
+       acpi_status status;
+       union acpi_object *obj;
+       u16 devices;
+       struct wmid3_gds_input_param params = {
+               .function_num = 0x1,
+               .hotkey_number = 0x01,
+               .devices = ACER_WMID3_GDS_WIRELESS |
+                               ACER_WMID3_GDS_THREEG |
+                               ACER_WMID3_GDS_WIMAX |
+                               ACER_WMID3_GDS_BLUETOOTH,
+       };
+       struct acpi_buffer input = {
+               sizeof(struct wmid3_gds_input_param),
+               &params
+       };
+       struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_buffer output2 = { ACPI_ALLOCATE_BUFFER, NULL };
+
+       status = wmi_evaluate_method(WMID_GUID3, 0, 0x2, &input, &output);
+       if (ACPI_FAILURE(status))
+               return status;
+
+       obj = output.pointer;
+
+       if (!obj)
+               return AE_ERROR;
+       else if (obj->type != ACPI_TYPE_BUFFER) {
+               kfree(obj);
+               return AE_ERROR;
+       }
+       if (obj->buffer.length != 8) {
+               pr_warning("Unknown buffer length %d\n", obj->buffer.length);
+               kfree(obj);
+               return AE_ERROR;
+       }
+
+       return_value = *((struct wmid3_gds_return_value *)obj->buffer.pointer);
+       kfree(obj);
+
+       if (return_value.error_code || return_value.ec_return_value) {
+               pr_warning("Get Current Device Status failed: "
+                       "0x%x - 0x%x\n", return_value.error_code,
+                       return_value.ec_return_value);
+               return status;
+       }
+
+       devices = return_value.devices;
+       params.function_num = 0x2;
+       params.hotkey_number = 0x01;
+       params.devices = (value) ? (devices | device) : (devices & ~device);
+
+       status = wmi_evaluate_method(WMID_GUID3, 0, 0x1, &input, &output2);
+       if (ACPI_FAILURE(status))
+               return status;
+
+       obj = output2.pointer;
+
+       if (!obj)
+               return AE_ERROR;
+       else if (obj->type != ACPI_TYPE_BUFFER) {
+               kfree(obj);
+               return AE_ERROR;
+       }
+       if (obj->buffer.length != 4) {
+               pr_warning("Unknown buffer length %d\n", obj->buffer.length);
+               kfree(obj);
+               return AE_ERROR;
+       }
+
+       return_value = *((struct wmid3_gds_return_value *)obj->buffer.pointer);
+       kfree(obj);
+
+       if (return_value.error_code || return_value.ec_return_value)
+               pr_warning("Set Device Status failed: "
+                       "0x%x - 0x%x\n", return_value.error_code,
+                       return_value.ec_return_value);
+
+       return status;
+}
+
+static acpi_status set_device_status(u32 value, u32 cap)
+{
+       if (wmi_has_guid(WMID_GUID3)) {
+               u16 device;
+
+               switch (cap) {
+               case ACER_CAP_WIRELESS:
+                       device = ACER_WMID3_GDS_WIRELESS;
+                       break;
+               case ACER_CAP_BLUETOOTH:
+                       device = ACER_WMID3_GDS_BLUETOOTH;
+                       break;
+               case ACER_CAP_THREEG:
+                       device = ACER_WMID3_GDS_THREEG;
+                       break;
+               default:
+                       return AE_ERROR;
+               }
+               return wmid3_set_device_status(value, device);
+
+       } else {
+               return set_u32(value, cap);
+       }
+}
+
 /*
  * Rfkill devices
  */
@@ -1162,9 +1289,13 @@ static int acer_rfkill_set(void *data, bool blocked)
 {
        acpi_status status;
        u32 cap = (unsigned long)data;
-       status = set_u32(!blocked, cap);
-       if (ACPI_FAILURE(status))
-               return -ENODEV;
+
+       if (rfkill_inited) {
+               status = set_device_status(!blocked, cap);
+               if (ACPI_FAILURE(status))
+                       return -ENODEV;
+       }
+
        return 0;
 }
 
@@ -1188,14 +1319,16 @@ static struct rfkill *acer_rfkill_register(struct device *dev,
                return ERR_PTR(-ENOMEM);
 
        status = get_device_status(&state, cap);
-       if (ACPI_SUCCESS(status))
-               rfkill_init_sw_state(rfkill_dev, !state);
 
        err = rfkill_register(rfkill_dev);
        if (err) {
                rfkill_destroy(rfkill_dev);
                return ERR_PTR(err);
        }
+
+       if (ACPI_SUCCESS(status))
+               rfkill_set_sw_state(rfkill_dev, !state);
+
        return rfkill_dev;
 }
 
@@ -1230,14 +1363,19 @@ static int acer_rfkill_init(struct device *dev)
                }
        }
 
-       schedule_delayed_work(&acer_rfkill_work, round_jiffies_relative(HZ));
+       rfkill_inited = true;
+
+       if (ec_raw_mode || !wmi_has_guid(ACERWMID_EVENT_GUID))
+               schedule_delayed_work(&acer_rfkill_work,
+                       round_jiffies_relative(HZ));
 
        return 0;
 }
 
 static void acer_rfkill_exit(void)
 {
-       cancel_delayed_work_sync(&acer_rfkill_work);
+       if (ec_raw_mode || !wmi_has_guid(ACERWMID_EVENT_GUID))
+               cancel_delayed_work_sync(&acer_rfkill_work);
 
        rfkill_unregister(wireless_rfkill);
        rfkill_destroy(wireless_rfkill);
@@ -1262,6 +1400,9 @@ static ssize_t show_bool_threeg(struct device *dev,
 {
        u32 result; \
        acpi_status status;
+
+       pr_info("This threeg sysfs will be removed in 2012"
+               " - used by: %s\n", current->comm);
        if (wmi_has_guid(WMID_GUID3))
                status = wmid3_get_device_status(&result,
                                ACER_WMID3_GDS_THREEG);
@@ -1277,8 +1418,10 @@ static ssize_t set_bool_threeg(struct device *dev,
 {
        u32 tmp = simple_strtoul(buf, NULL, 10);
        acpi_status status = set_u32(tmp, ACER_CAP_THREEG);
-               if (ACPI_FAILURE(status))
-                       return -EINVAL;
+       pr_info("This threeg sysfs will be removed in 2012"
+               " - used by: %s\n", current->comm);
+       if (ACPI_FAILURE(status))
+               return -EINVAL;
        return count;
 }
 static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg,
@@ -1287,6 +1430,8 @@ static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg,
 static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
        char *buf)
 {
+       pr_info("This interface sysfs will be removed in 2012"
+               " - used by: %s\n", current->comm);
        switch (interface->type) {
        case ACER_AMW0:
                return sprintf(buf, "AMW0\n");
@@ -1307,10 +1452,12 @@ static void acer_wmi_notify(u32 value, void *context)
        union acpi_object *obj;
        struct event_return_value return_value;
        acpi_status status;
+       u16 device_state;
+       const struct key_entry *key;
 
        status = wmi_get_event_data(value, &response);
        if (status != AE_OK) {
-               printk(ACER_WARNING "bad event status 0x%x\n", status);
+               pr_warn("bad event status 0x%x\n", status);
                return;
        }
 
@@ -1319,14 +1466,12 @@ static void acer_wmi_notify(u32 value, void *context)
        if (!obj)
                return;
        if (obj->type != ACPI_TYPE_BUFFER) {
-               printk(ACER_WARNING "Unknown response received %d\n",
-                       obj->type);
+               pr_warn("Unknown response received %d\n", obj->type);
                kfree(obj);
                return;
        }
        if (obj->buffer.length != 8) {
-               printk(ACER_WARNING "Unknown buffer length %d\n",
-                       obj->buffer.length);
+               pr_warn("Unknown buffer length %d\n", obj->buffer.length);
                kfree(obj);
                return;
        }
@@ -1336,13 +1481,35 @@ static void acer_wmi_notify(u32 value, void *context)
 
        switch (return_value.function) {
        case WMID_HOTKEY_EVENT:
-               if (!sparse_keymap_report_event(acer_wmi_input_dev,
-                               return_value.key_num, 1, true))
-                       printk(ACER_WARNING "Unknown key number - 0x%x\n",
+               device_state = return_value.device_state;
+               pr_debug("device state: 0x%x\n", device_state);
+
+               key = sparse_keymap_entry_from_scancode(acer_wmi_input_dev,
+                                                       return_value.key_num);
+               if (!key) {
+                       pr_warn("Unknown key number - 0x%x\n",
                                return_value.key_num);
+               } else {
+                       switch (key->keycode) {
+                       case KEY_WLAN:
+                       case KEY_BLUETOOTH:
+                               if (has_cap(ACER_CAP_WIRELESS))
+                                       rfkill_set_sw_state(wireless_rfkill,
+                                               !(device_state & ACER_WMID3_GDS_WIRELESS));
+                               if (has_cap(ACER_CAP_THREEG))
+                                       rfkill_set_sw_state(threeg_rfkill,
+                                               !(device_state & ACER_WMID3_GDS_THREEG));
+                               if (has_cap(ACER_CAP_BLUETOOTH))
+                                       rfkill_set_sw_state(bluetooth_rfkill,
+                                               !(device_state & ACER_WMID3_GDS_BLUETOOTH));
+                               break;
+                       }
+                       sparse_keymap_report_entry(acer_wmi_input_dev, key,
+                                                  1, true);
+               }
                break;
        default:
-               printk(ACER_WARNING "Unknown function number - %d - %d\n",
+               pr_warn("Unknown function number - %d - %d\n",
                        return_value.function, return_value.key_num);
                break;
        }
@@ -1371,8 +1538,7 @@ wmid3_set_lm_mode(struct lm_input_params *params,
                return AE_ERROR;
        }
        if (obj->buffer.length != 4) {
-               printk(ACER_WARNING "Unknown buffer length %d\n",
-                      obj->buffer.length);
+               pr_warn("Unknown buffer length %d\n", obj->buffer.length);
                kfree(obj);
                return AE_ERROR;
        }
@@ -1397,11 +1563,11 @@ static int acer_wmi_enable_ec_raw(void)
        status = wmid3_set_lm_mode(&params, &return_value);
 
        if (return_value.error_code || return_value.ec_return_value)
-               printk(ACER_WARNING "Enabling EC raw mode failed: "
-                      "0x%x - 0x%x\n", return_value.error_code,
-                      return_value.ec_return_value);
+               pr_warn("Enabling EC raw mode failed: 0x%x - 0x%x\n",
+                       return_value.error_code,
+                       return_value.ec_return_value);
        else
-               printk(ACER_INFO "Enabled EC raw mode");
+               pr_info("Enabled EC raw mode\n");
 
        return status;
 }
@@ -1420,9 +1586,9 @@ static int acer_wmi_enable_lm(void)
        status = wmid3_set_lm_mode(&params, &return_value);
 
        if (return_value.error_code || return_value.ec_return_value)
-               printk(ACER_WARNING "Enabling Launch Manager failed: "
-                      "0x%x - 0x%x\n", return_value.error_code,
-                      return_value.ec_return_value);
+               pr_warn("Enabling Launch Manager failed: 0x%x - 0x%x\n",
+                       return_value.error_code,
+                       return_value.ec_return_value);
 
        return status;
 }
@@ -1489,8 +1655,11 @@ static u32 get_wmid_devices(void)
 
        obj = (union acpi_object *) out.pointer;
        if (obj && obj->type == ACPI_TYPE_BUFFER &&
-               obj->buffer.length == sizeof(u32)) {
+               (obj->buffer.length == sizeof(u32) ||
+               obj->buffer.length == sizeof(u64))) {
                devices = *((u32 *) obj->buffer.pointer);
+       } else if (obj->type == ACPI_TYPE_INTEGER) {
+               devices = (u32) obj->integer.value;
        }
 
        kfree(out.pointer);
@@ -1650,7 +1819,7 @@ static int create_debugfs(void)
 {
        interface->debug.root = debugfs_create_dir("acer-wmi", NULL);
        if (!interface->debug.root) {
-               printk(ACER_ERR "Failed to create debugfs directory");
+               pr_err("Failed to create debugfs directory");
                return -ENOMEM;
        }
 
@@ -1671,11 +1840,10 @@ static int __init acer_wmi_init(void)
 {
        int err;
 
-       printk(ACER_INFO "Acer Laptop ACPI-WMI Extras\n");
+       pr_info("Acer Laptop ACPI-WMI Extras\n");
 
        if (dmi_check_system(acer_blacklist)) {
-               printk(ACER_INFO "Blacklisted hardware detected - "
-                               "not loading\n");
+               pr_info("Blacklisted hardware detected - not loading\n");
                return -ENODEV;
        }
 
@@ -1692,12 +1860,11 @@ static int __init acer_wmi_init(void)
 
        if (wmi_has_guid(WMID_GUID2) && interface) {
                if (ACPI_FAILURE(WMID_set_capabilities())) {
-                       printk(ACER_ERR "Unable to detect available WMID "
-                                       "devices\n");
+                       pr_err("Unable to detect available WMID devices\n");
                        return -ENODEV;
                }
        } else if (!wmi_has_guid(WMID_GUID2) && interface) {
-               printk(ACER_ERR "No WMID device detection method found\n");
+               pr_err("No WMID device detection method found\n");
                return -ENODEV;
        }
 
@@ -1705,8 +1872,7 @@ static int __init acer_wmi_init(void)
                interface = &AMW0_interface;
 
                if (ACPI_FAILURE(AMW0_set_capabilities())) {
-                       printk(ACER_ERR "Unable to detect available AMW0 "
-                                       "devices\n");
+                       pr_err("Unable to detect available AMW0 devices\n");
                        return -ENODEV;
                }
        }
@@ -1715,8 +1881,7 @@ static int __init acer_wmi_init(void)
                AMW0_find_mailled();
 
        if (!interface) {
-               printk(ACER_INFO "No or unsupported WMI interface, unable to "
-                               "load\n");
+               pr_err("No or unsupported WMI interface, unable to load\n");
                return -ENODEV;
        }
 
@@ -1724,22 +1889,22 @@ static int __init acer_wmi_init(void)
 
        if (acpi_video_backlight_support() && has_cap(ACER_CAP_BRIGHTNESS)) {
                interface->capability &= ~ACER_CAP_BRIGHTNESS;
-               printk(ACER_INFO "Brightness must be controlled by "
+               pr_info("Brightness must be controlled by "
                       "generic video driver\n");
        }
 
        if (wmi_has_guid(WMID_GUID3)) {
                if (ec_raw_mode) {
                        if (ACPI_FAILURE(acer_wmi_enable_ec_raw())) {
-                               printk(ACER_ERR "Cannot enable EC raw mode\n");
+                               pr_err("Cannot enable EC raw mode\n");
                                return -ENODEV;
                        }
                } else if (ACPI_FAILURE(acer_wmi_enable_lm())) {
-                       printk(ACER_ERR "Cannot enable Launch Manager mode\n");
+                       pr_err("Cannot enable Launch Manager mode\n");
                        return -ENODEV;
                }
        } else if (ec_raw_mode) {
-               printk(ACER_INFO "No WMID EC raw mode enable method\n");
+               pr_info("No WMID EC raw mode enable method\n");
        }
 
        if (wmi_has_guid(ACERWMID_EVENT_GUID)) {
@@ -1750,7 +1915,7 @@ static int __init acer_wmi_init(void)
 
        err = platform_driver_register(&acer_platform_driver);
        if (err) {
-               printk(ACER_ERR "Unable to register platform driver.\n");
+               pr_err("Unable to register platform driver.\n");
                goto error_platform_register;
        }
 
@@ -1805,7 +1970,7 @@ static void __exit acer_wmi_exit(void)
        platform_device_unregister(acer_platform_device);
        platform_driver_unregister(&acer_platform_driver);
 
-       printk(ACER_INFO "Acer Laptop WMI Extras unloaded\n");
+       pr_info("Acer Laptop WMI Extras unloaded\n");
        return;
 }