From patchwork Sun Feb 11 21:07:26 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: 10211505 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 84739602CB for ; Sun, 11 Feb 2018 21:08:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7415B287FE for ; Sun, 11 Feb 2018 21:08:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 675052881A; Sun, 11 Feb 2018 21:08:00 +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 1B689287FE for ; Sun, 11 Feb 2018 21:08:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932228AbeBKVHr (ORCPT ); Sun, 11 Feb 2018 16:07:47 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:44088 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932205AbeBKVHp (ORCPT ); Sun, 11 Feb 2018 16:07:45 -0500 Received: by mail-lf0-f66.google.com with SMTP id c188so2015739lfc.11 for ; Sun, 11 Feb 2018 13:07:44 -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=FXD/CE7gKeCFGYYKvYoellN/bom098S5+keJ7hKZj60=; b=mKlqeyzq5vdLArQjR/604YuT0UDRzokY/42FUeA/aOoGJfmmVNomfSmblFGp8AHI31 h1JPm1PzVKNA5P/vBdBTr7r341JQlkAF9l7JMDB7gUIFlqw8oWZussSTbgQzu01oFrsv 3Hlz2VDu7oLmOeFHEIUfulDwYalujlD8dl3tQ= 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=FXD/CE7gKeCFGYYKvYoellN/bom098S5+keJ7hKZj60=; b=B+QHujKLkoD5k77BKKWcD+ZbNlW3X4hMqnvrDN7ELYm6wmW7795ypz7IEASi4YOKJd aCNGXQsVVdwH1PDivHDXDWO1vd4/Scp6ZFsYwt+ID6wy+3QgpBY9DlmusIiYG0O8a4V3 tGI5lQLCw6Z8SJQkwHN0mTW1z7wDoCF+6eGvGSEyjIyGOP6knBw/gC8GubfEACDroiDa h4+EZoBj+lKKeE+vhcVpRgvhATYFQRZiOHUVEheVYglISJDnh432/xEvBZMuKFWEvBQV zomwx+580rfF2WJph4u+jooaaO3IMuFD1KQDB5baM+YZd7Dn/zaodtCpgjRVUP5QlvvN 9qAg== X-Gm-Message-State: APf1xPBHSfL7wrVOS48aHl+4zRFSgj4jzf36hFw/ZOxtwPP//iLaZUdK n/vrYzMdJkPzwcm1l3h8FAl3eg== X-Google-Smtp-Source: AH8x227E5JcCCFEHc2DV8g8S0Uis5KpRrHWzOF94sPmLhfdfU7LaF1Pr1Gnmbgpd8ch0brInmdRUyg== X-Received: by 10.25.235.91 with SMTP id j88mr1491355lfh.20.1518383263676; Sun, 11 Feb 2018 13:07:43 -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 y198sm1390477lfd.62.2018.02.11.13.07.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 13:07:42 -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 6/7] platform/x86: fujitsu-laptop: Define constants for backlight power control Date: Sun, 11 Feb 2018 22:07:26 +0100 Message-Id: <20180211210727.12130-7-kernel@kempniu.pl> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180211210727.12130-1-kernel@kempniu.pl> References: <20180211210727.12130-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..0ee03d1fcbc4 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_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_POWER, BACKLIGHT_OFF); else - call_fext_func(fext, FUNC_BACKLIGHT, 0x1, 0x4, 0x0); + call_fext_func(fext, FUNC_BACKLIGHT, 0x1, + BACKLIGHT_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_POWER, + 0x0) == 3) fujitsu_bl->bl_device->props.power = FB_BLANK_POWERDOWN; else fujitsu_bl->bl_device->props.power = FB_BLANK_UNBLANK;