Lines Matching refs:asus
218 struct asus_laptop *asus; member
229 struct asus_laptop *asus; member
414 static bool asus_check_pega_lucid(struct asus_laptop *asus) in asus_check_pega_lucid() argument
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()
422 static int asus_pega_lucid_set(struct asus_laptop *asus, int unit, bool enable) in asus_pega_lucid_set() argument
425 return write_acpi_int(asus->handle, method, unit); in asus_pega_lucid_set()
428 static int pega_acc_axis(struct asus_laptop *asus, int curr, char *method) in pega_acc_axis() argument
433 acpi_evaluate_integer(asus->handle, method, NULL, &val); in pega_acc_axis()
451 struct asus_laptop *asus = dev_get_drvdata(parent); in pega_accel_poll() local
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()
479 static void pega_accel_exit(struct asus_laptop *asus) in pega_accel_exit() argument
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()
487 static int pega_accel_init(struct asus_laptop *asus) in pega_accel_init() argument
492 if (!asus->is_pega_lucid) 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()
506 input->dev.parent = &asus->platform_device->dev; in pega_accel_init()
528 asus->pega_accel_poll = input; in pega_accel_init()
537 static int asus_led_set(struct asus_laptop *asus, const char *method, in asus_led_set() argument
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() local
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() local
569 asus_led_set(asus, led->method, led->wk); in asus_led_cdev_update()
580 static int asus_kled_lvl(struct asus_laptop *asus) in asus_kled_lvl() argument
592 rv = acpi_evaluate_integer(asus->handle, METHOD_KBD_LIGHT_GET, in asus_kled_lvl()
601 static int asus_kled_set(struct asus_laptop *asus, int kblv) in asus_kled_set() argument
608 if (write_acpi_int(asus->handle, METHOD_KBD_LIGHT_SET, kblv)) { in asus_kled_set()
619 struct asus_laptop *asus = led->asus; in asus_kled_cdev_set() local
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() local
630 asus_kled_set(asus, led->wk); in asus_kled_cdev_update()
636 struct asus_laptop *asus = led->asus; in asus_kled_cdev_get() local
638 return asus_kled_lvl(asus); in asus_kled_cdev_get()
641 static void asus_led_exit(struct asus_laptop *asus) in asus_led_exit() argument
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()
659 static int asus_led_register(struct asus_laptop *asus, in asus_led_register() argument
665 if (!method || acpi_check_handle(asus->handle, method, NULL)) in asus_led_register()
668 led->asus = asus; in asus_led_register()
676 return led_classdev_register(&asus->platform_device->dev, led_cdev); in asus_led_register()
679 static int asus_led_init(struct asus_laptop *asus) in asus_led_init() argument
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()
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()
730 led->asus = asus; in asus_led_init()
737 r = led_classdev_register(&asus->platform_device->dev, cdev); in asus_led_init()
741 asus_led_exit(asus); in asus_led_init()
750 struct asus_laptop *asus = bl_get_data(bd); in asus_read_brightness() local
754 rv = acpi_evaluate_integer(asus->handle, METHOD_BRIGHTNESS_GET, in asus_read_brightness()
766 struct asus_laptop *asus = bl_get_data(bd); in asus_set_brightness() local
768 if (write_acpi_int(asus->handle, METHOD_BRIGHTNESS_SET, value)) { in asus_set_brightness()
787 static int asus_backlight_notify(struct asus_laptop *asus) in asus_backlight_notify() argument
789 struct backlight_device *bd = asus->backlight_device; in asus_backlight_notify()
797 static int asus_backlight_init(struct asus_laptop *asus) in asus_backlight_init() argument
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()
826 static void asus_backlight_exit(struct asus_laptop *asus) in asus_backlight_exit() argument
828 backlight_device_unregister(asus->backlight_device); in asus_backlight_exit()
829 asus->backlight_device = NULL; in asus_backlight_exit()
844 struct asus_laptop *asus = dev_get_drvdata(dev); in infos_show() local
856 len += sprintf(page + len, "Model reference : %s\n", asus->name); 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()
913 static ssize_t sysfs_acpi_set(struct asus_laptop *asus, in sysfs_acpi_set() argument
923 if (write_acpi_int(asus->handle, method, value)) in sysfs_acpi_set()
934 struct asus_laptop *asus = dev_get_drvdata(dev); in ledd_show() local
936 return sprintf(buf, "0x%08x\n", asus->ledd_status); in ledd_show()
942 struct asus_laptop *asus = dev_get_drvdata(dev); in ledd_store() local
949 if (write_acpi_int(asus->handle, METHOD_LEDD, value)) { in ledd_store()
954 asus->ledd_status = (u32) value; in ledd_store()
962 static int asus_wireless_status(struct asus_laptop *asus, int mask) in asus_wireless_status() argument
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()
982 static int asus_wlan_set(struct asus_laptop *asus, int status) in asus_wlan_set() argument
984 if (write_acpi_int(asus->handle, METHOD_WLAN, !!status)) { in asus_wlan_set()
994 struct asus_laptop *asus = dev_get_drvdata(dev); in wlan_show() local
996 return sprintf(buf, "%d\n", asus_wireless_status(asus, WL_RSTS)); in wlan_show()
1002 struct asus_laptop *asus = dev_get_drvdata(dev); in wlan_store() local
1004 return sysfs_acpi_set(asus, buf, count, METHOD_WLAN); in wlan_store()
1011 static int asus_bluetooth_set(struct asus_laptop *asus, int status) in asus_bluetooth_set() argument
1013 if (write_acpi_int(asus->handle, METHOD_BLUETOOTH, !!status)) { in asus_bluetooth_set()
1023 struct asus_laptop *asus = dev_get_drvdata(dev); in bluetooth_show() local
1025 return sprintf(buf, "%d\n", asus_wireless_status(asus, BT_RSTS)); in bluetooth_show()
1032 struct asus_laptop *asus = dev_get_drvdata(dev); in bluetooth_store() local
1034 return sysfs_acpi_set(asus, buf, count, METHOD_BLUETOOTH); in bluetooth_store()
1041 static int asus_wimax_set(struct asus_laptop *asus, int status) in asus_wimax_set() argument
1043 if (write_acpi_int(asus->handle, METHOD_WIMAX, !!status)) { in asus_wimax_set()
1053 struct asus_laptop *asus = dev_get_drvdata(dev); in wimax_show() local
1055 return sprintf(buf, "%d\n", asus_wireless_status(asus, WM_RSTS)); in wimax_show()
1061 struct asus_laptop *asus = dev_get_drvdata(dev); in wimax_store() local
1063 return sysfs_acpi_set(asus, buf, count, METHOD_WIMAX); in wimax_store()
1070 static int asus_wwan_set(struct asus_laptop *asus, int status) in asus_wwan_set() argument
1072 if (write_acpi_int(asus->handle, METHOD_WWAN, !!status)) { in asus_wwan_set()
1082 struct asus_laptop *asus = dev_get_drvdata(dev); in wwan_show() local
1084 return sprintf(buf, "%d\n", asus_wireless_status(asus, WW_RSTS)); in wwan_show()
1090 struct asus_laptop *asus = dev_get_drvdata(dev); in wwan_store() local
1092 return sysfs_acpi_set(asus, buf, count, METHOD_WWAN); in wwan_store()
1099 static void asus_set_display(struct asus_laptop *asus, int value) in asus_set_display() argument
1102 if (write_acpi_int(asus->handle, METHOD_SWITCH_DISPLAY, value)) in asus_set_display()
1117 struct asus_laptop *asus = dev_get_drvdata(dev); in display_store() local
1124 asus_set_display(asus, value); in display_store()
1132 static void asus_als_switch(struct asus_laptop *asus, int value) in asus_als_switch() argument
1136 if (asus->is_pega_lucid) { in asus_als_switch()
1137 ret = asus_pega_lucid_set(asus, PEGA_ALS, value); in asus_als_switch()
1139 ret = asus_pega_lucid_set(asus, PEGA_ALS_POWER, value); 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()
1152 struct asus_laptop *asus = dev_get_drvdata(dev); in ls_switch_show() local
1154 return sprintf(buf, "%d\n", asus->light_switch); in ls_switch_show()
1161 struct asus_laptop *asus = dev_get_drvdata(dev); in ls_switch_store() local
1168 asus_als_switch(asus, value ? 1 : 0); in ls_switch_store()
1173 static void asus_als_level(struct asus_laptop *asus, int value) in asus_als_level() argument
1175 if (write_acpi_int(asus->handle, METHOD_ALS_LEVEL, value)) in asus_als_level()
1177 asus->light_level = value; in asus_als_level()
1183 struct asus_laptop *asus = dev_get_drvdata(dev); in ls_level_show() local
1185 return sprintf(buf, "%d\n", asus->light_level); in ls_level_show()
1191 struct asus_laptop *asus = dev_get_drvdata(dev); in ls_level_store() local
1200 asus_als_level(asus, value); in ls_level_store()
1206 static int pega_int_read(struct asus_laptop *asus, int arg, int *result) in pega_int_read() argument
1209 int err = write_acpi_int_ret(asus->handle, METHOD_PEGA_READ, arg, in pega_int_read()
1224 struct asus_laptop *asus = dev_get_drvdata(dev); in ls_value_show() local
1227 err = pega_int_read(asus, PEGA_READ_ALS_H, &hi); in ls_value_show()
1229 err = pega_int_read(asus, PEGA_READ_ALS_L, &lo); in ls_value_show()
1239 static int asus_gps_status(struct asus_laptop *asus) in asus_gps_status() argument
1244 rv = acpi_evaluate_integer(asus->handle, METHOD_GPS_STATUS, in asus_gps_status()
1253 static int asus_gps_switch(struct asus_laptop *asus, int status) in asus_gps_switch() argument
1257 if (write_acpi_int(asus->handle, meth, 0x02)) in asus_gps_switch()
1265 struct asus_laptop *asus = dev_get_drvdata(dev); in gps_show() local
1267 return sprintf(buf, "%d\n", asus_gps_status(asus)); in gps_show()
1273 struct asus_laptop *asus = dev_get_drvdata(dev); in gps_store() local
1280 ret = asus_gps_switch(asus, !!value); in gps_store()
1283 rfkill_set_sw_state(asus->gps.rfkill, !value); in gps_store()
1293 struct asus_laptop *asus = data; in asus_gps_rfkill_set() local
1295 return asus_gps_switch(asus, !blocked); in asus_gps_rfkill_set()
1305 struct asus_laptop *asus = rfk->asus; in asus_rfkill_set() local
1308 return asus_wlan_set(asus, !blocked); in asus_rfkill_set()
1310 return asus_bluetooth_set(asus, !blocked); in asus_rfkill_set()
1312 return asus_wimax_set(asus, !blocked); in asus_rfkill_set()
1314 return asus_wwan_set(asus, !blocked); in asus_rfkill_set()
1333 static void asus_rfkill_exit(struct asus_laptop *asus) in asus_rfkill_exit() argument
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()
1341 static int asus_rfkill_setup(struct asus_laptop *asus, struct asus_rfkill *rfk, in asus_rfkill_setup() argument
1348 rfk->asus = asus; in asus_rfkill_setup()
1349 rfk->rfkill = rfkill_alloc(name, &asus->platform_device->dev, in asus_rfkill_setup()
1363 static int asus_rfkill_init(struct asus_laptop *asus) in asus_rfkill_init() argument
1367 if (asus->is_pega_lucid) 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()
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()
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()
1413 asus_rfkill_exit(asus); in asus_rfkill_init()
1422 int ret = asus_pega_lucid_set(rfk->asus, rfk->control_id, !blocked); in pega_rfkill_set()
1430 static int pega_rfkill_setup(struct asus_laptop *asus, struct asus_rfkill *rfk, in pega_rfkill_setup() argument
1433 return asus_rfkill_setup(asus, rfk, name, controlid, rfkill_type, in pega_rfkill_setup()
1437 static int pega_rfkill_init(struct asus_laptop *asus) in pega_rfkill_init() argument
1441 if(!asus->is_pega_lucid) 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()
1459 asus_rfkill_exit(asus); in pega_rfkill_init()
1467 static void asus_input_notify(struct asus_laptop *asus, int event) in asus_input_notify() argument
1469 if (!asus->inputdev) in asus_input_notify()
1471 if (!sparse_keymap_report_event(asus->inputdev, event, 1, true)) in asus_input_notify()
1475 static int asus_input_init(struct asus_laptop *asus) in asus_input_init() argument
1487 input->dev.parent = &asus->platform_device->dev; in asus_input_init()
1500 asus->inputdev = input; in asus_input_init()
1508 static void asus_input_exit(struct asus_laptop *asus) in asus_input_exit() argument
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()
1520 struct asus_laptop *asus = acpi_driver_data(device); in asus_acpi_notify() local
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()
1539 asus_backlight_notify(asus); 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()
1550 asus_input_notify(asus, event); in asus_acpi_notify()
1573 struct asus_laptop *asus = dev_get_drvdata(dev); in asus_sysfs_is_visible() local
1574 acpi_handle handle = asus->handle; in asus_sysfs_is_visible()
1577 if (asus->is_pega_lucid) { 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()
1632 static int asus_platform_init(struct asus_laptop *asus) in asus_platform_init() argument
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()
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()
1659 static void asus_platform_exit(struct asus_laptop *asus) in asus_platform_exit() argument
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()
1676 static int asus_laptop_get_info(struct asus_laptop *asus) in asus_laptop_get_info() argument
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()
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()
1733 asus->name = kstrdup(string, GFP_KERNEL); in asus_laptop_get_info()
1734 if (!asus->name) { 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()
1750 static int asus_acpi_init(struct asus_laptop *asus) in asus_acpi_init() argument
1754 result = acpi_bus_get_status(asus->device); in asus_acpi_init()
1757 if (!asus->device->status.present) { in asus_acpi_init()
1762 result = asus_laptop_get_info(asus); 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()
1777 asus_bluetooth_set(asus, !!bluetooth_status); in asus_acpi_init()
1780 asus_wlan_set(asus, !!wlan_status); in asus_acpi_init()
1783 asus_wimax_set(asus, !!wimax_status); in asus_acpi_init()
1786 asus_wwan_set(asus, !!wwan_status); in asus_acpi_init()
1789 if (!acpi_check_handle(asus->handle, METHOD_KBD_LIGHT_SET, NULL)) in asus_acpi_init()
1790 asus_kled_set(asus, 1); 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()
1828 struct asus_laptop *asus; in asus_acpi_add() local
1833 asus = kzalloc(sizeof(struct asus_laptop), GFP_KERNEL); in asus_acpi_add()
1834 if (!asus) 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()
1844 result = asus_acpi_init(asus); in asus_acpi_add()
1852 asus->is_pega_lucid = asus_check_pega_lucid(asus); in asus_acpi_add()
1853 result = asus_platform_init(asus); in asus_acpi_add()
1858 result = asus_backlight_init(asus); in asus_acpi_add()
1863 result = asus_input_init(asus); in asus_acpi_add()
1867 result = asus_led_init(asus); in asus_acpi_add()
1871 result = asus_rfkill_init(asus); in asus_acpi_add()
1875 result = pega_accel_init(asus); in asus_acpi_add()
1879 result = pega_rfkill_init(asus); in asus_acpi_add()
1887 pega_accel_exit(asus); in asus_acpi_add()
1889 asus_rfkill_exit(asus); in asus_acpi_add()
1891 asus_led_exit(asus); in asus_acpi_add()
1893 asus_input_exit(asus); in asus_acpi_add()
1895 asus_backlight_exit(asus); in asus_acpi_add()
1897 asus_platform_exit(asus); in asus_acpi_add()
1899 kfree(asus); in asus_acpi_add()
1906 struct asus_laptop *asus = acpi_driver_data(device); in asus_acpi_remove() local
1908 asus_backlight_exit(asus); in asus_acpi_remove()
1909 asus_rfkill_exit(asus); in asus_acpi_remove()
1910 asus_led_exit(asus); in asus_acpi_remove()
1911 asus_input_exit(asus); in asus_acpi_remove()
1912 pega_accel_exit(asus); in asus_acpi_remove()
1913 asus_platform_exit(asus); in asus_acpi_remove()
1915 kfree(asus->name); in asus_acpi_remove()
1916 kfree(asus); in asus_acpi_remove()