From patchwork Wed Feb 3 21:56:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 12065511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50264C433DB for ; Wed, 3 Feb 2021 21:57:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 11E3164E4E for ; Wed, 3 Feb 2021 21:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232489AbhBCV5X (ORCPT ); Wed, 3 Feb 2021 16:57:23 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:60287 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232437AbhBCV5T (ORCPT ); Wed, 3 Feb 2021 16:57:19 -0500 Date: Wed, 03 Feb 2021 21:56:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1612389396; bh=C1CXhYIg7zEljs/5GMK80XZju6QJkZ3iED1hMTJ9fmI=; h=Date:To:From:Reply-To:Subject:From; b=g5+H2ycq077PB8GrP0eHGN+PmK/Mbq2SJqGXe4NGHOW279BNza0WGgeaLBfHR8EaB d2ZS0+n/+W1ceRZumAZyDtBA2EFoVCCuuweD0X1rMeicNUVpYjY8iVBR8oYyVcS0vR 7KQLXm2l7Cfrb+ZfVQUr24gI3g5OuOekdchFk9DE= To: platform-driver-x86@vger.kernel.org, Hans de Goede , Mark Gross , Ike Panhc , Andy Shevchenko From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Reply-To: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH v3 21/29] platform/x86: ideapad-laptop: change 'status' debugfs file format Message-ID: <20210203215403.290792-22-pobrn@protonmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org 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 diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index abb283cee47c..34e93ac83d8e 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -286,40 +286,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; }