From patchwork Tue Feb 20 05:24:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= X-Patchwork-Id: 10229407 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 46A01602DC for ; Tue, 20 Feb 2018 05:25:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37C4826E97 for ; Tue, 20 Feb 2018 05:25:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C293283A5; Tue, 20 Feb 2018 05:25:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F295A26E97 for ; Tue, 20 Feb 2018 05:25:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751274AbeBTFZ2 (ORCPT ); Tue, 20 Feb 2018 00:25:28 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33005 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751273AbeBTFZJ (ORCPT ); Tue, 20 Feb 2018 00:25:09 -0500 Received: by mail-lf0-f65.google.com with SMTP id j193so2473476lfe.0 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=Jhpe7sXl/MBKWdC3XYrrQBQOn2Ok6aJjOUNRA8ctEpi+fOr32j+ztrmvyCVyzZXv9/ 6BAtEV/2rSAziT9mixWZBjk2GqZMDWyZHwG92+Xj/7qlk2Ac6cyxQ4CqgApBryIaWh1r o8/HdUrWo5xviy+JuWGxfQIL5JHtiGE5x7d3cLhL6LE2t5mrvfC93oDQHzsGAFniXRu5 eWv6p2TiKOVN8p0vhn3XIlV+E3d/vQmcojWjgxpR0hhLXqdjnGfMtdT1wT/U5yi/7wjL 3//5YCs3OO8OAcZzWHz1lbvkNGOPobYundJhWsJ1kN2i28ZiS98S/HS6vGbFRrMeVRLf gSEw== X-Gm-Message-State: APf1xPAaLU7IRGvlcqQsfIBO7ylArucAB9aqbbo91xHM4cIJ805kT56b fiDFRgmWRH/9w1ltN5L5He1Q/A== X-Google-Smtp-Source: AH8x227ZPjr7yi7eIUZ9qyUhm8jziA7emWdlGLURJc9B3bsmD/vdZfMlszWQnkL8paKZQKDGj30lXw== 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 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;