[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180524133231.8433-1-ezhi99@gmail.com>
Date: Thu, 24 May 2018 16:32:31 +0300
From: Oleg Keri <ezhi99@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Oleg Keri <ezhi99@...il.com>, Ike Panhc <ike.pan@...onical.com>,
Darren Hart <dvhart@...radead.org>,
Andy Shevchenko <andy@...radead.org>,
platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] platform/x86: ideapad-laptop: Fix rfkill invert
There are a lot of reports on the Internet about rfkill lock on
modern Yoga Ideapad laptops while loading ideapad_laptop platform module.
This patch offers the fix. Obviously it's impossible for me
to test this patch on all ideapad laptops, so i've made an module
parameter init_rfkill_inverted to keep old behavior. Comments are
welcome.
Signed-off-by: Oleg Keri <ezhi99@...il.com>
---
drivers/platform/x86/ideapad-laptop.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 535199c9e6bc..1eeda7bc74a3 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -110,6 +110,10 @@ static bool no_bt_rfkill;
module_param(no_bt_rfkill, bool, 0444);
MODULE_PARM_DESC(no_bt_rfkill, "No rfkill for bluetooth.");
+static bool init_rfkill_inverted;
+module_param(init_rfkill_inverted, bool, 0444);
+MODULE_PARM_DESC(init_rfkill_inverted, "Invert rfkill on initialization");
+
/*
* ACPI Helpers
*/
@@ -604,7 +608,9 @@ static int ideapad_register_rfkill(struct ideapad_private *priv, int dev)
&sw_blocked)) {
rfkill_init_sw_state(priv->rfk[dev], 0);
} else {
- sw_blocked = !sw_blocked;
+ /* Do not apply invert for ideapads which haven't hw switch */
+ if (priv->has_hw_rfkill_switch || init_rfkill_inverted)
+ sw_blocked = !sw_blocked;
rfkill_init_sw_state(priv->rfk[dev], sw_blocked);
}
--
2.17.0
Powered by blists - more mailing lists