clevo_interfaces: Change event handling & use separate wmi module

This commit is contained in:
Christoffer Sandberg 2020-12-04 13:14:46 +01:00
parent bbc29f39fc
commit 14c37444e6
No known key found for this signature in database
GPG key ID: BF563F71B6C7A96D
3 changed files with 9 additions and 8 deletions

View file

@ -129,6 +129,8 @@ static int clevo_acpi_add(struct acpi_device *device)
// Add this interface // Add this interface
clevo_keyboard_add_interface(&clevo_acpi_interface); clevo_keyboard_add_interface(&clevo_acpi_interface);
pr_info("clevo_acpi: interface initialized\n");
return 0; return 0;
} }
@ -142,8 +144,11 @@ static int clevo_acpi_remove(struct acpi_device *device)
void clevo_acpi_notify(struct acpi_device *device, u32 event) void clevo_acpi_notify(struct acpi_device *device, u32 event)
{ {
struct clevo_acpi_driver_data_t *clevo_acpi_driver_data; u32 event_value;
pr_debug("clevo_acpi event: %0#10x\n", event); // struct clevo_acpi_driver_data_t *clevo_acpi_driver_data;
clevo_acpi_evaluate(device, 0x01, 0, &event_value);
pr_debug("clevo_acpi event: %0#6x, clevo event value: %0#6x\n", event, event_value);
// clevo_acpi_driver_data = container_of(&device, struct clevo_acpi_driver_data_t, adev); // clevo_acpi_driver_data = container_of(&device, struct clevo_acpi_driver_data_t, adev);
if (!IS_ERR_OR_NULL(clevo_acpi_interface.event_callb)) { if (!IS_ERR_OR_NULL(clevo_acpi_interface.event_callb)) {

View file

@ -595,12 +595,9 @@ static int brightness_validator(const char *value,
void clevo_keyboard_event_callb(u32 event) void clevo_keyboard_event_callb(u32 event)
{ {
u32 key_event; u32 key_event = event;
clevo_evaluate_method(WMI_SUBMETHOD_ID_GET_EVENT, 0, &key_event); // TUXEDO_DEBUG("clevo event: %0#6x\n", event);
// event = received notification value
// key_event = returned from clevo get event method
TUXEDO_DEBUG("clevo event -> event: %0#6x key_event: %0#6x\n", event, key_event);
switch (key_event) { switch (key_event) {
case WMI_KEYEVENT_CODE_DECREASE_BACKLIGHT: case WMI_KEYEVENT_CODE_DECREASE_BACKLIGHT:

View file

@ -39,7 +39,6 @@ MODULE_ALIAS("wmi:" UNIWILL_WMI_EVENT_GUID_2);
MODULE_SOFTDEP("pre: tuxedo-cc-wmi"); MODULE_SOFTDEP("pre: tuxedo-cc-wmi");
static struct tuxedo_keyboard_driver *driver_list[] = { static struct tuxedo_keyboard_driver *driver_list[] = {
&clevo_keyboard_driver,
&uniwill_keyboard_driver &uniwill_keyboard_driver
}; };