From 2c7eb248b1730950c24d3ad2374801178a9c8283 Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Thu, 3 Dec 2020 12:10:07 +0100 Subject: [PATCH] clevo_interfaces: debug modifications & clarifications --- src/clevo_acpi.c | 10 +++++----- src/clevo_keyboard.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/clevo_acpi.c b/src/clevo_acpi.c index 9c1a5a1..ca7135d 100644 --- a/src/clevo_acpi.c +++ b/src/clevo_acpi.c @@ -48,7 +48,6 @@ static u32 clevo_acpi_evaluate(struct acpi_device *device, u8 cmd, u32 arg, u32 if (handle == NULL) return -ENODEV; - pr_debug("evaluate _DSM cmd: %0#4x arg: %0#10x\n", cmd, arg); out_obj = acpi_evaluate_dsm(handle, &clevo_acpi_dsm_uuid, dsm_rev_dummy, dsm_func, &dsm_argv4); if (!out_obj) { pr_err("failed to evaluate _DSM\n"); @@ -57,6 +56,7 @@ static u32 clevo_acpi_evaluate(struct acpi_device *device, u8 cmd, u32 arg, u32 if (out_obj->type == ACPI_TYPE_INTEGER) { if (!IS_ERR_OR_NULL(result)) *result = (u32) out_obj->integer.value; + pr_debug("evaluate _DSM cmd: %0#4x arg: %0#10x\n", cmd, arg); } else { pr_err("unknown output from _DSM\n"); status = -ENODATA; @@ -79,7 +79,7 @@ u32 clevo_acpi_interface_method_call(u8 cmd, u32 arg, u32 *result_value) pr_err("..for method_call: %0#4x arg: %0#10x\n", cmd, arg); status = -ENODATA; } - pr_debug("method_call: %0#4x arg: %0#10x result: %0#10x\n", cmd, arg, !IS_ERR_OR_NULL(result_value) ? *result_value : 0); + // pr_debug("clevo_acpi method_call: %0#4x arg: %0#10x result: %0#10x\n", cmd, arg, !IS_ERR_OR_NULL(result_value) ? *result_value : 0); return status; } @@ -102,7 +102,7 @@ static int clevo_acpi_add(struct acpi_device *device) active_driver_data = driver_data; - pr_debug("acpi add\n"); + pr_debug("clevo_acpi driver add\n"); // Initiate clevo keyboard, if not already loaded by other interface driver clevo_keyboard_init(); @@ -115,7 +115,7 @@ static int clevo_acpi_add(struct acpi_device *device) static int clevo_acpi_remove(struct acpi_device *device) { - pr_debug("acpi remove\n"); + pr_debug("clevo_acpi driver remove\n"); clevo_keyboard_remove_interface(&clevo_acpi_interface); active_driver_data = NULL; return 0; @@ -124,7 +124,7 @@ static int clevo_acpi_remove(struct acpi_device *device) void clevo_acpi_notify(struct acpi_device *device, u32 event) { struct clevo_acpi_driver_data_t *clevo_acpi_driver_data; - pr_debug("event: %0#10x\n", event); + pr_debug("clevo_acpi event: %0#10x\n", event); // clevo_acpi_driver_data = container_of(&device, struct clevo_acpi_driver_data_t, adev); if (!IS_ERR_OR_NULL(clevo_acpi_interface.event_callb)) { diff --git a/src/clevo_keyboard.h b/src/clevo_keyboard.h index 20c6c3f..eabedbf 100644 --- a/src/clevo_keyboard.h +++ b/src/clevo_keyboard.h @@ -296,7 +296,6 @@ static u32 clevo_evaluate_method(u8 cmd, u32 arg, u32 *result) pr_err("clevo_keyboard: no active interface\n"); return -ENODEV; } - TUXEDO_DEBUG("evaluate method\n"); return active_clevo_interface->method_call(cmd, arg, result); } @@ -308,7 +307,7 @@ static int evaluate_wmi_method_clevo(u32 submethod_id, u32 submethod_arg, u32 * acpi_status status; u32 wmi_output; - TUXEDO_DEBUG("evaluate wmi method: %0#4x IN : %0#6x\n", submethod_id, submethod_arg); + // TUXEDO_DEBUG("evaluate wmi method: %0#4x IN : %0#6x\n", submethod_id, submethod_arg); status = wmi_evaluate_method(CLEVO_GET_GUID, 0x00, submethod_id, &acpi_input, &acpi_output); @@ -597,10 +596,11 @@ static int brightness_validator(const char *value, void clevo_keyboard_event_callb(u32 event) { u32 key_event; - TUXEDO_DEBUG("event callback: (%0#10x)\n", event); clevo_evaluate_method(WMI_SUBMETHOD_ID_GET_EVENT, 0, &key_event); - TUXEDO_DEBUG("clevo event (%0#6x)\n", key_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) { case WMI_KEYEVENT_CODE_DECREASE_BACKLIGHT: