Lines Matching +full:battery +full:- +full:profile

1 // SPDX-License-Identifier: GPL-2.0-or-later
22 #include <linux/input/sparse-keymap.h>
35 MODULE_ALIAS("wmi:95F24279-4D7B-4334-9387-ACCDC67EF61C");
36 MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
38 #define HPWMI_EVENT_GUID "95F24279-4D7B-4334-9387-ACCDC67EF61C"
39 #define HPWMI_BIOS_GUID "5FB7F034-2C63-45e9-BE91-3D44E2C707E4"
49 * "OMEN", and it can use the thermal profile stuff if the "Feature" array
62 * profile version 0 by the Omen Command Center app, regardless of what
98 * were introduced that exceeds 128-byte data size. Changes to handle
261 return -EINVAL; in encode_outsize_for_pvsz()
284 * -EINVAL if the query was not successful at all
285 * -EINVAL if the output buffer size exceeds buffersize
288 * size. E.g. Battery info query is defined to have 1 byte input
312 return -ENOMEM; in hp_wmi_perform_query()
317 args->signature = 0x55434553; in hp_wmi_perform_query()
318 args->command = command; in hp_wmi_perform_query()
319 args->commandtype = query; in hp_wmi_perform_query()
320 args->datasize = insize; in hp_wmi_perform_query()
321 memcpy(args->data, buffer, flex_array_size(args, data, insize)); in hp_wmi_perform_query()
329 ret = -EINVAL; in hp_wmi_perform_query()
333 if (obj->type != ACPI_TYPE_BUFFER) { in hp_wmi_perform_query()
335 ret = -EINVAL; in hp_wmi_perform_query()
339 bios_return = (struct bios_return *)obj->buffer.pointer; in hp_wmi_perform_query()
340 ret = bios_return->return_code; in hp_wmi_perform_query()
353 actual_outsize = min(outsize, (int)(obj->buffer.length - sizeof(*bios_return))); in hp_wmi_perform_query()
354 memcpy(buffer, obj->buffer.pointer + sizeof(*bios_return), actual_outsize); in hp_wmi_perform_query()
355 memset(buffer + actual_outsize, 0, outsize - actual_outsize); in hp_wmi_perform_query()
373 return -EINVAL; in hp_wmi_get_fan_speed()
389 return ret < 0 ? ret : -EINVAL; in hp_wmi_read_int()
413 return -ENODEV; in hp_wmi_get_tablet_mode()
419 return -ENODEV; in hp_wmi_get_tablet_mode()
439 return ret < 0 ? ret : -EINVAL; in omen_thermal_profile_set()
475 return ret < 0 ? ret : -EINVAL; in omen_get_thermal_policy_version()
500 return ret < 0 ? ret : -EINVAL; in hp_wmi_fan_speed_max_set()
513 return ret < 0 ? ret : -EINVAL; in hp_wmi_fan_speed_max_get()
526 return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO; in hp_wmi_bios_2008_later()
537 return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO; in hp_wmi_bios_2009_later()
546 return ret <= 0 ? ret : -EINVAL; in hp_wmi_enable_hotkeys()
558 return ret <= 0 ? ret : -EINVAL; in hp_wmi_set_block()
598 return ret <= 0 ? ret : -EINVAL; in hp_wmi_rfkill2_set_block()
622 devstate->rfkill_id != rfkill2[i].id) { in hp_wmi_rfkill2_refresh()
628 IS_SWBLOCKED(devstate->power), in hp_wmi_rfkill2_refresh()
629 IS_HWBLOCKED(devstate->power)); in hp_wmi_rfkill2_refresh()
709 return ret < 0 ? ret : -EINVAL; in als_store()
726 return -EINVAL; in postcode_store()
732 return ret < 0 ? ret : -EINVAL; in postcode_store()
774 if (obj->type != ACPI_TYPE_BUFFER) { in hp_wmi_notify()
775 pr_info("Unknown response received %d\n", obj->type); in hp_wmi_notify()
784 location = (u32 *)obj->buffer.pointer; in hp_wmi_notify()
785 if (obj->buffer.length == 8) { in hp_wmi_notify()
788 } else if (obj->buffer.length == 16) { in hp_wmi_notify()
792 pr_info("Unknown buffer length %d\n", obj->buffer.length); in hp_wmi_notify()
800 if (test_bit(SW_DOCK, hp_wmi_input_dev->swbit)) in hp_wmi_notify()
803 if (test_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit)) in hp_wmi_notify()
819 pr_info("Unknown key code - 0x%x\n", key_code); in hp_wmi_notify()
841 pr_info("Unimplemented CPU throttle because of 3 Cell battery event detected\n"); in hp_wmi_notify()
866 pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data); in hp_wmi_notify()
878 return -ENOMEM; in hp_wmi_input_setup()
880 hp_wmi_input_dev->name = "HP WMI hotkeys"; in hp_wmi_input_setup()
881 hp_wmi_input_dev->phys = "wmi/input0"; in hp_wmi_input_setup()
882 hp_wmi_input_dev->id.bustype = BUS_HOST; in hp_wmi_input_setup()
884 __set_bit(EV_SW, hp_wmi_input_dev->evbit); in hp_wmi_input_setup()
889 __set_bit(SW_DOCK, hp_wmi_input_dev->swbit); in hp_wmi_input_setup()
896 __set_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit); in hp_wmi_input_setup()
912 err = -EIO; in hp_wmi_input_setup()
949 wifi_rfkill = rfkill_alloc("hp-wifi", &device->dev, in hp_wmi_rfkill_setup()
954 return -ENOMEM; in hp_wmi_rfkill_setup()
965 bluetooth_rfkill = rfkill_alloc("hp-bluetooth", &device->dev, in hp_wmi_rfkill_setup()
970 err = -ENOMEM; in hp_wmi_rfkill_setup()
983 wwan_rfkill = rfkill_alloc("hp-wwan", &device->dev, in hp_wmi_rfkill_setup()
988 err = -ENOMEM; in hp_wmi_rfkill_setup()
1026 return err < 0 ? err : -EINVAL; in hp_wmi_rfkill2_setup()
1030 return -EINVAL; in hp_wmi_rfkill2_setup()
1041 name = "hp-wifi"; in hp_wmi_rfkill2_setup()
1045 name = "hp-bluetooth"; in hp_wmi_rfkill2_setup()
1049 name = "hp-wwan"; in hp_wmi_rfkill2_setup()
1053 name = "hp-gps"; in hp_wmi_rfkill2_setup()
1067 rfkill = rfkill_alloc(name, &device->dev, type, in hp_wmi_rfkill2_setup()
1070 err = -ENOMEM; in hp_wmi_rfkill2_setup()
1097 for (; rfkill2_count > 0; rfkill2_count--) { in hp_wmi_rfkill2_setup()
1098 rfkill_unregister(rfkill2[rfkill2_count - 1].rfkill); in hp_wmi_rfkill2_setup()
1099 rfkill_destroy(rfkill2[rfkill2_count - 1].rfkill); in hp_wmi_rfkill2_setup()
1105 enum platform_profile_option *profile) in platform_profile_omen_get() argument
1116 *profile = PLATFORM_PROFILE_PERFORMANCE; in platform_profile_omen_get()
1120 *profile = PLATFORM_PROFILE_BALANCED; in platform_profile_omen_get()
1124 *profile = PLATFORM_PROFILE_COOL; in platform_profile_omen_get()
1127 return -EINVAL; in platform_profile_omen_get()
1134 enum platform_profile_option profile) in platform_profile_omen_set() argument
1141 return -EOPNOTSUPP; in platform_profile_omen_set()
1143 switch (profile) { in platform_profile_omen_set()
1163 return -EOPNOTSUPP; in platform_profile_omen_set()
1185 enum platform_profile_option *profile) in hp_wmi_platform_profile_get() argument
1195 *profile = PLATFORM_PROFILE_PERFORMANCE; in hp_wmi_platform_profile_get()
1198 *profile = PLATFORM_PROFILE_BALANCED; in hp_wmi_platform_profile_get()
1201 *profile = PLATFORM_PROFILE_COOL; in hp_wmi_platform_profile_get()
1204 *profile = PLATFORM_PROFILE_QUIET; in hp_wmi_platform_profile_get()
1207 return -EINVAL; in hp_wmi_platform_profile_get()
1214 enum platform_profile_option profile) in hp_wmi_platform_profile_set() argument
1218 switch (profile) { in hp_wmi_platform_profile_set()
1232 return -EOPNOTSUPP; in hp_wmi_platform_profile_set()
1252 * call thermal profile write command to ensure that the in thermal_profile_setup()
1269 * call thermal profile write command to ensure that the in thermal_profile_setup()
1307 * In pre-2009 BIOS, command 1Bh return 0x4 to indicate that in hp_wmi_bios_setup()
1364 if (test_bit(SW_DOCK, hp_wmi_input_dev->swbit)) in hp_wmi_resume_handler()
1367 if (test_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit)) in hp_wmi_resume_handler()
1399 .name = "hp-wmi",
1451 return -ENODATA; in hp_wmi_hwmon_read()
1454 return -EINVAL; in hp_wmi_hwmon_read()
1472 return -EINVAL; in hp_wmi_hwmon_write()
1475 return -EOPNOTSUPP; in hp_wmi_hwmon_write()
1498 struct device *dev = &hp_wmi_platform_dev->dev; in hp_wmi_hwmon_init()
1519 return -ENODEV; in hp_wmi_init()
1533 platform_device_register_simple("hp-wmi", PLATFORM_DEVID_NONE, NULL, 0); in hp_wmi_init()