Lines Matching +full:auto +full:- +full:sleep +full:- +full:disabled

1 // SPDX-License-Identifier: GPL-2.0-or-later
19 #define LEGACY_CONTROL_GUID "A90597CE-A997-11DA-B012-B622A1EF5492"
20 #define LEGACY_POWER_CONTROL_GUID "A80593CE-A997-11DA-B012-B622A1EF5492"
21 #define WMAX_CONTROL_GUID "A70591CE-A997-11DA-B012-B622A1EF5492"
47 MODULE_PARM_DESC(force_platform_profile, "Forces auto-detecting thermal profiles without checking i…
51 MODULE_PARM_DESC(force_gmode, "Forces G-Mode when performance profile is selected");
212 quirks = dmi->driver_data; in dmi_matched()
431 .name = "alienware-wmi",
459 /* RGB triplet notation is 24-bit hexadecimal */ in parse_rgb()
461 return -EINVAL; in parse_rgb()
464 pr_debug("alienware-wmi: r: %d g:%d b: %d\n", in parse_rgb()
466 zone->colors = repackager.cp; in parse_rgb()
474 for (zone = 0; zone < quirks->num_zones; zone++) { in match_zone()
476 pr_debug("alienware-wmi: matched zone location: %d\n", in match_zone()
496 wmax_basic_args.led_mask = 1 << zone->location; in alienware_update_led()
497 wmax_basic_args.colors = zone->colors; in alienware_update_led()
505 legacy_args.colors = zone->colors; in alienware_update_led()
514 method_id = zone->location + 1; in alienware_update_led()
519 pr_debug("alienware-wmi: guid %s method %d\n", guid, method_id); in alienware_update_led()
523 pr_err("alienware-wmi: zone set failure: %u\n", status); in alienware_update_led()
533 return sprintf(buf, "red: -1, green: -1, blue: -1\n"); in zone_show()
535 target_zone->colors.red, in zone_show()
536 target_zone->colors.green, target_zone->colors.blue); in zone_show()
547 pr_err("alienware-wmi: invalid target zone\n"); in zone_set()
573 pr_err("alienware-wmi: brightness set failure: %u\n", status); in wmax_brightness()
628 pr_debug("alienware-wmi: updated control state to %d\n", in store_control_state()
650 * - zone_dev_attrs num_zones + 1 is for individual zones and then in alienware_zone_init()
652 * - zone_attrs num_zones + 2 is for all attrs in zone_dev_attrs + in alienware_zone_init()
654 * - zone_data num_zones is for the distinct zones in alienware_zone_init()
657 kcalloc(quirks->num_zones + 1, sizeof(struct device_attribute), in alienware_zone_init()
660 return -ENOMEM; in alienware_zone_init()
663 kcalloc(quirks->num_zones + 2, sizeof(struct attribute *), in alienware_zone_init()
666 return -ENOMEM; in alienware_zone_init()
669 kcalloc(quirks->num_zones, sizeof(struct platform_zone), in alienware_zone_init()
672 return -ENOMEM; in alienware_zone_init()
674 for (zone = 0; zone < quirks->num_zones; zone++) { in alienware_zone_init()
687 zone_attrs[quirks->num_zones] = &dev_attr_lighting_control_state.attr; in alienware_zone_init()
690 led_classdev_register(&dev->dev, &global_led); in alienware_zone_init()
692 return sysfs_create_group(&dev->dev.kobj, &zone_attribute_group); in alienware_zone_init()
699 if (!quirks->num_zones) in alienware_zone_exit()
702 sysfs_remove_group(&dev->dev.kobj, &zone_attribute_group); in alienware_zone_exit()
705 for (zone = 0; zone < quirks->num_zones; zone++) in alienware_zone_exit()
730 if (obj && obj->type == ACPI_TYPE_INTEGER) in alienware_wmax_command()
731 *out_data = (u32)obj->integer.value; in alienware_wmax_command()
762 pr_err("alienware-wmi: unknown HDMI cable status: %d\n", status); in show_hdmi_cable()
784 pr_err("alienware-wmi: unknown HDMI source status: %u\n", status); in show_hdmi_source()
800 pr_debug("alienware-wmi: setting hdmi to %d : %s", args.arg, buf); in toggle_hdmi_source()
806 pr_err("alienware-wmi: HDMI toggle failed: results: %u\n", in toggle_hdmi_source()
828 if (quirks->hdmi_mux > 0) in remove_hdmi()
829 sysfs_remove_group(&dev->dev.kobj, &hdmi_attribute_group); in remove_hdmi()
836 ret = sysfs_create_group(&dev->dev.kobj, &hdmi_attribute_group); in create_hdmi()
844 * - Currently supports reading cable status
845 * - Leaving expansion room to possibly support dock/undock events later
864 pr_err("alienware-wmi: unknown amplifier cable status: %d\n", status); in show_amplifier_status()
882 if (quirks->amplifier > 0) in remove_amplifier()
883 sysfs_remove_group(&dev->dev.kobj, &amplifier_attribute_group); in remove_amplifier()
890 ret = sysfs_create_group(&dev->dev.kobj, &amplifier_attribute_group); in create_amplifier()
897 * Deep Sleep Control support
898 * - Modifies BIOS setting for deep sleep control allowing extra wakeup events
912 return sysfs_emit(buf, "[disabled] s5 s5_s4\n"); in show_deepsleep_status()
914 return sysfs_emit(buf, "disabled [s5] s5_s4\n"); in show_deepsleep_status()
916 return sysfs_emit(buf, "disabled s5 [s5_s4]\n"); in show_deepsleep_status()
918 pr_err("alienware-wmi: unknown deep sleep status: %d\n", status); in show_deepsleep_status()
919 return sysfs_emit(buf, "disabled s5 s5_s4 [unknown]\n"); in show_deepsleep_status()
929 if (strcmp(buf, "disabled\n") == 0) in toggle_deepsleep()
935 pr_debug("alienware-wmi: setting deep sleep to %d : %s", args.arg, buf); in toggle_deepsleep()
941 pr_err("alienware-wmi: deep sleep control failed: results: %u\n", in toggle_deepsleep()
960 if (quirks->deepslp > 0) in remove_deepsleep()
961 sysfs_remove_group(&dev->dev.kobj, &deepsleep_attribute_group); in remove_deepsleep()
968 ret = sysfs_create_group(&dev->dev.kobj, &deepsleep_attribute_group); in create_deepsleep()
976 * - Provides thermal profile control through the Platform Profile API
1016 return -EIO; in wmax_thermal_information()
1019 return -EBADRQC; in wmax_thermal_information()
1040 return -EIO; in wmax_thermal_control()
1043 return -EBADRQC; in wmax_thermal_control()
1063 return -EIO; in wmax_game_shift_status()
1066 return -EOPNOTSUPP; in wmax_game_shift_status()
1089 return -ENODATA; in thermal_profile_get()
1100 if (quirks->gmode) { in thermal_profile_set()
1143 if (ret == -EIO) in create_thermal_profile()
1146 if (ret == -EBADRQC) in create_thermal_profile()
1160 return -ENODEV; in create_thermal_profile()
1162 if (quirks->gmode) { in create_thermal_profile()
1177 if (quirks->thermal) in remove_thermal_profile()
1190 pr_warn("alienware-wmi: No known WMI GUID found\n"); in alienware_wmi_init()
1191 return -ENODEV; in alienware_wmi_init()
1199 quirks->thermal = true; in alienware_wmi_init()
1202 if (quirks->thermal) in alienware_wmi_init()
1203 quirks->gmode = true; in alienware_wmi_init()
1211 platform_device = platform_device_alloc("alienware-wmi", PLATFORM_DEVID_NONE); in alienware_wmi_init()
1213 ret = -ENOMEM; in alienware_wmi_init()
1220 if (quirks->hdmi_mux > 0) { in alienware_wmi_init()
1226 if (quirks->amplifier > 0) { in alienware_wmi_init()
1232 if (quirks->deepslp > 0) { in alienware_wmi_init()
1238 if (quirks->thermal) { in alienware_wmi_init()
1244 if (quirks->num_zones > 0) { in alienware_wmi_init()