X86 platform drivers
 help / color / mirror / Atom feed
From: "Michał Kępień" <kernel@kempniu.pl>
To: Jonathan Woithe <jwoithe@just42.net>,
	Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 07/11] platform/x86: fujitsu-laptop: make disable_brightness_adjust a boolean
Date: Thu, 30 Mar 2017 12:35:05 +0200	[thread overview]
Message-ID: <20170330103509.32509-8-kernel@kempniu.pl> (raw)
In-Reply-To: <20170330103509.32509-1-kernel@kempniu.pl>

Due to the way the disable_brightness_adjust module parameter is
currently handled in acpi_fujitsu_bl_add(), it can only be set to either
0 or 1, which effectively makes it a boolean.  Emphasize that by
changing module parameter type to bool.  Do not announce parameter value
in a debug message as it can be dynamically changed via sysfs and its
current value can also be read from there.  Clean up module parameter
description.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
---
 drivers/platform/x86/fujitsu-laptop.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index d10fbb0ed95b..84c2bd55526f 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -147,7 +147,7 @@ struct fujitsu_bl {
 
 static struct fujitsu_bl *fujitsu_bl;
 static int use_alt_lcd_levels = -1;
-static int disable_brightness_adjust = -1;
+static bool disable_brightness_adjust;
 
 /* Device used to access hotkeys and other features on the laptop */
 struct fujitsu_laptop {
@@ -611,11 +611,6 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device)
 			pr_err("_INI Method failed\n");
 	}
 
-	/* do config (detect defaults) */
-	disable_brightness_adjust = disable_brightness_adjust == 1 ? 1 : 0;
-	vdbg_printk(FUJLAPTOP_DBG_INFO, "config: [adjust disable: %d]\n",
-		    disable_brightness_adjust);
-
 	if (get_max_brightness() <= 0)
 		fujitsu_bl->max_brightness = FUJITSU_LCD_N_LEVELS;
 	get_lcd_level();
@@ -654,7 +649,7 @@ static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event)
 	if (oldb == newb)
 		return;
 
-	if (disable_brightness_adjust != 1)
+	if (!disable_brightness_adjust)
 		set_lcd_level(newb);
 
 	sparse_keymap_report_event(input, oldb < newb, 1, true);
@@ -1149,8 +1144,8 @@ module_exit(fujitsu_cleanup);
 
 module_param(use_alt_lcd_levels, int, 0644);
 MODULE_PARM_DESC(use_alt_lcd_levels, "Interface used for setting LCD brightness level (-1 = auto, 0 = force SBLL, 1 = force SBL2)");
-module_param(disable_brightness_adjust, uint, 0644);
-MODULE_PARM_DESC(disable_brightness_adjust, "Disable brightness adjustment .");
+module_param(disable_brightness_adjust, bool, 0644);
+MODULE_PARM_DESC(disable_brightness_adjust, "Disable LCD brightness adjustment");
 #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
 module_param_named(debug, dbg_level, uint, 0644);
 MODULE_PARM_DESC(debug, "Sets debug level bit-mask");
-- 
2.12.1

  parent reply	other threads:[~2017-03-30 10:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 10:34 [PATCH 00/11] fujitsu-laptop: backlight cleanup Michał Kępień
2017-03-30 10:34 ` [PATCH 01/11] platform/x86: fujitsu-laptop: only handle backlight when appropriate Michał Kępień
2017-03-30 10:35 ` [PATCH 02/11] platform/x86: fujitsu-laptop: switch to a managed backlight device Michał Kępień
2017-03-30 10:35 ` [PATCH 03/11] platform/x86: fujitsu-laptop: merge set_lcd_level_alt() into set_lcd_level() Michał Kępień
2017-03-30 10:35 ` [PATCH 04/11] platform/x86: fujitsu-laptop: simplify set_lcd_level() Michał Kępień
2017-04-04  0:01   ` Darren Hart
2017-04-04  9:39     ` [PATCH 04+/11] " Michał Kępień
2017-04-04 15:44       ` Darren Hart
2017-03-30 10:35 ` [PATCH 05/11] platform/x86: fujitsu-laptop: sync brightness in set_lcd_level() Michał Kępień
2017-03-30 10:35 ` [PATCH 06/11] platform/x86: fujitsu-laptop: clean up use_alt_lcd_levels handling Michał Kępień
2017-03-30 10:35 ` Michał Kępień [this message]
2017-03-30 10:35 ` [PATCH 08/11] platform/x86: fujitsu-laptop: ignore errors when setting backlight power Michał Kępień
2017-03-30 10:35 ` [PATCH 09/11] platform/x86: fujitsu-laptop: do not log set_lcd_level() failures in bl_update_status() Michał Kępień
2017-03-30 10:35 ` [PATCH 10/11] platform/x86: fujitsu-laptop: account for backlight power when determining brightness Michał Kępień
2017-03-30 10:35 ` [PATCH 11/11] platform/x86: fujitsu-laptop: remove redundant fields from struct fujitsu_bl Michał Kępień
2017-04-04  1:16   ` Darren Hart
2017-04-04  1:18 ` [PATCH 00/11] fujitsu-laptop: backlight cleanup Darren Hart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170330103509.32509-8-kernel@kempniu.pl \
    --to=kernel@kempniu.pl \
    --cc=andy@infradead.org \
    --cc=dvhart@infradead.org \
    --cc=jwoithe@just42.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox