summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorBarnabás Pőcze <pobrn@protonmail.com>2021-02-04 00:56:34 +0300
committerHans de Goede <hdegoede@redhat.com>2021-02-04 12:21:22 +0300
commit7553390d4b7e636d9be7913b16f4b9ae8b75df4c (patch)
tree7ce6c4f4b828b1468678ae9a4b8ad78557d30464 /drivers/platform
parentb3ed1b7fe3786c8fe795c16ca07cf3bda67b652f (diff)
downloadlinux-7553390d4b7e636d9be7913b16f4b9ae8b75df4c.tar.xz
platform/x86: ideapad-laptop: change 'status' debugfs file format
Remove conservation mode reporting since it is already reported via the appropriate device attribute, and its state can be deduced from the value of GBMD. Add the return value of the GBMD and HALS ACPI methods to the output. Use seq_puts() where possible. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-22-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/ideapad-laptop.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index f3d950c7fc01..c26941cb8f9d 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -285,40 +285,33 @@ static int debugfs_status_show(struct seq_file *s, void *data)
unsigned long value;
if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL_MAX, &value))
- seq_printf(s, "Backlight max:\t%lu\n", value);
+ seq_printf(s, "Backlight max: %lu\n", value);
if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL, &value))
- seq_printf(s, "Backlight now:\t%lu\n", value);
+ seq_printf(s, "Backlight now: %lu\n", value);
if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL_POWER, &value))
- seq_printf(s, "BL power value:\t%s\n", value ? "On" : "Off");
- seq_printf(s, "=====================\n");
+ seq_printf(s, "BL power value: %s (%lu)\n", value ? "on" : "off", value);
+ seq_puts(s, "=====================\n");
if (!read_ec_data(priv->adev->handle, VPCCMD_R_RF, &value))
- seq_printf(s, "Radio status:\t%s(%lu)\n",
- value ? "On" : "Off", value);
+ seq_printf(s, "Radio status: %s (%lu)\n", value ? "on" : "off", value);
if (!read_ec_data(priv->adev->handle, VPCCMD_R_WIFI, &value))
- seq_printf(s, "Wifi status:\t%s(%lu)\n",
- value ? "On" : "Off", value);
+ seq_printf(s, "Wifi status: %s (%lu)\n", value ? "on" : "off", value);
if (!read_ec_data(priv->adev->handle, VPCCMD_R_BT, &value))
- seq_printf(s, "BT status:\t%s(%lu)\n",
- value ? "On" : "Off", value);
+ seq_printf(s, "BT status: %s (%lu)\n", value ? "on" : "off", value);
if (!read_ec_data(priv->adev->handle, VPCCMD_R_3G, &value))
- seq_printf(s, "3G status:\t%s(%lu)\n",
- value ? "On" : "Off", value);
- seq_printf(s, "=====================\n");
+ seq_printf(s, "3G status: %s (%lu)\n", value ? "on" : "off", value);
+ seq_puts(s, "=====================\n");
if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value))
- seq_printf(s, "Touchpad status:%s(%lu)\n",
- value ? "On" : "Off", value);
+ seq_printf(s, "Touchpad status: %s (%lu)\n", value ? "on" : "off", value);
if (!read_ec_data(priv->adev->handle, VPCCMD_R_CAMERA, &value))
- seq_printf(s, "Camera status:\t%s(%lu)\n",
- value ? "On" : "Off", value);
+ seq_printf(s, "Camera status: %s (%lu)\n", value ? "on" : "off", value);
seq_puts(s, "=====================\n");
- if (!eval_gbmd(priv->adev->handle, &value)) {
- seq_printf(s, "Conservation mode:\t%s(%lu)\n",
- test_bit(GBMD_CONSERVATION_STATE_BIT, &value) ? "On" : "Off",
- value);
- }
+ if (!eval_gbmd(priv->adev->handle, &value))
+ seq_printf(s, "GBMD: %#010lx\n", value);
+ if (!eval_hals(priv->adev->handle, &value))
+ seq_printf(s, "HALS: %#010lx\n", value);
return 0;
}