Received: by 10.223.185.116 with SMTP id b49csp5433146wrg; Tue, 27 Feb 2018 13:17:03 -0800 (PST) X-Google-Smtp-Source: AH8x226edHC8bfD1zQihkiJtPpSVHtwuRtEEcKRm/oG+axu5U0yXQ0srScbWTNptbWTIaogqWqqH X-Received: by 10.99.8.4 with SMTP id 4mr12408086pgi.289.1519766223246; Tue, 27 Feb 2018 13:17:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519766223; cv=none; d=google.com; s=arc-20160816; b=VrNGpGE5eyAeNF23PeAAxZes2JhiCBZCLH6QsqLzzRuqLkodOnSxOsJhbjvfEig+Jc hMkTEpIgjumWGp64inxoNI9FhPMDKz2RDhsGlgX2ExQh0HksPOIQMDB648U0yu1czgi7 /x5L57fT2fps+Q6LfQiO4DNKJnotbjhXU9MHklz2n6hcCZbERPciGYWmBOLbly/l+7dz WRfGTvVSBCmDbEUKkjW4ZGGpdltMfPOh6bBgdrH81RgHlqZVRF3ayCmRpSwScuyn40Le 2+QelDuJrVRy2Ybm7qzIU+W6HE0gw4MnQVM7ai28vmhRu92pLDcDxFQpkGpTIDmm5tfx h7wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=XRjoSTpxgGYh9NCSdPw9yJ6hW4sZDEK3qCAXg0oVfpg=; b=f4IqBie60M+tj8PozGTcjFXE4cR+7AjD6q7qFCoskU4sSeUMY3bPWMFKIciISUypBP VId13R8T0FbXaENq8mLWcmnOKDwPenlVGD71hbFaK8frW+Y6J1zao/xwByBQ75Y9Vzjq lR+cReCIbTlca32It2MhDt0KxCKgm0w3QqzBbT/xmOnr+oQ8HpRluDwkn3J/cyR4Dp90 OIkQTT6N3HwfKmWEY9lhGgB4NMXKAPBVYkIeQb6VxvIsPEg1LiAW287KPV0kRnS8SfMk M6iHmryXUYa9AbvAJ/jU0LRnGLoFsBdYzTSS/CHSZ6TI8jihj2d2REPCouJ8zubD20m6 DH7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kempniu.pl header.s=google header.b=OVRg5hsM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kempniu.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si47451pgs.323.2018.02.27.13.16.48; Tue, 27 Feb 2018 13:17:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kempniu.pl header.s=google header.b=OVRg5hsM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kempniu.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752085AbeB0VP6 (ORCPT + 99 others); Tue, 27 Feb 2018 16:15:58 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:39571 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751891AbeB0VPy (ORCPT ); Tue, 27 Feb 2018 16:15:54 -0500 Received: by mail-lf0-f67.google.com with SMTP id f75so365647lfg.6 for ; Tue, 27 Feb 2018 13:15:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XRjoSTpxgGYh9NCSdPw9yJ6hW4sZDEK3qCAXg0oVfpg=; b=OVRg5hsM3JHKfldnHVTUTu3JFJ0NAfPggwO5FJhTRh2bYF7TCIKOBLlACjtyP+Xw+e J6vylExLyvrjRMJl6KuutRlIF3m7L7UvUzlN7hFHOZmylGMpTLtGw0prDv7n28slQNMG l+1sb4YzW0jLgjoERg/m2yhJGQ0w9blmXHrbo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XRjoSTpxgGYh9NCSdPw9yJ6hW4sZDEK3qCAXg0oVfpg=; b=kFdHlNMO9N7adxLhmIjZGl/lqDs8PI7YytKl+r1lIYPbaMMxuextCUwLLMYJYva/aD z3P8BzpbmUedrg4z6zwPIaJHJ1Wh/fHpgp92O9ssn0lRb7Z9YzPc+kZ1ZKWGtjkYv2Jr h9Bu+9bc0Odh1VD12/VRtna5FSX0wdJEwLgT2QLz8AF/Dq13XWThN1B186zJDBuPhTB2 X/jZ0OOWTIE6KfVZaIsq0rfhJawGb1ZGLDfMARdG9tpI7cEhy89N4jf5xXJqMmZd1Zxt tZfwLyTHedp3mRsriusoRAILCVCfwlcKbfSJE5dj4rzytrlWOdvNWksyrGnGVtrYasgS dS0Q== X-Gm-Message-State: APf1xPBLc1Mkut3fhEAZFxkWNgqeUZXeEgDGLXELaVB8Xs7Cu8fm9uJf ZYIZCaWT835flc71GRBvfx/+sg== X-Received: by 10.46.23.219 with SMTP id 88mr11402527ljx.49.1519766152420; Tue, 27 Feb 2018 13:15:52 -0800 (PST) Received: from kmp-mobile.hq.kempniu.pl (kmp-mobile.hq.kempniu.pl. [2001:470:64df:111::d0d7]) by smtp.googlemail.com with ESMTPSA id l5sm16288lje.58.2018.02.27.13.15.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 13:15:51 -0800 (PST) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Jonathan Woithe , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] platform/x86: fujitsu-laptop: Tweak how constants are commented and laid out Date: Tue, 27 Feb 2018 22:15:37 +0100 Message-Id: <20180227211539.5708-6-kernel@kempniu.pl> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180227211539.5708-1-kernel@kempniu.pl> References: <20180227211539.5708-1-kernel@kempniu.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update comments used for each group of constants to better reflect their current purpose. Ensure the layout of groups of constants follows the order in which call_fext_func() takes its arguments. Use alphabetic ordering for groups of constants. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 55 +++++++++++++++++------------------ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 5f8c89155b51..5acf1ccc6864 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -78,15 +78,15 @@ #define ACPI_FUJITSU_NOTIFY_CODE 0x80 -/* FUNC interface - command values */ -#define FUNC_FLAGS BIT(12) -#define FUNC_LEDS (BIT(12) | BIT(0)) -#define FUNC_BUTTONS (BIT(12) | BIT(1)) -#define FUNC_BACKLIGHT (BIT(12) | BIT(2)) - /* FUNC interface - responses */ #define UNSUPPORTED_CMD BIT(31) +/* FUNC interface - function selectors */ +#define FUNC_BACKLIGHT (BIT(12) | BIT(2)) +#define FUNC_BUTTONS (BIT(12) | BIT(1)) +#define FUNC_FLAGS BIT(12) +#define FUNC_LEDS (BIT(12) | BIT(0)) + /* FUNC interface - operations */ #define OP_GET BIT(1) #define OP_GET_CAPS 0 @@ -95,41 +95,40 @@ #define OP_SET BIT(0) #define OP_SET_EXT (BIT(2) | BIT(0)) -/* FUNC interface - status flags */ -#define FLAG_RFKILL BIT(5) -#define FLAG_LID BIT(8) -#define FLAG_DOCK BIT(9) - -/* FUNC interface - LED control */ -#define STATE_LED_OFF BIT(0) -#define STATE_LED_ON (BIT(0) | BIT(16) | BIT(17)) -#define FEAT_LOGOLAMP_POWERON BIT(13) -#define FEAT_LOGOLAMP_ALWAYS BIT(14) -#define FEAT_KEYBOARD_LAMPS BIT(8) - -#define FEAT_RADIO_LED BIT(5) -#define STATE_RADIO_LED_OFF 0 -#define STATE_RADIO_LED_ON BIT(5) - -#define FEAT_ECO_LED BIT(16) -#define STATE_ECO_LED_ON BIT(19) - -/* FUNC interface - backlight power control */ +/* Constants related to FUNC_BACKLIGHT */ #define FEAT_BACKLIGHT_POWER BIT(2) #define STATE_BACKLIGHT_OFF (BIT(0) | BIT(1)) #define STATE_BACKLIGHT_ON 0 -/* Scancodes read from the GIRB register */ +/* Constants related to FUNC_BUTTONS */ #define EVENT_HK1 0x410 #define EVENT_HK2 0x411 #define EVENT_HK3 0x412 #define EVENT_HK4 0x413 #define EVENT_HK5 0x420 -/* Hotkey ringbuffer limits */ #define MAX_HOTKEY_RINGBUFFER_SIZE 100 #define RINGBUFFERSIZE 40 +/* Constant related to FUNC_FLAGS */ +#define FLAG_DOCK BIT(9) +#define FLAG_LID BIT(8) +#define FLAG_RFKILL BIT(5) + +/* Constants related to FUNC_LEDS */ +#define FEAT_KEYBOARD_LAMPS BIT(8) +#define FEAT_LOGOLAMP_ALWAYS BIT(14) +#define FEAT_LOGOLAMP_POWERON BIT(13) +#define STATE_LED_OFF BIT(0) +#define STATE_LED_ON (BIT(0) | BIT(16) | BIT(17)) + +#define FEAT_RADIO_LED BIT(5) +#define STATE_RADIO_LED_OFF 0 +#define STATE_RADIO_LED_ON BIT(5) + +#define FEAT_ECO_LED BIT(16) +#define STATE_ECO_LED_ON BIT(19) + /* Module parameters */ static int use_alt_lcd_levels = -1; static bool disable_brightness_adjust; -- 2.16.2