Received: by 10.223.185.116 with SMTP id b49csp244142wrg; Mon, 19 Feb 2018 21:26:49 -0800 (PST) X-Google-Smtp-Source: AH8x224Vls5sdvu2oFTjlnXHIkiXTduxuFr85nvr72bphgEe+ezNGlJ2c8LGwfZ2nB2PjE2ZIB6R X-Received: by 10.99.151.74 with SMTP id d10mr4974913pgo.249.1519104408902; Mon, 19 Feb 2018 21:26:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519104408; cv=none; d=google.com; s=arc-20160816; b=sAlLXEAwpP9RtQxux/D+yv8RMifyPFv2YxE0UUX3aH4CsOV+eeM27ZhknD1mmJ8FUB RhROikwa/4C2o2dlkHnZXoEp7n0KJgPXuaZJF/QFCecfAdCE/oB3XVOUJjcWPcw/DeCY lDUC3rMZXHfmG+rlNJrP0wyKjMjhYGdGBZyvHNzx1hWW9ICCSbpnNXQz4mUGnvqZYM7F kNzK+iLJU5CfXlDhMglYT+dgadwO+I5W1boE4qyk/zwv9l9H2JFPetce7Hs3bvIbsKVs avX+doNMrhM3SniwAVgDyLBeI0v3H13M8NQIYTUsqbBbN52e5JIPtC8ILp8/k9sfOXpI 7Uyg== 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=iIOmj6SdRDEovR7y6waiQ3kMoW3AjwZEcgkAuRv75Qo=; b=nyhS7N1wm66veerjJzIj+32nerSOWajhm/BOvxy8Y8X59hnDySSHcV+SweCCGpqYH4 NdByLL3Y5vxEDtTqtlX8R0hfmHnJB3VV3zqKW7ST4Q0xQiLnSHQf4YzmV3w79oaDcdVd n0487/LJJ1ne0QSki+lE3O5yQsJpC4vq/XQQTOD9tNypksgl/qq5Hu9zZz2ScYPJ1c0v k9rCMFyUZQyu4XzbrqCSgAr7P1HSoBpEtP4LRMW3XTtk8J0wYkm1rrdm3N3Pkzi95p+H AjJyXlyiG/N9/nCGweN7qG4BGCajO0NxLnJHUU7arCzKp+1CbtlQ9Q2UHRdsvcAsXQXO MOpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kempniu.pl header.s=google header.b=Rn0u/OFV; 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 s16-v6si5312091plr.109.2018.02.19.21.26.34; Mon, 19 Feb 2018 21:26:48 -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=Rn0u/OFV; 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 S1751367AbeBTFZm (ORCPT + 99 others); Tue, 20 Feb 2018 00:25:42 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33963 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbeBTFZJ (ORCPT ); Tue, 20 Feb 2018 00:25:09 -0500 Received: by mail-lf0-f66.google.com with SMTP id l191so2477230lfe.1 for ; Mon, 19 Feb 2018 21:25:08 -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=iIOmj6SdRDEovR7y6waiQ3kMoW3AjwZEcgkAuRv75Qo=; b=Rn0u/OFVMgBqxKwFoiTC9UjzEdaw4fdtalWMnjpdbJw66/INMZb7DIIx5X1BVmyeWG GhEeu5Evmy76UVOyzEqclVJBWTm8S5q1rLe7I2NgXnkvt1mRLICPk/KYW7yGrjv9aan6 QwnCJMp7YencbIiBySu3qbdF55N8f5wkfHdeo= 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=iIOmj6SdRDEovR7y6waiQ3kMoW3AjwZEcgkAuRv75Qo=; b=P5yQDdbXzoEx7Shqmwy1m1U2pmmBmJERBujTpmThu3TVETEMCMARWIPFMX1OHwhiT3 Yp3laHqOQ1kqg2X5wGr1YhgeUJclLK91ydtjbAiLks4ZFYP4+qdc2YHTgJzyHJQ8CO5o 2U1MIt59tl3JR6i+KioN0eUgLWeiI7ord8/nuemHipWKnL/fgiUAbD6PqdFnMxnamKyn KQcdNPL5vV2v+MMVk9fNRyKTfcut3QDCY6Hq1yDRBVaTun/C58IpTL+Qu++YzgLxKPLf P097UGw1sW5RdBQZKCWAwaeRc3vXUN0z83W6VmRYZ6PAhTXrt3LhAAEC+sX0mJ2vMlLK I6XA== X-Gm-Message-State: APf1xPADtnhgDlWb9/vcoFEkNJuab/nrFXpMni8rTiDL6Yxl+F5so5f7 K6GP0+ylhl42GtT54zLBAs5uUGx3 X-Received: by 10.46.77.197 with SMTP id c66mr8340568ljd.116.1519104307730; Mon, 19 Feb 2018 21:25:07 -0800 (PST) Received: from kmp-mobile.hq.kempniu.pl (kmp-mobile.hq.kempniu.pl. [2001:470:64df:111::1b01]) by smtp.googlemail.com with ESMTPSA id b27sm3978286ljb.84.2018.02.19.21.25.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 21:25:07 -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 v2 6/7] platform/x86: fujitsu-laptop: Define constants for backlight power control Date: Tue, 20 Feb 2018 06:24:53 +0100 Message-Id: <20180220052454.11134-7-kernel@kempniu.pl> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180220052454.11134-1-kernel@kempniu.pl> References: <20180220052454.11134-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 Use named constants instead of integers in call_fext_func() invocations related to backlight power control in order to more clearly convey the intent of each call. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 17779b8b7f30..6b0484cbdcf2 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -101,6 +101,11 @@ #define ECO_LED 0x10000 #define ECO_LED_ON 0x80000 +/* FUNC interface - backlight power control */ +#define BACKLIGHT_PARAM_POWER 0x4 +#define BACKLIGHT_OFF 0x3 +#define BACKLIGHT_ON 0x0 + /* Hotkey details */ #define KEY1_CODE 0x410 /* codes for the keys in the GIRB register */ #define KEY2_CODE 0x411 @@ -257,9 +262,11 @@ static int bl_update_status(struct backlight_device *b) if (fext) { if (b->props.power == FB_BLANK_POWERDOWN) - call_fext_func(fext, FUNC_BACKLIGHT, 0x1, 0x4, 0x3); + call_fext_func(fext, FUNC_BACKLIGHT, 0x1, + BACKLIGHT_PARAM_POWER, BACKLIGHT_OFF); else - call_fext_func(fext, FUNC_BACKLIGHT, 0x1, 0x4, 0x0); + call_fext_func(fext, FUNC_BACKLIGHT, 0x1, + BACKLIGHT_PARAM_POWER, BACKLIGHT_ON); } return set_lcd_level(device, b->props.brightness); @@ -818,7 +825,8 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) /* Sync backlight power status */ if (fujitsu_bl && fujitsu_bl->bl_device && acpi_video_get_backlight_type() == acpi_backlight_vendor) { - if (call_fext_func(fext, FUNC_BACKLIGHT, 0x2, 0x4, 0x0) == 3) + if (call_fext_func(fext, FUNC_BACKLIGHT, 0x2, + BACKLIGHT_PARAM_POWER, 0x0) == BACKLIGHT_OFF) fujitsu_bl->bl_device->props.power = FB_BLANK_POWERDOWN; else fujitsu_bl->bl_device->props.power = FB_BLANK_UNBLANK; -- 2.16.1