Lines Matching +full:battery +full:- +full:profile
1 // SPDX-License-Identifier: GPL-2.0-or-later
22 #include <linux/input/sparse-keymap.h>
33 MODULE_ALIAS("wmi:95F24279-4D7B-4334-9387-ACCDC67EF61C");
34 MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
36 static int enable_tablet_mode_sw = -1;
38 MODULE_PARM_DESC(enable_tablet_mode_sw, "Enable SW_TABLET_MODE reporting (-1=auto, 0=no, 1=yes)");
40 #define HPWMI_EVENT_GUID "95F24279-4D7B-4334-9387-ACCDC67EF61C"
41 #define HPWMI_BIOS_GUID "5FB7F034-2C63-45e9-BE91-3D44E2C707E4"
189 return -EINVAL; in encode_outsize_for_pvsz()
212 * -EINVAL if the query was not successful at all
213 * -EINVAL if the output buffer size exceeds buffersize
216 * size. E.g. Battery info query is defined to have 1 byte input
244 return -EINVAL; in hp_wmi_perform_query()
252 return -EINVAL; in hp_wmi_perform_query()
254 if (obj->type != ACPI_TYPE_BUFFER) { in hp_wmi_perform_query()
255 ret = -EINVAL; in hp_wmi_perform_query()
259 bios_return = (struct bios_return *)obj->buffer.pointer; in hp_wmi_perform_query()
260 ret = bios_return->return_code; in hp_wmi_perform_query()
273 actual_outsize = min(outsize, (int)(obj->buffer.length - sizeof(*bios_return))); in hp_wmi_perform_query()
274 memcpy(buffer, obj->buffer.pointer + sizeof(*bios_return), actual_outsize); in hp_wmi_perform_query()
275 memset(buffer + actual_outsize, 0, outsize - actual_outsize); in hp_wmi_perform_query()
290 return ret < 0 ? ret : -EINVAL; in hp_wmi_read_int()
313 return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO; in hp_wmi_bios_2008_later()
324 return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO; in hp_wmi_bios_2009_later()
333 return ret <= 0 ? ret : -EINVAL; in hp_wmi_enable_hotkeys()
345 return ret <= 0 ? ret : -EINVAL; in hp_wmi_set_block()
385 return ret <= 0 ? ret : -EINVAL; in hp_wmi_rfkill2_set_block()
408 devstate->rfkill_id != rfkill2[i].id) { in hp_wmi_rfkill2_refresh()
414 IS_SWBLOCKED(devstate->power), in hp_wmi_rfkill2_refresh()
415 IS_HWBLOCKED(devstate->power)); in hp_wmi_rfkill2_refresh()
489 return ret < 0 ? ret : -EINVAL; in als_store()
506 return -EINVAL; in postcode_store()
512 return ret < 0 ? ret : -EINVAL; in postcode_store()
554 if (obj->type != ACPI_TYPE_BUFFER) { in hp_wmi_notify()
555 pr_info("Unknown response received %d\n", obj->type); in hp_wmi_notify()
564 location = (u32 *)obj->buffer.pointer; in hp_wmi_notify()
565 if (obj->buffer.length == 8) { in hp_wmi_notify()
568 } else if (obj->buffer.length == 16) { in hp_wmi_notify()
572 pr_info("Unknown buffer length %d\n", obj->buffer.length); in hp_wmi_notify()
580 if (test_bit(SW_DOCK, hp_wmi_input_dev->swbit)) in hp_wmi_notify()
583 if (test_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit)) in hp_wmi_notify()
599 pr_info("Unknown key code - 0x%x\n", key_code); in hp_wmi_notify()
621 pr_info("Unimplemented CPU throttle because of 3 Cell battery event detected\n"); in hp_wmi_notify()
642 pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data); in hp_wmi_notify()
654 return -ENOMEM; in hp_wmi_input_setup()
656 hp_wmi_input_dev->name = "HP WMI hotkeys"; in hp_wmi_input_setup()
657 hp_wmi_input_dev->phys = "wmi/input0"; in hp_wmi_input_setup()
658 hp_wmi_input_dev->id.bustype = BUS_HOST; in hp_wmi_input_setup()
660 __set_bit(EV_SW, hp_wmi_input_dev->evbit); in hp_wmi_input_setup()
665 __set_bit(SW_DOCK, hp_wmi_input_dev->swbit); in hp_wmi_input_setup()
673 __set_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit); in hp_wmi_input_setup()
690 err = -EIO; in hp_wmi_input_setup()
727 wifi_rfkill = rfkill_alloc("hp-wifi", &device->dev, in hp_wmi_rfkill_setup()
732 return -ENOMEM; in hp_wmi_rfkill_setup()
743 bluetooth_rfkill = rfkill_alloc("hp-bluetooth", &device->dev, in hp_wmi_rfkill_setup()
748 err = -ENOMEM; in hp_wmi_rfkill_setup()
761 wwan_rfkill = rfkill_alloc("hp-wwan", &device->dev, in hp_wmi_rfkill_setup()
766 err = -ENOMEM; in hp_wmi_rfkill_setup()
804 return err < 0 ? err : -EINVAL; in hp_wmi_rfkill2_setup()
808 return -EINVAL; in hp_wmi_rfkill2_setup()
818 name = "hp-wifi"; in hp_wmi_rfkill2_setup()
822 name = "hp-bluetooth"; in hp_wmi_rfkill2_setup()
826 name = "hp-wwan"; in hp_wmi_rfkill2_setup()
830 name = "hp-gps"; in hp_wmi_rfkill2_setup()
844 rfkill = rfkill_alloc(name, &device->dev, type, in hp_wmi_rfkill2_setup()
847 err = -ENOMEM; in hp_wmi_rfkill2_setup()
874 for (; rfkill2_count > 0; rfkill2_count--) { in hp_wmi_rfkill2_setup()
875 rfkill_unregister(rfkill2[rfkill2_count - 1].rfkill); in hp_wmi_rfkill2_setup()
876 rfkill_destroy(rfkill2[rfkill2_count - 1].rfkill); in hp_wmi_rfkill2_setup()
893 enum platform_profile_option *profile) in platform_profile_get() argument
903 *profile = PLATFORM_PROFILE_PERFORMANCE; in platform_profile_get()
906 *profile = PLATFORM_PROFILE_BALANCED; in platform_profile_get()
909 *profile = PLATFORM_PROFILE_COOL; in platform_profile_get()
912 return -EINVAL; in platform_profile_get()
919 enum platform_profile_option profile) in platform_profile_set() argument
923 switch (profile) { in platform_profile_set()
934 return -EOPNOTSUPP; in platform_profile_set()
953 * call thermal profile write command to ensure that the firmware correctly in thermal_profile_setup()
1029 if (test_bit(SW_DOCK, hp_wmi_input_dev->swbit)) in hp_wmi_resume_handler()
1032 if (test_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit)) in hp_wmi_resume_handler()
1064 .name = "hp-wmi",
1078 return -ENODEV; in hp_wmi_init()
1088 platform_device_register_simple("hp-wmi", -1, NULL, 0); in hp_wmi_init()