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
105 * were introduced that exceeds 128-byte data size. Changes to handle
281 return -EINVAL; in encode_outsize_for_pvsz()
304 * -EINVAL if the query was not successful at all
305 * -EINVAL if the output buffer size exceeds buffersize
308 * size. E.g. Battery info query is defined to have 1 byte input
332 return -ENOMEM; in hp_wmi_perform_query()
337 args->signature = 0x55434553; in hp_wmi_perform_query()
338 args->command = command; in hp_wmi_perform_query()
339 args->commandtype = query; in hp_wmi_perform_query()
340 args->datasize = insize; in hp_wmi_perform_query()
341 memcpy(args->data, buffer, flex_array_size(args, data, insize)); in hp_wmi_perform_query()
349 ret = -EINVAL; in hp_wmi_perform_query()
353 if (obj->type != ACPI_TYPE_BUFFER) { in hp_wmi_perform_query()
355 ret = -EINVAL; in hp_wmi_perform_query()
359 bios_return = (struct bios_return *)obj->buffer.pointer; in hp_wmi_perform_query()
360 ret = bios_return->return_code; in hp_wmi_perform_query()
373 actual_outsize = min(outsize, (int)(obj->buffer.length - sizeof(*bios_return))); in hp_wmi_perform_query()
374 memcpy(buffer, obj->buffer.pointer + sizeof(*bios_return), actual_outsize); in hp_wmi_perform_query()
375 memset(buffer + actual_outsize, 0, outsize - actual_outsize); in hp_wmi_perform_query()
393 return -EINVAL; in hp_wmi_get_fan_speed()
409 return ret < 0 ? ret : -EINVAL; in hp_wmi_read_int()
433 return -ENODEV; in hp_wmi_get_tablet_mode()
439 return -ENODEV; in hp_wmi_get_tablet_mode()
459 return ret < 0 ? ret : -EINVAL; in omen_thermal_profile_set()
495 return ret < 0 ? ret : -EINVAL; in omen_get_thermal_policy_version()
520 return ret < 0 ? ret : -EINVAL; in hp_wmi_fan_speed_max_set()
533 return ret < 0 ? ret : -EINVAL; in hp_wmi_fan_speed_max_get()
546 return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO; in hp_wmi_bios_2008_later()
557 return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO; in hp_wmi_bios_2009_later()
566 return ret <= 0 ? ret : -EINVAL; in hp_wmi_enable_hotkeys()
578 return ret <= 0 ? ret : -EINVAL; in hp_wmi_set_block()
618 return ret <= 0 ? ret : -EINVAL; in hp_wmi_rfkill2_set_block()
642 devstate->rfkill_id != rfkill2[i].id) { in hp_wmi_rfkill2_refresh()
648 IS_SWBLOCKED(devstate->power), in hp_wmi_rfkill2_refresh()
649 IS_HWBLOCKED(devstate->power)); in hp_wmi_rfkill2_refresh()
729 return ret < 0 ? ret : -EINVAL; in als_store()
746 return -EINVAL; in postcode_store()
752 return ret < 0 ? ret : -EINVAL; in postcode_store()
763 return -ENOMEM; in camera_shutter_input_setup()
765 camera_shutter_input_dev->name = "HP WMI camera shutter"; in camera_shutter_input_setup()
766 camera_shutter_input_dev->phys = "wmi/input1"; in camera_shutter_input_setup()
767 camera_shutter_input_dev->id.bustype = BUS_HOST; in camera_shutter_input_setup()
769 __set_bit(EV_SW, camera_shutter_input_dev->evbit); in camera_shutter_input_setup()
770 __set_bit(SW_CAMERA_LENS_COVER, camera_shutter_input_dev->swbit); in camera_shutter_input_setup()
821 if (obj->type != ACPI_TYPE_BUFFER) { in hp_wmi_notify()
822 pr_info("Unknown response received %d\n", obj->type); in hp_wmi_notify()
831 location = (u32 *)obj->buffer.pointer; in hp_wmi_notify()
832 if (obj->buffer.length == 8) { in hp_wmi_notify()
835 } else if (obj->buffer.length == 16) { in hp_wmi_notify()
839 pr_info("Unknown buffer length %d\n", obj->buffer.length); in hp_wmi_notify()
847 if (test_bit(SW_DOCK, hp_wmi_input_dev->swbit)) in hp_wmi_notify()
850 if (test_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit)) in hp_wmi_notify()
866 pr_info("Unknown key code - 0x%x\n", key_code); in hp_wmi_notify()
876 pr_info("Unknown key code - 0x%x\n", key_code); in hp_wmi_notify()
898 pr_info("Unimplemented CPU throttle because of 3 Cell battery event detected\n"); in hp_wmi_notify()
931 pr_warn("Unknown camera shutter state - 0x%x\n", event_data); in hp_wmi_notify()
937 pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data); in hp_wmi_notify()
949 return -ENOMEM; in hp_wmi_input_setup()
951 hp_wmi_input_dev->name = "HP WMI hotkeys"; in hp_wmi_input_setup()
952 hp_wmi_input_dev->phys = "wmi/input0"; in hp_wmi_input_setup()
953 hp_wmi_input_dev->id.bustype = BUS_HOST; in hp_wmi_input_setup()
955 __set_bit(EV_SW, hp_wmi_input_dev->evbit); in hp_wmi_input_setup()
960 __set_bit(SW_DOCK, hp_wmi_input_dev->swbit); in hp_wmi_input_setup()
967 __set_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit); in hp_wmi_input_setup()
983 err = -EIO; in hp_wmi_input_setup()
1020 wifi_rfkill = rfkill_alloc("hp-wifi", &device->dev, in hp_wmi_rfkill_setup()
1025 return -ENOMEM; in hp_wmi_rfkill_setup()
1036 bluetooth_rfkill = rfkill_alloc("hp-bluetooth", &device->dev, in hp_wmi_rfkill_setup()
1041 err = -ENOMEM; in hp_wmi_rfkill_setup()
1054 wwan_rfkill = rfkill_alloc("hp-wwan", &device->dev, in hp_wmi_rfkill_setup()
1059 err = -ENOMEM; in hp_wmi_rfkill_setup()
1097 return err < 0 ? err : -EINVAL; in hp_wmi_rfkill2_setup()
1101 return -EINVAL; in hp_wmi_rfkill2_setup()
1112 name = "hp-wifi"; in hp_wmi_rfkill2_setup()
1116 name = "hp-bluetooth"; in hp_wmi_rfkill2_setup()
1120 name = "hp-wwan"; in hp_wmi_rfkill2_setup()
1124 name = "hp-gps"; in hp_wmi_rfkill2_setup()
1138 rfkill = rfkill_alloc(name, &device->dev, type, in hp_wmi_rfkill2_setup()
1141 err = -ENOMEM; in hp_wmi_rfkill2_setup()
1168 for (; rfkill2_count > 0; rfkill2_count--) { in hp_wmi_rfkill2_setup()
1169 rfkill_unregister(rfkill2[rfkill2_count - 1].rfkill); in hp_wmi_rfkill2_setup()
1170 rfkill_destroy(rfkill2[rfkill2_count - 1].rfkill); in hp_wmi_rfkill2_setup()
1176 enum platform_profile_option *profile) in platform_profile_omen_get() argument
1187 *profile = PLATFORM_PROFILE_PERFORMANCE; in platform_profile_omen_get()
1191 *profile = PLATFORM_PROFILE_BALANCED; in platform_profile_omen_get()
1195 *profile = PLATFORM_PROFILE_COOL; in platform_profile_omen_get()
1198 return -EINVAL; in platform_profile_omen_get()
1205 enum platform_profile_option profile) in platform_profile_omen_set() argument
1212 return -EOPNOTSUPP; in platform_profile_omen_set()
1214 switch (profile) { in platform_profile_omen_set()
1234 return -EOPNOTSUPP; in platform_profile_omen_set()
1256 enum platform_profile_option *profile) in hp_wmi_platform_profile_get() argument
1266 *profile = PLATFORM_PROFILE_PERFORMANCE; in hp_wmi_platform_profile_get()
1269 *profile = PLATFORM_PROFILE_BALANCED; in hp_wmi_platform_profile_get()
1272 *profile = PLATFORM_PROFILE_COOL; in hp_wmi_platform_profile_get()
1275 *profile = PLATFORM_PROFILE_QUIET; in hp_wmi_platform_profile_get()
1278 return -EINVAL; in hp_wmi_platform_profile_get()
1285 enum platform_profile_option profile) in hp_wmi_platform_profile_set() argument
1289 switch (profile) { in hp_wmi_platform_profile_set()
1303 return -EOPNOTSUPP; in hp_wmi_platform_profile_set()
1326 enum platform_profile_option *profile) in platform_profile_victus_get() argument
1336 *profile = PLATFORM_PROFILE_PERFORMANCE; in platform_profile_victus_get()
1339 *profile = PLATFORM_PROFILE_BALANCED; in platform_profile_victus_get()
1342 *profile = PLATFORM_PROFILE_QUIET; in platform_profile_victus_get()
1345 return -EOPNOTSUPP; in platform_profile_victus_get()
1352 enum platform_profile_option profile) in platform_profile_victus_set() argument
1356 switch (profile) { in platform_profile_victus_set()
1367 return -EOPNOTSUPP; in platform_profile_victus_set()
1387 * call thermal profile write command to ensure that the in thermal_profile_setup()
1405 * call thermal profile write command to ensure that the in thermal_profile_setup()
1423 * call thermal profile write command to ensure that the in thermal_profile_setup()
1461 * In pre-2009 BIOS, command 1Bh return 0x4 to indicate that in hp_wmi_bios_setup()
1518 if (test_bit(SW_DOCK, hp_wmi_input_dev->swbit)) in hp_wmi_resume_handler()
1521 if (test_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit)) in hp_wmi_resume_handler()
1559 .name = "hp-wmi",
1611 return -ENODATA; in hp_wmi_hwmon_read()
1614 return -EINVAL; in hp_wmi_hwmon_read()
1632 return -EINVAL; in hp_wmi_hwmon_write()
1635 return -EOPNOTSUPP; in hp_wmi_hwmon_write()
1658 struct device *dev = &hp_wmi_platform_dev->dev; in hp_wmi_hwmon_init()
1679 return -ENODEV; in hp_wmi_init()
1693 platform_device_register_simple("hp-wmi", PLATFORM_DEVID_NONE, NULL, 0); in hp_wmi_init()