From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: rfkill rewrite bug
Date: Mon, 20 Apr 2009 09:33:42 +0100 [thread overview]
Message-ID: <49EC3366.7080206@tuffmail.co.uk> (raw)
In-Reply-To: <1240077571.25100.3.camel@johannes.local>
Johannes Berg wrote:
> On Sat, 2009-04-18 at 18:42 +0100, Alan Jenkins wrote:
>
>
>>> That's odd, I thought I added a set_sw_state() to rfkill which would
>>> disable that rfkill. But there's rfkill_set_global_sw_state() which
>>> should do what you want -- can you try replacing the EEE set_sw_state
>>> call with that?
>>>
>
>
>> Yes, that fixes it. Now it works the same as the old code which used
>> rfkill_set_default().
>>
>
> Cool.
>
>
>> +static int eeepc_hotk_resume(struct acpi_device *device);
>>
>> static const struct acpi_device_id eeepc_device_ids[] = {
>> {EEEPC_HOTK_HID, 0},
>> @@ -191,6 +192,7 @@ static struct acpi_driver eeepc_hotk_driver = {
>> .ops = {
>> .add = eeepc_hotk_add,
>> .remove = eeepc_hotk_remove,
>> + .resume = eeepc_hotk_resume
>>
>
> Please add a , at the end so other people updating that in the future
> don't need to change that line too.
>
>
>> +static void eeepc_rfkill_hotplug()
>>
>
> Need (void) not ()
>
> If you change those and give me a S-o-b I'll integrate it into my patch
> with something like
>
> S-o-b: <you> [eeepc driver parts]
>
>
> johannes
Ok, revised patch is below. Don't forget the set_sw_state() ->
set_global_sw_state() change; I didn't include that.
Note that there other pending changes to the rfkill code in eeepc-laptop.
"[PATCH] eee-laptop: Register as a pci-hotplug device"
<http://thread.gmane.org/gmane.linux.kernel/791730/focus=38724>
"[PATCH] eeepc-laptop: Work around rfkill firmware bug"
<http://thread.gmane.org/gmane.linux.acpi.devel/38424>
The second is mine; sorry for not warning about it sooner. So you/we
probably need to co-ordinate with the maintainer. I'd CC linux-acpi,
because that's where most platform driver changes are submitted.
---
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 0e7a946..10366b2 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -177,6 +177,7 @@ static struct key_entry eeepc_keymap[] = {
*/
static int eeepc_hotk_add(struct acpi_device *device);
static int eeepc_hotk_remove(struct acpi_device *device, int type);
+static int eeepc_hotk_resume(struct acpi_device *device);
static const struct acpi_device_id eeepc_device_ids[] = {
{EEEPC_HOTK_HID, 0},
@@ -191,6 +192,7 @@ static struct acpi_driver eeepc_hotk_driver = {
.ops = {
.add = eeepc_hotk_add,
.remove = eeepc_hotk_remove,
+ .resume = eeepc_hotk_resume,
},
};
@@ -495,14 +497,11 @@ static void notify_brn(void)
bd->props.brightness = read_brightness(bd);
}
-static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
+static void eeepc_rfkill_hotplug(void)
{
struct pci_dev *dev;
struct pci_bus *bus = pci_find_bus(0, 1);
- if (event != ACPI_NOTIFY_BUS_CHECK)
- return;
-
if (!bus) {
printk(EEEPC_WARNING "Unable to find PCI bus 1?\n");
return;
@@ -530,6 +529,14 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
}
}
+static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
+{
+ if (event != ACPI_NOTIFY_BUS_CHECK)
+ return;
+
+ eeepc_rfkill_hotplug();
+}
+
static void eeepc_hotk_notify(acpi_handle handle, u32 event, void *data)
{
static struct key_entry *key;
@@ -695,6 +702,22 @@ static int eeepc_hotk_remove(struct acpi_device *device, int type)
return 0;
}
+static int eeepc_hotk_resume(struct acpi_device *device)
+{
+ if (ehotk->eeepc_wlan_rfkill) {
+ rfkill_set_sw_state(ehotk->eeepc_wlan_rfkill,
+ get_acpi(CM_ASL_WLAN) != 1);
+
+ eeepc_rfkill_hotplug();
+ }
+
+ if (ehotk->eeepc_bluetooth_rfkill)
+ rfkill_set_sw_state(ehotk->eeepc_bluetooth_rfkill,
+ get_acpi(CM_ASL_BLUETOOTH) != 1);
+
+ return 0;
+}
+
/*
* Hwmon
*/
next prev parent reply other threads:[~2009-04-20 8:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-08 13:37 [PATCH] rfkill: document removal of notifier chain Alan Jenkins
2009-04-08 15:21 ` Johannes Berg
2009-04-08 17:21 ` Alan Jenkins
2009-04-13 19:00 ` rfkill rewrite bug Alan Jenkins
2009-04-13 18:56 ` Johannes Berg
2009-04-14 20:46 ` Johannes Berg
2009-04-18 8:17 ` Alan Jenkins
2009-04-18 8:15 ` Johannes Berg
2009-04-18 8:28 ` Johannes Berg
2009-04-18 9:43 ` Alan Jenkins
2009-04-18 12:24 ` Johannes Berg
2009-04-18 13:29 ` Rfkill rewrite: eeepc-laptop resume Alan Jenkins
2009-04-18 13:33 ` Johannes Berg
2009-04-18 14:02 ` Alan Jenkins
2009-04-18 14:10 ` Johannes Berg
2009-04-18 15:49 ` rfkill rewrite bug Alan Jenkins
2009-04-18 15:57 ` Johannes Berg
2009-04-18 17:48 ` Alan Jenkins
2009-04-18 17:57 ` Johannes Berg
2009-04-18 18:03 ` Alan Jenkins
2009-04-18 17:42 ` Alan Jenkins
2009-04-18 17:59 ` Johannes Berg
2009-04-20 8:33 ` Alan Jenkins [this message]
2009-04-20 8:44 ` Johannes Berg
2009-04-20 9:20 ` Alan Jenkins
2009-04-20 11:28 ` Johannes Berg
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=49EC3366.7080206@tuffmail.co.uk \
--to=alan-jenkins@tuffmail.co.uk \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@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.