All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net,
	Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	Josip Rodin <joy+kernel@entuzijast.net>
Subject: [PATCH 2/8] thinkpad-acpi: log initial state of rfkill switches
Date: Tue, 15 Dec 2009 21:51:07 -0200	[thread overview]
Message-ID: <1260921073-7686-3-git-send-email-hmh@hmh.eng.br> (raw)
In-Reply-To: <1260921073-7686-1-git-send-email-hmh@hmh.eng.br>

We already log the initial state of the hardware rfkill switch (WLSW),
might as well log the state of the softswitches as well.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Josip Rodin <joy+kernel@entuzijast.net>
---
 drivers/platform/x86/thinkpad_acpi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 3daf349..05714ab 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1264,6 +1264,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,
 	struct tpacpi_rfk *atp_rfk;
 	int res;
 	bool sw_state = false;
+	bool hw_state;
 	int sw_status;
 
 	BUG_ON(id >= TPACPI_RFK_SW_MAX || tpacpi_rfkill_switches[id]);
@@ -1298,7 +1299,8 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,
 			rfkill_init_sw_state(atp_rfk->rfkill, sw_state);
 		}
 	}
-	rfkill_set_hw_state(atp_rfk->rfkill, tpacpi_rfk_check_hwblock_state());
+	hw_state = tpacpi_rfk_check_hwblock_state();
+	rfkill_set_hw_state(atp_rfk->rfkill, hw_state);
 
 	res = rfkill_register(atp_rfk->rfkill);
 	if (res < 0) {
@@ -1311,6 +1313,9 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,
 	}
 
 	tpacpi_rfkill_switches[id] = atp_rfk;
+
+	printk(TPACPI_INFO "rfkill switch %s: radio is %sblocked\n",
+		name, (sw_state || hw_state) ? "" : "un");
 	return 0;
 }
 
-- 
1.6.5.4


  parent reply	other threads:[~2009-12-15 23:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 23:51 [GIT PATCH] thinkpad-acpi second set of changes for 2.6.33 Henrique de Moraes Holschuh
2009-12-15 23:51 ` [PATCH 1/8] thinkpad-acpi: sync input device EV_SW initial state Henrique de Moraes Holschuh
2009-12-15 23:51 ` Henrique de Moraes Holschuh [this message]
2009-12-15 23:51 ` [PATCH 3/8] thinkpad-acpi: volume subdriver rewrite Henrique de Moraes Holschuh
2009-12-15 23:51 ` [PATCH 4/8] thinkpad-acpi: support MUTE-only ThinkPads Henrique de Moraes Holschuh
2009-12-15 23:51 ` [PATCH 5/8] thinkpad-acpi: disable volume control Henrique de Moraes Holschuh
2009-12-15 23:51 ` [PATCH 6/8] thinkpad-acpi: basic ALSA mixer support (v2) Henrique de Moraes Holschuh
2009-12-15 23:51 ` [PATCH 7/8] thinkpad-acpi: convert to seq_file Henrique de Moraes Holschuh
2009-12-15 23:51 ` [PATCH 8/8] thinkpad-acpi: bump version to 0.24 Henrique de Moraes Holschuh
2009-12-16  4:59 ` [GIT PATCH] thinkpad-acpi second set of changes for 2.6.33 Len Brown

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=1260921073-7686-3-git-send-email-hmh@hmh.eng.br \
    --to=hmh@hmh.eng.br \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=joy+kernel@entuzijast.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.