Lines Matching +full:hi +full:- +full:fi
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * asus-laptop.c - Asus Laptop Support
5 * Copyright (C) 2002-2005 Julien Lerouge, 2003-2006 Karol Kozimor
6 * Copyright (C) 2006-2007 Corentin Chary
13 * Pontus Fuchs - Helper functions, cleanup
14 * Johann Wiesner - Small compile fixes
15 * John Belmonte - ACPI code for Toshiba laptop was a good starting point.
16 * Eric Burghard - LED display support for W1N
17 * Josh Green - Light Sens support
18 * Thomas Tuttle - His first patch for led support was very helpful
19 * Sam Lin - GPS support
36 #include <linux/input/sparse-keymap.h>
83 static int wimax_status = -1;
84 static int wwan_status = -1;
89 "(0 = disabled, 1 = enabled, -1 = don't do anything). "
90 "default is -1");
94 "(0 = disabled, 1 = enabled, -1 = don't do anything). "
95 "default is -1");
99 "(0 = disabled, 1 = enabled, -1 = don't do anything). "
100 "default is -1");
104 "(0 = disabled, 1 = enabled, -1 = don't do anything). "
105 "default is -1");
359 * returns 0 if write is successful, -1 else.
369 return -1; in write_acpi_int_ret()
380 return -1; in write_acpi_int_ret()
394 return -ENODEV; in acpi_check_handle()
409 return -ENODEV; in acpi_check_handle()
416 return !strcmp(asus->name, DEVICE_NAME_PEGA) && in asus_check_pega_lucid()
417 !acpi_check_handle(asus->handle, METHOD_PEGA_ENABLE, NULL) && in asus_check_pega_lucid()
418 !acpi_check_handle(asus->handle, METHOD_PEGA_DISABLE, NULL) && in asus_check_pega_lucid()
419 !acpi_check_handle(asus->handle, METHOD_PEGA_READ, NULL); in asus_check_pega_lucid()
425 return write_acpi_int(asus->handle, method, unit); in asus_pega_lucid_set()
433 acpi_evaluate_integer(asus->handle, method, NULL, &val); in pega_acc_axis()
438 * thei hi/lo byte reads means that a transition in pega_acc_axis()
439 * between (for example) -1 and 0 could be read as in pega_acc_axis()
441 delta = abs(curr - (short)val); in pega_acc_axis()
445 return clamp_val((short)val, -PEGA_ACC_CLAMP, PEGA_ACC_CLAMP); in pega_acc_axis()
450 struct device *parent = input->dev.parent; in pega_accel_poll()
457 if (!asus->pega_acc_live) { in pega_accel_poll()
458 asus->pega_acc_live = true; in pega_accel_poll()
466 asus->pega_acc_x = pega_acc_axis(asus, asus->pega_acc_x, METHOD_XLRX); in pega_accel_poll()
467 asus->pega_acc_y = pega_acc_axis(asus, asus->pega_acc_y, METHOD_XLRY); in pega_accel_poll()
468 asus->pega_acc_z = pega_acc_axis(asus, asus->pega_acc_z, METHOD_XLRZ); in pega_accel_poll()
473 input_report_abs(input, ABS_X, -asus->pega_acc_x); in pega_accel_poll()
474 input_report_abs(input, ABS_Y, -asus->pega_acc_y); in pega_accel_poll()
475 input_report_abs(input, ABS_Z, asus->pega_acc_z); in pega_accel_poll()
481 if (asus->pega_accel_poll) { in pega_accel_exit()
482 input_unregister_device(asus->pega_accel_poll); in pega_accel_exit()
483 asus->pega_accel_poll = NULL; in pega_accel_exit()
492 if (!asus->is_pega_lucid) in pega_accel_init()
493 return -ENODEV; in pega_accel_init()
495 if (acpi_check_handle(asus->handle, METHOD_XLRX, NULL) || in pega_accel_init()
496 acpi_check_handle(asus->handle, METHOD_XLRY, NULL) || in pega_accel_init()
497 acpi_check_handle(asus->handle, METHOD_XLRZ, NULL)) in pega_accel_init()
498 return -ENODEV; in pega_accel_init()
502 return -ENOMEM; in pega_accel_init()
504 input->name = PEGA_ACCEL_DESC; in pega_accel_init()
505 input->phys = PEGA_ACCEL_NAME "/input0"; in pega_accel_init()
506 input->dev.parent = &asus->platform_device->dev; in pega_accel_init()
507 input->id.bustype = BUS_HOST; in pega_accel_init()
510 -PEGA_ACC_CLAMP, PEGA_ACC_CLAMP, 0, 0); in pega_accel_init()
512 -PEGA_ACC_CLAMP, PEGA_ACC_CLAMP, 0, 0); in pega_accel_init()
514 -PEGA_ACC_CLAMP, PEGA_ACC_CLAMP, 0, 0); in pega_accel_init()
528 asus->pega_accel_poll = input; in pega_accel_init()
547 return write_acpi_int(asus->handle, method, value); in asus_led_set()
558 struct asus_laptop *asus = led->asus; in asus_led_cdev_set()
560 led->wk = !!value; in asus_led_cdev_set()
561 queue_work(asus->led_workqueue, &led->work); in asus_led_cdev_set()
567 struct asus_laptop *asus = led->asus; in asus_led_cdev_update()
569 asus_led_set(asus, led->method, led->wk); in asus_led_cdev_update()
574 return led_cdev->brightness; in asus_led_cdev_get()
592 rv = acpi_evaluate_integer(asus->handle, METHOD_KBD_LIGHT_GET, in asus_kled_lvl()
596 return -ENODEV; in asus_kled_lvl()
608 if (write_acpi_int(asus->handle, METHOD_KBD_LIGHT_SET, kblv)) { in asus_kled_set()
610 return -EINVAL; in asus_kled_set()
619 struct asus_laptop *asus = led->asus; in asus_kled_cdev_set()
621 led->wk = value; in asus_kled_cdev_set()
622 queue_work(asus->led_workqueue, &led->work); in asus_kled_cdev_set()
628 struct asus_laptop *asus = led->asus; in asus_kled_cdev_update()
630 asus_kled_set(asus, led->wk); in asus_kled_cdev_update()
636 struct asus_laptop *asus = led->asus; in asus_kled_cdev_get()
643 led_classdev_unregister(&asus->wled.led); in asus_led_exit()
644 led_classdev_unregister(&asus->bled.led); in asus_led_exit()
645 led_classdev_unregister(&asus->mled.led); in asus_led_exit()
646 led_classdev_unregister(&asus->tled.led); in asus_led_exit()
647 led_classdev_unregister(&asus->pled.led); in asus_led_exit()
648 led_classdev_unregister(&asus->rled.led); in asus_led_exit()
649 led_classdev_unregister(&asus->gled.led); in asus_led_exit()
650 led_classdev_unregister(&asus->kled.led); in asus_led_exit()
652 if (asus->led_workqueue) { in asus_led_exit()
653 destroy_workqueue(asus->led_workqueue); in asus_led_exit()
654 asus->led_workqueue = NULL; in asus_led_exit()
663 struct led_classdev *led_cdev = &led->led; in asus_led_register()
665 if (!method || acpi_check_handle(asus->handle, method, NULL)) in asus_led_register()
668 led->asus = asus; in asus_led_register()
669 led->method = method; in asus_led_register()
671 INIT_WORK(&led->work, asus_led_cdev_update); in asus_led_register()
672 led_cdev->name = name; in asus_led_register()
673 led_cdev->brightness_set = asus_led_cdev_set; in asus_led_register()
674 led_cdev->brightness_get = asus_led_cdev_get; in asus_led_register()
675 led_cdev->max_brightness = 1; in asus_led_register()
676 return led_classdev_register(&asus->platform_device->dev, led_cdev); in asus_led_register()
687 if (asus->is_pega_lucid) in asus_led_init()
696 asus->led_workqueue = create_singlethread_workqueue("led_workqueue"); in asus_led_init()
697 if (!asus->led_workqueue) in asus_led_init()
698 return -ENOMEM; in asus_led_init()
700 if (asus->wled_type == TYPE_LED) in asus_led_init()
701 r = asus_led_register(asus, &asus->wled, "asus::wlan", in asus_led_init()
705 if (asus->bled_type == TYPE_LED) in asus_led_init()
706 r = asus_led_register(asus, &asus->bled, "asus::bluetooth", in asus_led_init()
710 r = asus_led_register(asus, &asus->mled, "asus::mail", METHOD_MLED); in asus_led_init()
713 r = asus_led_register(asus, &asus->tled, "asus::touchpad", METHOD_TLED); in asus_led_init()
716 r = asus_led_register(asus, &asus->rled, "asus::record", METHOD_RLED); in asus_led_init()
719 r = asus_led_register(asus, &asus->pled, "asus::phone", METHOD_PLED); in asus_led_init()
722 r = asus_led_register(asus, &asus->gled, "asus::gaming", METHOD_GLED); in asus_led_init()
725 if (!acpi_check_handle(asus->handle, METHOD_KBD_LIGHT_SET, NULL) && in asus_led_init()
726 !acpi_check_handle(asus->handle, METHOD_KBD_LIGHT_GET, NULL)) { in asus_led_init()
727 struct asus_led *led = &asus->kled; in asus_led_init()
728 struct led_classdev *cdev = &led->led; in asus_led_init()
730 led->asus = asus; in asus_led_init()
732 INIT_WORK(&led->work, asus_kled_cdev_update); in asus_led_init()
733 cdev->name = "asus::kbd_backlight"; in asus_led_init()
734 cdev->brightness_set = asus_kled_cdev_set; in asus_led_init()
735 cdev->brightness_get = asus_kled_cdev_get; in asus_led_init()
736 cdev->max_brightness = 3; in asus_led_init()
737 r = led_classdev_register(&asus->platform_device->dev, cdev); in asus_led_init()
754 rv = acpi_evaluate_integer(asus->handle, METHOD_BRIGHTNESS_GET, in asus_read_brightness()
768 if (write_acpi_int(asus->handle, METHOD_BRIGHTNESS_SET, value)) { in asus_set_brightness()
770 return -EIO; in asus_set_brightness()
777 int value = bd->props.brightness; in update_bl_status()
789 struct backlight_device *bd = asus->backlight_device; in asus_backlight_notify()
790 int old = bd->props.brightness; in asus_backlight_notify()
802 if (acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_GET, NULL) || in asus_backlight_init()
803 acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_SET, NULL)) in asus_backlight_init()
811 &asus->platform_device->dev, asus, in asus_backlight_init()
815 asus->backlight_device = NULL; in asus_backlight_init()
819 asus->backlight_device = bd; in asus_backlight_init()
820 bd->props.brightness = asus_read_brightness(bd); in asus_backlight_init()
821 bd->props.power = FB_BLANK_UNBLANK; in asus_backlight_init()
828 backlight_device_unregister(asus->backlight_device); in asus_backlight_exit()
829 asus->backlight_device = NULL; in asus_backlight_exit()
856 len += sprintf(page + len, "Model reference : %s\n", asus->name); in infos_show()
860 * bit signifies that the laptop is equipped with a Wi-Fi MiniPCI card. in infos_show()
863 rv = acpi_evaluate_integer(asus->handle, "SFUN", NULL, &temp); in infos_show()
875 rv = acpi_evaluate_integer(asus->handle, "HWRS", NULL, &temp); in infos_show()
886 rv = acpi_evaluate_integer(asus->handle, "ASYM", NULL, &temp); in infos_show()
890 if (asus->dsdt_info) { in infos_show()
891 snprintf(buf, 16, "%d", asus->dsdt_info->length); in infos_show()
893 snprintf(buf, 16, "%d", asus->dsdt_info->checksum); in infos_show()
895 snprintf(buf, 16, "%d", asus->dsdt_info->revision); in infos_show()
897 snprintf(buf, 7, "%s", asus->dsdt_info->oem_id); in infos_show()
899 snprintf(buf, 9, "%s", asus->dsdt_info->oem_table_id); in infos_show()
901 snprintf(buf, 16, "%x", asus->dsdt_info->oem_revision); in infos_show()
903 snprintf(buf, 5, "%s", asus->dsdt_info->asl_compiler_id); in infos_show()
905 snprintf(buf, 16, "%x", asus->dsdt_info->asl_compiler_revision); in infos_show()
923 if (write_acpi_int(asus->handle, method, value)) in sysfs_acpi_set()
924 return -ENODEV; in sysfs_acpi_set()
936 return sprintf(buf, "0x%08x\n", asus->ledd_status); in ledd_show()
949 if (write_acpi_int(asus->handle, METHOD_LEDD, value)) { in ledd_store()
951 return -ENODEV; in ledd_store()
954 asus->ledd_status = (u32) value; in ledd_store()
967 if (!asus->have_rsts) in asus_wireless_status()
968 return (asus->wireless_status & mask) ? 1 : 0; in asus_wireless_status()
970 rv = acpi_evaluate_integer(asus->handle, METHOD_WL_STATUS, in asus_wireless_status()
974 return -EINVAL; in asus_wireless_status()
984 if (write_acpi_int(asus->handle, METHOD_WLAN, !!status)) { in asus_wlan_set()
986 return -EIO; in asus_wlan_set()
1013 if (write_acpi_int(asus->handle, METHOD_BLUETOOTH, !!status)) { in asus_bluetooth_set()
1015 return -EIO; in asus_bluetooth_set()
1043 if (write_acpi_int(asus->handle, METHOD_WIMAX, !!status)) { in asus_wimax_set()
1045 return -EIO; in asus_wimax_set()
1072 if (write_acpi_int(asus->handle, METHOD_WWAN, !!status)) { in asus_wwan_set()
1074 return -EIO; in asus_wwan_set()
1102 if (write_acpi_int(asus->handle, METHOD_SWITCH_DISPLAY, value)) in asus_set_display()
1109 * the LCD output, 2 should do for CRT, 4 for TV-Out and 8 for DVI.
1136 if (asus->is_pega_lucid) { in asus_als_switch()
1141 ret = write_acpi_int(asus->handle, METHOD_ALS_CONTROL, value); in asus_als_switch()
1146 asus->light_switch = value; in asus_als_switch()
1154 return sprintf(buf, "%d\n", asus->light_switch); in ls_switch_show()
1175 if (write_acpi_int(asus->handle, METHOD_ALS_LEVEL, value)) in asus_als_level()
1177 asus->light_level = value; in asus_als_level()
1185 return sprintf(buf, "%d\n", asus->light_level); in ls_level_show()
1209 int err = write_acpi_int_ret(asus->handle, METHOD_PEGA_READ, arg, in pega_int_read()
1213 if (obj && obj->type == ACPI_TYPE_INTEGER) in pega_int_read()
1214 *result = obj->integer.value; in pega_int_read()
1216 err = -EIO; in pega_int_read()
1225 int err, hi, lo; in ls_value_show() local
1227 err = pega_int_read(asus, PEGA_READ_ALS_H, &hi); in ls_value_show()
1231 return sprintf(buf, "%d\n", 10 * hi + lo); in ls_value_show()
1244 rv = acpi_evaluate_integer(asus->handle, METHOD_GPS_STATUS, in asus_gps_status()
1248 return -ENODEV; in asus_gps_status()
1257 if (write_acpi_int(asus->handle, meth, 0x02)) in asus_gps_switch()
1258 return -ENODEV; in asus_gps_switch()
1283 rfkill_set_sw_state(asus->gps.rfkill, !value); in gps_store()
1305 struct asus_laptop *asus = rfk->asus; in asus_rfkill_set()
1307 if (rfk->control_id == WL_RSTS) in asus_rfkill_set()
1309 else if (rfk->control_id == BT_RSTS) in asus_rfkill_set()
1311 else if (rfk->control_id == WM_RSTS) in asus_rfkill_set()
1313 else if (rfk->control_id == WW_RSTS) in asus_rfkill_set()
1316 return -EINVAL; in asus_rfkill_set()
1325 if (!rfk->rfkill) in asus_rfkill_terminate()
1328 rfkill_unregister(rfk->rfkill); in asus_rfkill_terminate()
1329 rfkill_destroy(rfk->rfkill); in asus_rfkill_terminate()
1330 rfk->rfkill = NULL; in asus_rfkill_terminate()
1335 asus_rfkill_terminate(&asus->wwan); in asus_rfkill_exit()
1336 asus_rfkill_terminate(&asus->bluetooth); in asus_rfkill_exit()
1337 asus_rfkill_terminate(&asus->wlan); in asus_rfkill_exit()
1338 asus_rfkill_terminate(&asus->gps); in asus_rfkill_exit()
1347 rfk->control_id = control_id; in asus_rfkill_setup()
1348 rfk->asus = asus; in asus_rfkill_setup()
1349 rfk->rfkill = rfkill_alloc(name, &asus->platform_device->dev, in asus_rfkill_setup()
1351 if (!rfk->rfkill) in asus_rfkill_setup()
1352 return -EINVAL; in asus_rfkill_setup()
1354 result = rfkill_register(rfk->rfkill); in asus_rfkill_setup()
1356 rfkill_destroy(rfk->rfkill); in asus_rfkill_setup()
1357 rfk->rfkill = NULL; in asus_rfkill_setup()
1367 if (asus->is_pega_lucid) in asus_rfkill_init()
1368 return -ENODEV; in asus_rfkill_init()
1370 if (!acpi_check_handle(asus->handle, METHOD_GPS_ON, NULL) && in asus_rfkill_init()
1371 !acpi_check_handle(asus->handle, METHOD_GPS_OFF, NULL) && in asus_rfkill_init()
1372 !acpi_check_handle(asus->handle, METHOD_GPS_STATUS, NULL)) in asus_rfkill_init()
1373 result = asus_rfkill_setup(asus, &asus->gps, "asus-gps", in asus_rfkill_init()
1374 -1, RFKILL_TYPE_GPS, in asus_rfkill_init()
1380 if (!acpi_check_handle(asus->handle, METHOD_WLAN, NULL) && in asus_rfkill_init()
1381 asus->wled_type == TYPE_RFKILL) in asus_rfkill_init()
1382 result = asus_rfkill_setup(asus, &asus->wlan, "asus-wlan", in asus_rfkill_init()
1388 if (!acpi_check_handle(asus->handle, METHOD_BLUETOOTH, NULL) && in asus_rfkill_init()
1389 asus->bled_type == TYPE_RFKILL) in asus_rfkill_init()
1390 result = asus_rfkill_setup(asus, &asus->bluetooth, in asus_rfkill_init()
1391 "asus-bluetooth", BT_RSTS, in asus_rfkill_init()
1397 if (!acpi_check_handle(asus->handle, METHOD_WWAN, NULL)) in asus_rfkill_init()
1398 result = asus_rfkill_setup(asus, &asus->wwan, "asus-wwan", in asus_rfkill_init()
1404 if (!acpi_check_handle(asus->handle, METHOD_WIMAX, NULL)) in asus_rfkill_init()
1405 result = asus_rfkill_setup(asus, &asus->wimax, "asus-wimax", in asus_rfkill_init()
1422 int ret = asus_pega_lucid_set(rfk->asus, rfk->control_id, !blocked); in pega_rfkill_set()
1441 if(!asus->is_pega_lucid) in pega_rfkill_init()
1442 return -ENODEV; in pega_rfkill_init()
1444 ret = pega_rfkill_setup(asus, &asus->wlan, "pega-wlan", in pega_rfkill_init()
1449 ret = pega_rfkill_setup(asus, &asus->bluetooth, "pega-bt", in pega_rfkill_init()
1454 ret = pega_rfkill_setup(asus, &asus->wwan, "pega-wwan", in pega_rfkill_init()
1469 if (!asus->inputdev) in asus_input_notify()
1471 if (!sparse_keymap_report_event(asus->inputdev, event, 1, true)) in asus_input_notify()
1482 return -ENOMEM; in asus_input_init()
1484 input->name = "Asus Laptop extra buttons"; in asus_input_init()
1485 input->phys = ASUS_LAPTOP_FILE "/input0"; in asus_input_init()
1486 input->id.bustype = BUS_HOST; in asus_input_init()
1487 input->dev.parent = &asus->platform_device->dev; in asus_input_init()
1500 asus->inputdev = input; in asus_input_init()
1510 if (asus->inputdev) in asus_input_exit()
1511 input_unregister_device(asus->inputdev); in asus_input_exit()
1512 asus->inputdev = NULL; in asus_input_exit()
1524 count = asus->event_count[event % 128]++; in asus_acpi_notify()
1525 acpi_bus_generate_netlink_event(asus->device->pnp.device_class, in asus_acpi_notify()
1526 dev_name(&asus->device->dev), event, in asus_acpi_notify()
1537 if (asus->backlight_device != NULL) { in asus_acpi_notify()
1545 if (asus->pega_accel_poll && event == 0xEA) { in asus_acpi_notify()
1546 kobject_uevent(&asus->pega_accel_poll->dev.kobj, KOBJ_CHANGE); in asus_acpi_notify()
1574 acpi_handle handle = asus->handle; in asus_sysfs_is_visible()
1577 if (asus->is_pega_lucid) { in asus_sysfs_is_visible()
1586 return supported ? attr->mode : 0; in asus_sysfs_is_visible()
1601 !acpi_check_handle(asus->handle, METHOD_WIMAX, NULL); in asus_sysfs_is_visible()
1604 supported = !acpi_check_handle(asus->handle, METHOD_WWAN, NULL); in asus_sysfs_is_visible()
1614 supported = asus->is_pega_lucid; in asus_sysfs_is_visible()
1623 return supported ? attr->mode : 0; in asus_sysfs_is_visible()
1636 asus->platform_device = platform_device_alloc(ASUS_LAPTOP_FILE, PLATFORM_DEVID_NONE); in asus_platform_init()
1637 if (!asus->platform_device) in asus_platform_init()
1638 return -ENOMEM; in asus_platform_init()
1639 platform_set_drvdata(asus->platform_device, asus); in asus_platform_init()
1641 result = platform_device_add(asus->platform_device); in asus_platform_init()
1645 result = sysfs_create_group(&asus->platform_device->dev.kobj, in asus_platform_init()
1653 platform_device_del(asus->platform_device); in asus_platform_init()
1655 platform_device_put(asus->platform_device); in asus_platform_init()
1661 sysfs_remove_group(&asus->platform_device->dev.kobj, &asus_attr_group); in asus_platform_exit()
1662 platform_device_unregister(asus->platform_device); in asus_platform_exit()
1687 * before doing anything ACPI-specific. Should we encounter a machine, in asus_laptop_get_info()
1691 status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus->dsdt_info); in asus_laptop_get_info()
1696 if (write_acpi_int_ret(asus->handle, "INIT", 0, &buffer)) { in asus_laptop_get_info()
1698 return -ENODEV; in asus_laptop_get_info()
1703 acpi_evaluate_integer(asus->handle, "BSTS", NULL, &bsts_result); in asus_laptop_get_info()
1711 if (write_acpi_int(asus->handle, "CWAP", wapf)) in asus_laptop_get_info()
1721 switch (model->type) { in asus_laptop_get_info()
1723 string = model->string.pointer; in asus_laptop_get_info()
1726 string = model->buffer.pointer; in asus_laptop_get_info()
1733 asus->name = kstrdup(string, GFP_KERNEL); in asus_laptop_get_info()
1734 if (!asus->name) { in asus_laptop_get_info()
1736 return -ENOMEM; in asus_laptop_get_info()
1742 if (!acpi_check_handle(asus->handle, METHOD_WL_STATUS, NULL)) in asus_laptop_get_info()
1743 asus->have_rsts = true; in asus_laptop_get_info()
1754 result = acpi_bus_get_status(asus->device); in asus_acpi_init()
1757 if (!asus->device->status.present) { in asus_acpi_init()
1759 return -ENODEV; in asus_acpi_init()
1767 asus->bled_type = TYPE_LED; in asus_acpi_init()
1769 asus->bled_type = TYPE_RFKILL; in asus_acpi_init()
1772 asus->wled_type = TYPE_LED; in asus_acpi_init()
1774 asus->wled_type = TYPE_RFKILL; in asus_acpi_init()
1789 if (!acpi_check_handle(asus->handle, METHOD_KBD_LIGHT_SET, NULL)) in asus_acpi_init()
1793 asus->ledd_status = 0xFFF; in asus_acpi_init()
1796 asus->light_switch = !!als_status; in asus_acpi_init()
1797 asus->light_level = 5; /* level 5 for sensor sensitivity */ in asus_acpi_init()
1799 if (asus->is_pega_lucid) { in asus_acpi_init()
1800 asus_als_switch(asus, asus->light_switch); in asus_acpi_init()
1801 } else if (!acpi_check_handle(asus->handle, METHOD_ALS_CONTROL, NULL) && in asus_acpi_init()
1802 !acpi_check_handle(asus->handle, METHOD_ALS_LEVEL, NULL)) { in asus_acpi_init()
1803 asus_als_switch(asus, asus->light_switch); in asus_acpi_init()
1804 asus_als_level(asus, asus->light_level); in asus_acpi_init()
1820 wlan_status = -1; in asus_dmi_check()
1835 return -ENOMEM; in asus_acpi_add()
1836 asus->handle = device->handle; in asus_acpi_add()
1839 device->driver_data = asus; in asus_acpi_add()
1840 asus->device = device; in asus_acpi_add()
1850 * device. It is used as a parent for the sub-devices below. in asus_acpi_add()
1852 asus->is_pega_lucid = asus_check_pega_lucid(asus); in asus_acpi_add()
1872 if (result && result != -ENODEV) in asus_acpi_add()
1876 if (result && result != -ENODEV) in asus_acpi_add()
1880 if (result && result != -ENODEV) in asus_acpi_add()
1915 kfree(asus->name); in asus_acpi_remove()
1952 result = -ENODEV; in asus_laptop_init()