Lines Matching refs:handle
161 static int eval_int(acpi_handle handle, const char *name, unsigned long *res) in eval_int() argument
166 status = acpi_evaluate_integer(handle, (char *)name, NULL, &result); in eval_int()
175 static int exec_simple_method(acpi_handle handle, const char *name, unsigned long arg) in exec_simple_method() argument
177 acpi_status status = acpi_execute_simple_method(handle, (char *)name, arg); in exec_simple_method()
182 static int eval_gbmd(acpi_handle handle, unsigned long *res) in eval_gbmd() argument
184 return eval_int(handle, "GBMD", res); in eval_gbmd()
187 static int exec_sbmc(acpi_handle handle, unsigned long arg) in exec_sbmc() argument
189 return exec_simple_method(handle, "SBMC", arg); in exec_sbmc()
192 static int eval_hals(acpi_handle handle, unsigned long *res) in eval_hals() argument
194 return eval_int(handle, "HALS", res); in eval_hals()
197 static int exec_sals(acpi_handle handle, unsigned long arg) in exec_sals() argument
199 return exec_simple_method(handle, "SALS", arg); in exec_sals()
202 static int eval_int_with_arg(acpi_handle handle, const char *name, unsigned long arg, unsigned long… in eval_int_with_arg() argument
214 status = acpi_evaluate_integer(handle, (char *)name, ¶ms, &result); in eval_int_with_arg()
224 static int eval_dytc(acpi_handle handle, unsigned long cmd, unsigned long *res) in eval_dytc() argument
226 return eval_int_with_arg(handle, "DYTC", cmd, res); in eval_dytc()
229 static int eval_vpcr(acpi_handle handle, unsigned long cmd, unsigned long *res) in eval_vpcr() argument
231 return eval_int_with_arg(handle, "VPCR", cmd, res); in eval_vpcr()
234 static int eval_vpcw(acpi_handle handle, unsigned long cmd, unsigned long data) in eval_vpcw() argument
247 status = acpi_evaluate_object(handle, "VPCW", ¶ms, NULL); in eval_vpcw()
254 static int read_ec_data(acpi_handle handle, unsigned long cmd, unsigned long *data) in read_ec_data() argument
259 err = eval_vpcw(handle, 1, cmd); in read_ec_data()
268 err = eval_vpcr(handle, 1, &val); in read_ec_data()
273 return eval_vpcr(handle, 0, data); in read_ec_data()
276 acpi_handle_err(handle, "timeout in %s\n", __func__); in read_ec_data()
281 static int write_ec_cmd(acpi_handle handle, unsigned long cmd, unsigned long data) in write_ec_cmd() argument
286 err = eval_vpcw(handle, 0, data); in write_ec_cmd()
290 err = eval_vpcw(handle, 1, cmd); in write_ec_cmd()
299 err = eval_vpcr(handle, 1, &val); in write_ec_cmd()
307 acpi_handle_err(handle, "timeout in %s\n", __func__); in write_ec_cmd()
320 if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL_MAX, &value)) in debugfs_status_show()
322 if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL, &value)) in debugfs_status_show()
324 if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL_POWER, &value)) in debugfs_status_show()
329 if (!read_ec_data(priv->adev->handle, VPCCMD_R_RF, &value)) in debugfs_status_show()
331 if (!read_ec_data(priv->adev->handle, VPCCMD_R_WIFI, &value)) in debugfs_status_show()
333 if (!read_ec_data(priv->adev->handle, VPCCMD_R_BT, &value)) in debugfs_status_show()
335 if (!read_ec_data(priv->adev->handle, VPCCMD_R_3G, &value)) in debugfs_status_show()
340 if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) in debugfs_status_show()
342 if (!read_ec_data(priv->adev->handle, VPCCMD_R_CAMERA, &value)) in debugfs_status_show()
347 if (!eval_gbmd(priv->adev->handle, &value)) in debugfs_status_show()
349 if (!eval_hals(priv->adev->handle, &value)) in debugfs_status_show()
427 err = read_ec_data(priv->adev->handle, VPCCMD_R_CAMERA, &result); in camera_power_show()
446 err = write_ec_cmd(priv->adev->handle, VPCCMD_W_CAMERA, state); in camera_power_store()
463 err = eval_gbmd(priv->adev->handle, &result); in conservation_mode_show()
482 err = exec_sbmc(priv->adev->handle, state ? SBMC_CONSERVATION_ON : SBMC_CONSERVATION_OFF); in conservation_mode_store()
499 err = read_ec_data(priv->adev->handle, VPCCMD_R_FAN, &result); in fan_mode_show()
521 err = write_ec_cmd(priv->adev->handle, VPCCMD_W_FAN, state); in fan_mode_store()
538 err = eval_hals(priv->adev->handle, &hals); in fn_lock_show()
557 err = exec_sals(priv->adev->handle, state ? SALS_FNLOCK_ON : SALS_FNLOCK_OFF); in fn_lock_store()
574 err = read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &result); in touchpad_show()
593 err = write_ec_cmd(priv->adev->handle, VPCCMD_W_TOUCHPAD, state); in touchpad_store()
610 err = eval_hals(priv->adev->handle, &hals); in usb_charging_show()
629 err = exec_sals(priv->adev->handle, state ? SALS_USB_CHARGING_ON : SALS_USB_CHARGING_OFF); in usb_charging_store()
778 err = eval_dytc(priv->adev->handle, DYTC_CMD_GET, output); in dytc_cql_command()
788 err = eval_dytc(priv->adev->handle, DYTC_DISABLE_CQL, NULL); in dytc_cql_command()
793 cmd_err = eval_dytc(priv->adev->handle, cmd, output); in dytc_cql_command()
797 err = eval_dytc(priv->adev->handle, DYTC_ENABLE_CQL, NULL); in dytc_cql_command()
823 err = eval_dytc(priv->adev->handle, DYTC_CMD_RESET, NULL); in dytc_profile_set()
880 err = eval_dytc(priv->adev->handle, DYTC_CMD_QUERY, &output); in ideapad_dytc_profile_init()
959 return write_ec_cmd(priv->priv->adev->handle, opcode, !blocked); in ideapad_rfk_set()
972 if (read_ec_data(priv->adev->handle, VPCCMD_R_RF, &hw_blocked)) in ideapad_sync_rfk_state()
989 write_ec_cmd(priv->adev->handle, ideapad_rfk_data[dev].opcode, 1); in ideapad_register_rfkill()
1004 err = read_ec_data(priv->adev->handle, ideapad_rfk_data[dev].opcode - 1, &rf_enabled); in ideapad_register_rfkill()
1114 if (read_ec_data(priv->adev->handle, VPCCMD_R_NOVO, &long_pressed)) in ideapad_input_novokey()
1127 if (read_ec_data(priv->adev->handle, VPCCMD_R_SPECIAL_BUTTONS, &value)) in ideapad_check_special_buttons()
1158 err = read_ec_data(priv->adev->handle, VPCCMD_R_BL, &now); in ideapad_backlight_get_brightness()
1170 err = write_ec_cmd(priv->adev->handle, VPCCMD_W_BL, in ideapad_backlight_update_status()
1175 err = write_ec_cmd(priv->adev->handle, VPCCMD_W_BL_POWER, in ideapad_backlight_update_status()
1195 err = read_ec_data(priv->adev->handle, VPCCMD_R_BL_MAX, &max); in ideapad_backlight_init()
1199 err = read_ec_data(priv->adev->handle, VPCCMD_R_BL, &now); in ideapad_backlight_init()
1203 err = read_ec_data(priv->adev->handle, VPCCMD_R_BL_POWER, &power); in ideapad_backlight_init()
1247 if (read_ec_data(priv->adev->handle, VPCCMD_R_BL_POWER, &power)) in ideapad_backlight_notify_power()
1259 read_ec_data(priv->adev->handle, VPCCMD_R_BL, &now); in ideapad_backlight_notify_brightness()
1272 err = eval_hals(priv->adev->handle, &hals); in ideapad_kbd_bl_brightness_get()
1288 int err = exec_sals(priv->adev->handle, brightness ? SALS_KBD_BL_ON : SALS_KBD_BL_OFF); in ideapad_kbd_bl_brightness_set()
1377 if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) { in ideapad_sync_touchpad_state()
1391 static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) in ideapad_acpi_notify() argument
1396 if (read_ec_data(handle, VPCCMD_R_VPC1, &vpc1)) in ideapad_acpi_notify()
1399 if (read_ec_data(handle, VPCCMD_R_VPC2, &vpc2)) in ideapad_acpi_notify()
1474 if (!eval_hals(priv->adev->handle, &result)) { in ideapad_wmi_notify()
1477 exec_sals(priv->adev->handle, state ? SALS_FNLOCK_ON : SALS_FNLOCK_OFF); in ideapad_wmi_notify()
1544 acpi_handle handle = priv->adev->handle; in ideapad_check_features() local
1558 if (!read_ec_data(handle, VPCCMD_R_FAN, &val)) in ideapad_check_features()
1561 if (acpi_has_method(handle, "GBMD") && acpi_has_method(handle, "SBMC")) in ideapad_check_features()
1564 if (acpi_has_method(handle, "DYTC")) in ideapad_check_features()
1567 if (acpi_has_method(handle, "HALS") && acpi_has_method(handle, "SALS")) { in ideapad_check_features()
1568 if (!eval_hals(handle, &val)) { in ideapad_check_features()
1593 if (eval_int(adev->handle, "_CFG", &cfg)) in ideapad_acpi_add()
1631 write_ec_cmd(priv->adev->handle, VPCCMD_W_RF, 1); in ideapad_acpi_add()
1635 write_ec_cmd(priv->adev->handle, VPCCMD_W_TOUCHPAD, 1); in ideapad_acpi_add()
1658 status = acpi_install_notify_handler(adev->handle, in ideapad_acpi_add()
1686 acpi_remove_notify_handler(priv->adev->handle, in ideapad_acpi_add()
1720 acpi_remove_notify_handler(priv->adev->handle, in ideapad_acpi_remove()