Lines Matching +full:battery +full:- +full:profile
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ideapad-laptop.c - Lenovo IdeaPad ACPI Extras
22 #include <linux/input/sparse-keymap.h>
36 #include <dt-bindings/leds/common.h>
42 "26CAB2E5-5CF1-46AE-AAC3-4A12B6BA50E6", /* Yoga 3 */
43 "56322276-8493-4CE8-A783-98C991274F5E", /* Yoga 700 */
44 "8FC0DE0C-B4E4-43FD-B0F3-8871711C1294", /* Legion 5 */
159 "Enable DYTC version 4 platform-profile support. "
160 "If you need this please report this to: platform-driver-x86@vger.kernel.org");
166 "If you need this please report this to: platform-driver-x86@vger.kernel.org");
171 "Enable driver based updates of the fn-lock LED on fn-lock changes. "
172 "If you need this please report this to: platform-driver-x86@vger.kernel.org");
186 return -EIO; in eval_int()
197 return ACPI_FAILURE(status) ? -EIO : 0; in exec_simple_method()
234 return -EIO; in eval_int_with_arg()
267 return -EIO; in eval_vpcw()
296 return -ETIMEDOUT; in read_ec_data()
327 return -ETIMEDOUT; in write_ec_cmd()
335 struct ideapad_private *priv = s->private; in debugfs_status_show()
338 if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL_MAX, &value)) in debugfs_status_show()
340 if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL, &value)) in debugfs_status_show()
342 if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL_POWER, &value)) in debugfs_status_show()
347 if (!read_ec_data(priv->adev->handle, VPCCMD_R_RF, &value)) in debugfs_status_show()
349 if (!read_ec_data(priv->adev->handle, VPCCMD_R_WIFI, &value)) in debugfs_status_show()
351 if (!read_ec_data(priv->adev->handle, VPCCMD_R_BT, &value)) in debugfs_status_show()
353 if (!read_ec_data(priv->adev->handle, VPCCMD_R_3G, &value)) in debugfs_status_show()
358 if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) in debugfs_status_show()
360 if (!read_ec_data(priv->adev->handle, VPCCMD_R_CAMERA, &value)) in debugfs_status_show()
365 if (!eval_gbmd(priv->adev->handle, &value)) in debugfs_status_show()
367 if (!eval_hals(priv->adev->handle, &value)) in debugfs_status_show()
376 struct ideapad_private *priv = s->private; in debugfs_cfg_show()
378 seq_printf(s, "_CFG: %#010lx\n\n", priv->cfg); in debugfs_cfg_show()
381 if (test_bit(CFG_CAP_BT_BIT, &priv->cfg)) in debugfs_cfg_show()
383 if (test_bit(CFG_CAP_3G_BIT, &priv->cfg)) in debugfs_cfg_show()
385 if (test_bit(CFG_CAP_WIFI_BIT, &priv->cfg)) in debugfs_cfg_show()
387 if (test_bit(CFG_CAP_CAM_BIT, &priv->cfg)) in debugfs_cfg_show()
389 if (test_bit(CFG_CAP_TOUCHPAD_BIT, &priv->cfg)) in debugfs_cfg_show()
394 switch (priv->cfg & 0x700) { in debugfs_cfg_show()
422 priv->debug = dir; in ideapad_debugfs_init()
430 debugfs_remove_recursive(priv->debug); in ideapad_debugfs_exit()
431 priv->debug = NULL; in ideapad_debugfs_exit()
445 err = read_ec_data(priv->adev->handle, VPCCMD_R_CAMERA, &result); in camera_power_show()
464 err = write_ec_cmd(priv->adev->handle, VPCCMD_W_CAMERA, state); in camera_power_store()
481 err = eval_gbmd(priv->adev->handle, &result); in conservation_mode_show()
500 err = exec_sbmc(priv->adev->handle, state ? SBMC_CONSERVATION_ON : SBMC_CONSERVATION_OFF); in conservation_mode_store()
517 err = read_ec_data(priv->adev->handle, VPCCMD_R_FAN, &result); in fan_mode_show()
537 return -EINVAL; in fan_mode_store()
539 err = write_ec_cmd(priv->adev->handle, VPCCMD_W_FAN, state); in fan_mode_store()
556 err = eval_hals(priv->adev->handle, &hals); in fn_lock_show()
575 err = exec_sals(priv->adev->handle, state ? SALS_FNLOCK_ON : SALS_FNLOCK_OFF); in fn_lock_store()
592 err = read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &result); in touchpad_show()
611 err = write_ec_cmd(priv->adev->handle, VPCCMD_W_TOUCHPAD, state); in touchpad_store()
628 err = eval_hals(priv->adev->handle, &hals); in usb_charging_show()
647 err = exec_sals(priv->adev->handle, state ? SALS_USB_CHARGING_ON : SALS_USB_CHARGING_OFF); in usb_charging_store()
675 supported = test_bit(CFG_CAP_CAM_BIT, &priv->cfg); in ideapad_is_visible()
677 supported = priv->features.conservation_mode; in ideapad_is_visible()
679 supported = priv->features.fan_mode; in ideapad_is_visible()
681 supported = priv->features.fn_lock; in ideapad_is_visible()
683 supported = priv->features.touchpad_ctrl_via_ec && in ideapad_is_visible()
684 test_bit(CFG_CAP_TOUCHPAD_BIT, &priv->cfg); in ideapad_is_visible()
686 supported = priv->features.usb_charging; in ideapad_is_visible()
688 return supported ? attr->mode : 0; in ideapad_is_visible()
697 * DYTC Platform profile
699 #define DYTC_CMD_QUERY 0 /* To get DYTC status - enable/revision */
704 #define DYTC_QUERY_ENABLE_BIT 8 /* Bit 8 - 0 = disabled, 1 = enabled */
705 #define DYTC_QUERY_SUBREV_BIT 16 /* Bits 16 - 27 - sub revision */
706 #define DYTC_QUERY_REV_BIT 28 /* Bits 28 - 31 - revision */
708 #define DYTC_GET_FUNCTION_BIT 8 /* Bits 8-11 - function setting */
709 #define DYTC_GET_MODE_BIT 12 /* Bits 12-15 - mode setting */
711 #define DYTC_SET_FUNCTION_BIT 12 /* Bits 12-15 - function setting */
712 #define DYTC_SET_MODE_BIT 16 /* Bits 16-19 - mode setting */
713 #define DYTC_SET_VALID_BIT 20 /* Bit 20 - 1 = on, 0 = off */
732 static int convert_dytc_to_profile(int dytcmode, enum platform_profile_option *profile) in convert_dytc_to_profile() argument
736 *profile = PLATFORM_PROFILE_LOW_POWER; in convert_dytc_to_profile()
739 *profile = PLATFORM_PROFILE_BALANCED; in convert_dytc_to_profile()
742 *profile = PLATFORM_PROFILE_PERFORMANCE; in convert_dytc_to_profile()
745 return -EINVAL; in convert_dytc_to_profile()
751 static int convert_profile_to_dytc(enum platform_profile_option profile, int *perfmode) in convert_profile_to_dytc() argument
753 switch (profile) { in convert_profile_to_dytc()
763 default: /* Unknown profile */ in convert_profile_to_dytc()
764 return -EOPNOTSUPP; in convert_profile_to_dytc()
772 * handler. Returns current platform profile.
775 enum platform_profile_option *profile) in dytc_profile_get() argument
779 *profile = dytc->current_profile; in dytc_profile_get()
784 * Helper function - check if we are in CQL mode and if we are
785 * - disable CQL,
786 * - run the command
787 * - enable CQL
796 err = eval_dytc(priv->adev->handle, DYTC_CMD_GET, output); in dytc_cql_command()
806 err = eval_dytc(priv->adev->handle, DYTC_DISABLE_CQL, NULL); in dytc_cql_command()
811 cmd_err = eval_dytc(priv->adev->handle, cmd, output); in dytc_cql_command()
815 err = eval_dytc(priv->adev->handle, DYTC_ENABLE_CQL, NULL); in dytc_cql_command()
825 * handler. Sets current platform profile.
828 enum platform_profile_option profile) in dytc_profile_set() argument
831 struct ideapad_private *priv = dytc->priv; in dytc_profile_set()
835 err = mutex_lock_interruptible(&dytc->mutex); in dytc_profile_set()
839 if (profile == PLATFORM_PROFILE_BALANCED) { in dytc_profile_set()
841 err = eval_dytc(priv->adev->handle, DYTC_CMD_RESET, NULL); in dytc_profile_set()
847 err = convert_profile_to_dytc(profile, &perfmode); in dytc_profile_set()
858 /* Success - update current profile */ in dytc_profile_set()
859 dytc->current_profile = profile; in dytc_profile_set()
862 mutex_unlock(&dytc->mutex); in dytc_profile_set()
869 enum platform_profile_option profile; in dytc_profile_refresh() local
873 mutex_lock(&priv->dytc->mutex); in dytc_profile_refresh()
875 mutex_unlock(&priv->dytc->mutex); in dytc_profile_refresh()
881 if (convert_dytc_to_profile(perfmode, &profile)) in dytc_profile_refresh()
884 if (profile != priv->dytc->current_profile) { in dytc_profile_refresh()
885 priv->dytc->current_profile = profile; in dytc_profile_refresh()
913 if (!priv->features.dytc) in ideapad_dytc_profile_init()
914 return -ENODEV; in ideapad_dytc_profile_init()
916 err = eval_dytc(priv->adev->handle, DYTC_CMD_QUERY, &output); in ideapad_dytc_profile_init()
923 dev_info(&priv->platform_device->dev, "DYTC_QUERY_ENABLE_BIT returned false\n"); in ideapad_dytc_profile_init()
924 return -ENODEV; in ideapad_dytc_profile_init()
930 dev_info(&priv->platform_device->dev, "DYTC_VERSION < 4 is not supported\n"); in ideapad_dytc_profile_init()
931 return -ENODEV; in ideapad_dytc_profile_init()
936 dev_info(&priv->platform_device->dev, in ideapad_dytc_profile_init()
938 return -ENODEV; in ideapad_dytc_profile_init()
941 priv->dytc = kzalloc(sizeof(*priv->dytc), GFP_KERNEL); in ideapad_dytc_profile_init()
942 if (!priv->dytc) in ideapad_dytc_profile_init()
943 return -ENOMEM; in ideapad_dytc_profile_init()
945 mutex_init(&priv->dytc->mutex); in ideapad_dytc_profile_init()
947 priv->dytc->priv = priv; in ideapad_dytc_profile_init()
948 priv->dytc->pprof.profile_get = dytc_profile_get; in ideapad_dytc_profile_init()
949 priv->dytc->pprof.profile_set = dytc_profile_set; in ideapad_dytc_profile_init()
952 set_bit(PLATFORM_PROFILE_LOW_POWER, priv->dytc->pprof.choices); in ideapad_dytc_profile_init()
953 set_bit(PLATFORM_PROFILE_BALANCED, priv->dytc->pprof.choices); in ideapad_dytc_profile_init()
954 set_bit(PLATFORM_PROFILE_PERFORMANCE, priv->dytc->pprof.choices); in ideapad_dytc_profile_init()
957 err = platform_profile_register(&priv->dytc->pprof); in ideapad_dytc_profile_init()
967 mutex_destroy(&priv->dytc->mutex); in ideapad_dytc_profile_init()
968 kfree(priv->dytc); in ideapad_dytc_profile_init()
969 priv->dytc = NULL; in ideapad_dytc_profile_init()
976 if (!priv->dytc) in ideapad_dytc_profile_exit()
980 mutex_destroy(&priv->dytc->mutex); in ideapad_dytc_profile_exit()
981 kfree(priv->dytc); in ideapad_dytc_profile_exit()
983 priv->dytc = NULL; in ideapad_dytc_profile_exit()
1005 int opcode = ideapad_rfk_data[priv->dev].opcode; in ideapad_rfk_set()
1007 return write_ec_cmd(priv->priv->adev->handle, opcode, !blocked); in ideapad_rfk_set()
1019 if (priv->features.hw_rfkill_switch) { in ideapad_sync_rfk_state()
1020 if (read_ec_data(priv->adev->handle, VPCCMD_R_RF, &hw_blocked)) in ideapad_sync_rfk_state()
1026 if (priv->rfk[i]) in ideapad_sync_rfk_state()
1027 rfkill_set_hw_state(priv->rfk[i], hw_blocked); in ideapad_sync_rfk_state()
1037 write_ec_cmd(priv->adev->handle, ideapad_rfk_data[dev].opcode, 1); in ideapad_register_rfkill()
1041 priv->rfk_priv[dev].dev = dev; in ideapad_register_rfkill()
1042 priv->rfk_priv[dev].priv = priv; in ideapad_register_rfkill()
1044 priv->rfk[dev] = rfkill_alloc(ideapad_rfk_data[dev].name, in ideapad_register_rfkill()
1045 &priv->platform_device->dev, in ideapad_register_rfkill()
1048 &priv->rfk_priv[dev]); in ideapad_register_rfkill()
1049 if (!priv->rfk[dev]) in ideapad_register_rfkill()
1050 return -ENOMEM; in ideapad_register_rfkill()
1052 err = read_ec_data(priv->adev->handle, ideapad_rfk_data[dev].opcode - 1, &rf_enabled); in ideapad_register_rfkill()
1056 rfkill_init_sw_state(priv->rfk[dev], !rf_enabled); in ideapad_register_rfkill()
1058 err = rfkill_register(priv->rfk[dev]); in ideapad_register_rfkill()
1060 rfkill_destroy(priv->rfk[dev]); in ideapad_register_rfkill()
1067 if (!priv->rfk[dev]) in ideapad_unregister_rfkill()
1070 rfkill_unregister(priv->rfk[dev]); in ideapad_unregister_rfkill()
1071 rfkill_destroy(priv->rfk[dev]); in ideapad_unregister_rfkill()
1079 return device_add_group(&priv->platform_device->dev, in ideapad_sysfs_init()
1085 device_remove_group(&priv->platform_device->dev, in ideapad_sysfs_exit()
1115 return -ENOMEM; in ideapad_input_init()
1117 inputdev->name = "Ideapad extra buttons"; in ideapad_input_init()
1118 inputdev->phys = "ideapad/input0"; in ideapad_input_init()
1119 inputdev->id.bustype = BUS_HOST; in ideapad_input_init()
1120 inputdev->dev.parent = &priv->platform_device->dev; in ideapad_input_init()
1124 dev_err(&priv->platform_device->dev, in ideapad_input_init()
1131 dev_err(&priv->platform_device->dev, in ideapad_input_init()
1136 priv->inputdev = inputdev; in ideapad_input_init()
1148 input_unregister_device(priv->inputdev); in ideapad_input_exit()
1149 priv->inputdev = NULL; in ideapad_input_exit()
1155 sparse_keymap_report_event(priv->inputdev, scancode, 1, true); in ideapad_input_report()
1162 if (read_ec_data(priv->adev->handle, VPCCMD_R_NOVO, &long_pressed)) in ideapad_input_novokey()
1175 if (read_ec_data(priv->adev->handle, VPCCMD_R_SPECIAL_BUTTONS, &value)) in ideapad_check_special_buttons()
1190 dev_info(&priv->platform_device->dev, in ideapad_check_special_buttons()
1206 err = read_ec_data(priv->adev->handle, VPCCMD_R_BL, &now); in ideapad_backlight_get_brightness()
1218 err = write_ec_cmd(priv->adev->handle, VPCCMD_W_BL, in ideapad_backlight_update_status()
1219 blightdev->props.brightness); in ideapad_backlight_update_status()
1223 err = write_ec_cmd(priv->adev->handle, VPCCMD_W_BL_POWER, in ideapad_backlight_update_status()
1224 blightdev->props.power != FB_BLANK_POWERDOWN); in ideapad_backlight_update_status()
1243 err = read_ec_data(priv->adev->handle, VPCCMD_R_BL_MAX, &max); in ideapad_backlight_init()
1247 err = read_ec_data(priv->adev->handle, VPCCMD_R_BL, &now); in ideapad_backlight_init()
1251 err = read_ec_data(priv->adev->handle, VPCCMD_R_BL_POWER, &power); in ideapad_backlight_init()
1261 &priv->platform_device->dev, in ideapad_backlight_init()
1267 dev_err(&priv->platform_device->dev, in ideapad_backlight_init()
1272 priv->blightdev = blightdev; in ideapad_backlight_init()
1273 blightdev->props.brightness = now; in ideapad_backlight_init()
1274 blightdev->props.power = power ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; in ideapad_backlight_init()
1283 backlight_device_unregister(priv->blightdev); in ideapad_backlight_exit()
1284 priv->blightdev = NULL; in ideapad_backlight_exit()
1289 struct backlight_device *blightdev = priv->blightdev; in ideapad_backlight_notify_power()
1295 if (read_ec_data(priv->adev->handle, VPCCMD_R_BL_POWER, &power)) in ideapad_backlight_notify_power()
1298 blightdev->props.power = power ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; in ideapad_backlight_notify_power()
1306 if (!priv->blightdev) in ideapad_backlight_notify_brightness()
1307 read_ec_data(priv->adev->handle, VPCCMD_R_BL, &now); in ideapad_backlight_notify_brightness()
1309 backlight_force_update(priv->blightdev, BACKLIGHT_UPDATE_HOTKEY); in ideapad_backlight_notify_brightness()
1320 err = eval_hals(priv->adev->handle, &hals); in ideapad_kbd_bl_brightness_get()
1336 int err = exec_sals(priv->adev->handle, brightness ? SALS_KBD_BL_ON : SALS_KBD_BL_OFF); in ideapad_kbd_bl_brightness_set()
1341 priv->kbd_bl.last_brightness = brightness; in ideapad_kbd_bl_brightness_set()
1358 if (!priv->kbd_bl.initialized) in ideapad_kbd_bl_notify()
1365 if (brightness == priv->kbd_bl.last_brightness) in ideapad_kbd_bl_notify()
1368 priv->kbd_bl.last_brightness = brightness; in ideapad_kbd_bl_notify()
1370 led_classdev_notify_brightness_hw_changed(&priv->kbd_bl.led, brightness); in ideapad_kbd_bl_notify()
1377 if (!priv->features.kbd_bl) in ideapad_kbd_bl_init()
1378 return -ENODEV; in ideapad_kbd_bl_init()
1380 if (WARN_ON(priv->kbd_bl.initialized)) in ideapad_kbd_bl_init()
1381 return -EEXIST; in ideapad_kbd_bl_init()
1387 priv->kbd_bl.last_brightness = brightness; in ideapad_kbd_bl_init()
1389 priv->kbd_bl.led.name = "platform::" LED_FUNCTION_KBD_BACKLIGHT; in ideapad_kbd_bl_init()
1390 priv->kbd_bl.led.max_brightness = 1; in ideapad_kbd_bl_init()
1391 priv->kbd_bl.led.brightness_get = ideapad_kbd_bl_led_cdev_brightness_get; in ideapad_kbd_bl_init()
1392 priv->kbd_bl.led.brightness_set_blocking = ideapad_kbd_bl_led_cdev_brightness_set; in ideapad_kbd_bl_init()
1393 priv->kbd_bl.led.flags = LED_BRIGHT_HW_CHANGED; in ideapad_kbd_bl_init()
1395 err = led_classdev_register(&priv->platform_device->dev, &priv->kbd_bl.led); in ideapad_kbd_bl_init()
1399 priv->kbd_bl.initialized = true; in ideapad_kbd_bl_init()
1406 if (!priv->kbd_bl.initialized) in ideapad_kbd_bl_exit()
1409 priv->kbd_bl.initialized = false; in ideapad_kbd_bl_exit()
1411 led_classdev_unregister(&priv->kbd_bl.led); in ideapad_kbd_bl_exit()
1421 if (!priv->features.touchpad_ctrl_via_ec) in ideapad_sync_touchpad_state()
1425 if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) { in ideapad_sync_touchpad_state()
1428 * Some IdeaPads don't really turn off touchpad - they only in ideapad_sync_touchpad_state()
1435 sysfs_notify(&priv->platform_device->dev.kobj, NULL, "touchpad"); in ideapad_sync_touchpad_state()
1463 * This event gets send on a Yoga 300-11IBR when the EC in ideapad_acpi_notify()
1467 * windows service calling a DSM on the DUAL250E ACPI- in ideapad_acpi_notify()
1491 * seconds while on battery power; some in ideapad_acpi_notify()
1502 dev_info(&priv->platform_device->dev, in ideapad_acpi_notify()
1519 if (!priv->features.set_fn_lock_led) in ideapad_wmi_notify()
1522 if (!eval_hals(priv->adev->handle, &result)) { in ideapad_wmi_notify()
1525 exec_sals(priv->adev->handle, state ? SALS_FNLOCK_ON : SALS_FNLOCK_OFF); in ideapad_wmi_notify()
1529 dev_info(&priv->platform_device->dev, in ideapad_wmi_notify()
1550 * switch causing ideapad_laptop to wrongly report all radios as hw-blocked.
1553 * More importantly wrongly reporting the wifi radio as hw-blocked, results in
1554 * non working wifi. Whereas not reporting it hw-blocked, when it actually is
1555 * hw-blocked results in an empty SSID list, which is a much more benign
1575 .ident = "ZhaoYang K4e-IML",
1578 DMI_MATCH(DMI_PRODUCT_VERSION, "ZhaoYang K4e-IML"),
1586 acpi_handle handle = priv->adev->handle; in ideapad_check_features()
1589 priv->features.set_fn_lock_led = in ideapad_check_features()
1591 priv->features.hw_rfkill_switch = in ideapad_check_features()
1595 if (acpi_dev_present("ELAN0634", NULL, -1)) in ideapad_check_features()
1596 priv->features.touchpad_ctrl_via_ec = 0; in ideapad_check_features()
1598 priv->features.touchpad_ctrl_via_ec = 0; in ideapad_check_features()
1600 priv->features.touchpad_ctrl_via_ec = 1; in ideapad_check_features()
1603 priv->features.fan_mode = true; in ideapad_check_features()
1606 priv->features.conservation_mode = true; in ideapad_check_features()
1609 priv->features.dytc = true; in ideapad_check_features()
1614 priv->features.fn_lock = true; in ideapad_check_features()
1617 priv->features.kbd_bl = true; in ideapad_check_features()
1620 priv->features.usb_charging = true; in ideapad_check_features()
1627 struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); in ideapad_acpi_add()
1633 if (!adev || eval_int(adev->handle, "_CFG", &cfg)) in ideapad_acpi_add()
1634 return -ENODEV; in ideapad_acpi_add()
1636 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in ideapad_acpi_add()
1638 return -ENOMEM; in ideapad_acpi_add()
1640 dev_set_drvdata(&pdev->dev, priv); in ideapad_acpi_add()
1642 priv->cfg = cfg; in ideapad_acpi_add()
1643 priv->adev = adev; in ideapad_acpi_add()
1644 priv->platform_device = pdev; in ideapad_acpi_add()
1660 if (err != -ENODEV) in ideapad_acpi_add()
1661 dev_warn(&pdev->dev, "Could not set up keyboard backlight LED: %d\n", err); in ideapad_acpi_add()
1663 dev_info(&pdev->dev, "Keyboard backlight control not available\n"); in ideapad_acpi_add()
1667 * On some models without a hw-switch (the yoga 2 13 at least) in ideapad_acpi_add()
1670 if (!priv->features.hw_rfkill_switch) in ideapad_acpi_add()
1671 write_ec_cmd(priv->adev->handle, VPCCMD_W_RF, 1); in ideapad_acpi_add()
1674 if (!priv->features.touchpad_ctrl_via_ec) in ideapad_acpi_add()
1675 write_ec_cmd(priv->adev->handle, VPCCMD_W_TOUCHPAD, 1); in ideapad_acpi_add()
1678 if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) in ideapad_acpi_add()
1686 if (err != -ENODEV) in ideapad_acpi_add()
1687 dev_warn(&pdev->dev, "Could not set up DYTC interface: %d\n", err); in ideapad_acpi_add()
1689 dev_info(&pdev->dev, "DYTC interface is not available\n"); in ideapad_acpi_add()
1694 if (err && err != -ENODEV) in ideapad_acpi_add()
1698 status = acpi_install_notify_handler(adev->handle, in ideapad_acpi_add()
1702 err = -EIO; in ideapad_acpi_add()
1711 priv->fnesc_guid = ideapad_wmi_fnesc_events[i]; in ideapad_acpi_add()
1717 err = -EIO; in ideapad_acpi_add()
1726 acpi_remove_notify_handler(priv->adev->handle, in ideapad_acpi_add()
1752 struct ideapad_private *priv = dev_get_drvdata(&pdev->dev); in ideapad_acpi_remove()
1756 if (priv->fnesc_guid) in ideapad_acpi_remove()
1757 wmi_remove_notify_handler(priv->fnesc_guid); in ideapad_acpi_remove()
1760 acpi_remove_notify_handler(priv->adev->handle, in ideapad_acpi_remove()
1786 if (priv->dytc) in ideapad_acpi_resume()