linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the wireless tree with the acpi tree
@ 2009-06-03  2:20 Stephen Rothwell
  2009-06-03  3:03 ` Matthew Garrett
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2009-06-03  2:20 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-next, linux-kernel, Johannes Berg, Matthew Garrett, Len Brown

Hi John,

Today's linux-next merge of the wireless tree got a conflict in
drivers/platform/x86/Kconfig between commit
eedd8dca3c0e6c1fcb5cba11321ea9d69917d85b ("eeepc-laptop: Register as a
pci-hotplug device") from the acpi tree and commit
c6d660ce29295d344fcdc3654274b4a0aad1a9c8 ("rfkill: rewrite") from the
wireless tree.

Just context changes.  I fixed it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/platform/x86/Kconfig
index 58f1c7a,c682ac5..0000000
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@@ -352,10 -337,9 +351,10 @@@ config EEEPC_LAPTO
  	depends on ACPI
  	depends on INPUT
  	depends on EXPERIMENTAL
+ 	depends on RFKILL || RFKILL = n
  	select BACKLIGHT_CLASS_DEVICE
  	select HWMON
- 	select RFKILL
 +	select HOTPLUG_PCI
  	---help---
  	  This driver supports the Fn-Fx keys on Eee PC laptops.
  	  It also adds the ability to switch camera/wlan on/off.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the wireless tree with the acpi tree
  2009-06-03  2:20 linux-next: manual merge of the wireless tree with the acpi tree Stephen Rothwell
@ 2009-06-03  3:03 ` Matthew Garrett
  0 siblings, 0 replies; 6+ messages in thread
From: Matthew Garrett @ 2009-06-03  3:03 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: John W. Linville, linux-next, linux-kernel, Johannes Berg, Len Brown

On Wed, Jun 03, 2009 at 12:20:46PM +1000, Stephen Rothwell wrote:
> Hi John,
> 
> Today's linux-next merge of the wireless tree got a conflict in
> drivers/platform/x86/Kconfig between commit
> eedd8dca3c0e6c1fcb5cba11321ea9d69917d85b ("eeepc-laptop: Register as a
> pci-hotplug device") from the acpi tree and commit
> c6d660ce29295d344fcdc3654274b4a0aad1a9c8 ("rfkill: rewrite") from the
> wireless tree.
> 
> Just context changes.  I fixed it up (see below) and can carry the fix as
> necessary.

Patch looks fine.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* linux-next: manual merge of the wireless tree with the acpi tree
@ 2009-06-18  1:29 Stephen Rothwell
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2009-06-18  1:29 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-next, linux-kernel, Bjorn Helgaas, Matthew Garrett,
	Len Brown, Alan Jenkins

Hi John,

Today's linux-next merge of the wireless tree got conflicts in
drivers/platform/x86/eeepc-laptop.c between commits
eedd8dca3c0e6c1fcb5cba11321ea9d69917d85b ("eeepc-laptop: Register as a
pci-hotplug device") and 9f4b0f13e8346a42178d70b5079f46f7f886d13c ("ACPI:
eeepc-laptop: use .notify method instead of installing handler directly")
from the acpi tree and commit 372b1630720763fe276bd4ad439fa4799ed2112e
("eeepc-laptop: read rfkill soft-blocked state on resume") from the
wireless tree.

I fixed it up (see below - worth checking) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/platform/x86/eeepc-laptop.c
index a469275,8153b3e..0000000
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@@ -182,7 -180,7 +182,8 @@@ 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 void eeepc_hotk_notify(struct acpi_device *device, u32 event);
+ static int eeepc_hotk_resume(struct acpi_device *device);
  
  static const struct acpi_device_id eeepc_device_ids[] = {
  	{EEEPC_HOTK_HID, 0},
@@@ -198,7 -195,7 +199,8 @@@ static struct acpi_driver eeepc_hotk_dr
  	.ops = {
  		.add = eeepc_hotk_add,
  		.remove = eeepc_hotk_remove,
 +		.notify = eeepc_hotk_notify,
+ 		.resume = eeepc_hotk_resume,
  	},
  };
  
@@@ -526,20 -514,7 +528,20 @@@ static int notify_brn(void
  	return -1;
  }
  
 +static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
 +				    u8 *value)
 +{
 +	int val = get_acpi(CM_ASL_WLAN);
 +
 +	if (val == 1 || val == 0)
 +		*value = val;
 +	else
 +		return -EINVAL;
 +
 +	return 0;
 +}
 +
- 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);
@@@ -578,7 -550,15 +577,15 @@@
  	rfkill_set_sw_state(ehotk->eeepc_wlan_rfkill, blocked);
  }
  
+ 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 void eeepc_hotk_notify(struct acpi_device *device, u32 event)
  {
  	static struct key_entry *key;
  	u16 count;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the wireless tree with the acpi tree
  2009-06-03  3:05 ` Matthew Garrett
@ 2009-06-03  4:42   ` Stephen Rothwell
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2009-06-03  4:42 UTC (permalink / raw)
  To: Len Brown
  Cc: John W. Linville, linux-next, linux-kernel, Johannes Berg,
	Matthew Garrett

[-- Attachment #1: Type: text/plain, Size: 437 bytes --]

On Wed, 3 Jun 2009 04:05:41 +0100 Matthew Garrett <mjg@redhat.com> wrote:
>
> Easiest in this case might be to drop the toshiba-acpi patches from me 
> from acpi-test for the moment - I'm still waiting for some testing 
> feedback on them. I can rebase against the rfkill code as long as it 
> lands early enough.

Len?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the wireless tree with the acpi tree
  2009-06-03  2:27 Stephen Rothwell
@ 2009-06-03  3:05 ` Matthew Garrett
  2009-06-03  4:42   ` Stephen Rothwell
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Garrett @ 2009-06-03  3:05 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: John W. Linville, linux-next, linux-kernel, Johannes Berg, Len Brown

Easiest in this case might be to drop the toshiba-acpi patches from me 
from acpi-test for the moment - I'm still waiting for some testing 
feedback on them. I can rebase against the rfkill code as long as it 
lands early enough.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* linux-next: manual merge of the wireless tree with the acpi tree
@ 2009-06-03  2:27 Stephen Rothwell
  2009-06-03  3:05 ` Matthew Garrett
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2009-06-03  2:27 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-next, linux-kernel, Johannes Berg, Matthew Garrett, Len Brown

Hi John,

Today's linux-next merge of the wireless tree got a conflict in
drivers/platform/x86/toshiba_acpi.c between commit
76e310021ad9560fd02ce3d1e5723e5f0230ea7a ("toshiba_acpi: add full hotkey
support") from the acpi tree and commit
c6d660ce29295d344fcdc3654274b4a0aad1a9c8 ("rfkill: rewrite") from the
wireless tree.

I fixed it up (see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/platform/x86/toshiba_acpi.c
index ce7de70,81d31ea..0000000
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@@ -45,8 -45,6 +45,7 @@@
  #include <linux/backlight.h>
  #include <linux/platform_device.h>
  #include <linux/rfkill.h>
- #include <linux/input-polldev.h>
 +#include <linux/input.h>
  
  #include <asm/uaccess.h>
  
@@@ -282,15 -249,9 +281,11 @@@ static acpi_status hci_read2(u32 reg, u
  
  struct toshiba_acpi_dev {
  	struct platform_device *p_dev;
- 	struct rfkill *rfk_dev;
- 	struct input_polled_dev *poll_dev;
+ 	struct rfkill *bt_rfk;
 +	struct input_dev *hotkey_dev;
 +	acpi_handle handle;
  
  	const char *bt_name;
- 	const char *rfk_name;
- 
- 	bool last_rfk_state;
  
  	struct mutex mutex;
  };
@@@ -734,167 -675,13 +709,164 @@@ static struct backlight_ops toshiba_bac
          .update_status  = set_lcd_status,
  };
  
 +static struct key_entry *toshiba_acpi_get_entry_by_scancode(int code)
 +{
 +	struct key_entry *key;
 +
 +	for (key = toshiba_acpi_keymap; key->type != KE_END; key++)
 +		if (code == key->code)
 +			return key;
 +
 +	return NULL;
 +}
 +
 +static struct key_entry *toshiba_acpi_get_entry_by_keycode(int code)
 +{
 +	struct key_entry *key;
 +
 +	for (key = toshiba_acpi_keymap; key->type != KE_END; key++)
 +		if (code == key->keycode && key->type == KE_KEY)
 +			return key;
 +
 +	return NULL;
 +}
 +
 +static int toshiba_acpi_getkeycode(struct input_dev *dev, int scancode,
 +				   int *keycode)
 +{
 +	struct key_entry *key = toshiba_acpi_get_entry_by_scancode(scancode);
 +
 +	if (key && key->type == KE_KEY) {
 +		*keycode = key->keycode;
 +		return 0;
 +	}
 +
 +	return -EINVAL;
 +}
 +
 +static int toshiba_acpi_setkeycode(struct input_dev *dev, int scancode,
 +				   int keycode)
 +{
 +	struct key_entry *key;
 +	int old_keycode;
 +
 +	if (keycode < 0 || keycode > KEY_MAX)
 +		return -EINVAL;
 +
 +	key = toshiba_acpi_get_entry_by_scancode(scancode);
 +	if (key && key->type == KE_KEY) {
 +		old_keycode = key->keycode;
 +		key->keycode = keycode;
 +		set_bit(keycode, dev->keybit);
 +		if (!toshiba_acpi_get_entry_by_keycode(old_keycode))
 +			clear_bit(old_keycode, dev->keybit);
 +		return 0;
 +	}
 +
 +	return -EINVAL;
 +}
 +
 +static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context)
 +{
 +	u32 hci_result, value;
 +	struct key_entry *key;
 +
 +	if (event != 0x80)
 +		return;
 +	do {
 +		hci_read1(HCI_SYSTEM_EVENT, &value, &hci_result);
 +		if (hci_result == HCI_SUCCESS) {
 +			if (value == 0x100)
 +				continue;
 +			else if (value & 0x80) {
 +				key = toshiba_acpi_get_entry_by_scancode
 +					(value & ~0x80);
 +				if (!key) {
 +					printk(MY_INFO "Unknown key %x\n",
 +					       value & ~0x80);
 +					continue;
 +				}
 +				input_report_key(toshiba_acpi.hotkey_dev,
 +						 key->keycode, 1);
 +				input_sync(toshiba_acpi.hotkey_dev);
 +				input_report_key(toshiba_acpi.hotkey_dev,
 +						 key->keycode, 0);
 +				input_sync(toshiba_acpi.hotkey_dev);
 +			}
 +		} else if (hci_result == HCI_NOT_SUPPORTED) {
 +			/* This is a workaround for an unresolved issue on
 +			 * some machines where system events sporadically
 +			 * become disabled. */
 +			hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result);
 +			printk(MY_NOTICE "Re-enabled hotkeys\n");
 +		}
 +	} while (hci_result != HCI_EMPTY);
 +}
 +
 +static int toshiba_acpi_setup_keyboard(char *device)
 +{
 +	acpi_status status;
 +	acpi_handle handle;
 +	int result;
 +	const struct key_entry *key;
 +
 +	status = acpi_get_handle(NULL, device, &handle);
 +	if (ACPI_FAILURE(status)) {
 +		printk(MY_INFO "Unable to get notification device\n");
 +		return -ENODEV;
 +	}
 +
 +	toshiba_acpi.handle = handle;
 +
 +	status = acpi_evaluate_object(handle, "ENAB", NULL, NULL);
 +	if (ACPI_FAILURE(status)) {
 +		printk(MY_INFO "Unable to enable hotkeys\n");
 +		return -ENODEV;
 +	}
 +
 +	status = acpi_install_notify_handler(handle, ACPI_DEVICE_NOTIFY,
 +					      toshiba_acpi_notify, NULL);
 +	if (ACPI_FAILURE(status)) {
 +		printk(MY_INFO "Unable to install hotkey notification\n");
 +		return -ENODEV;
 +	}
 +
 +	toshiba_acpi.hotkey_dev = input_allocate_device();
 +	if (!toshiba_acpi.hotkey_dev) {
 +		printk(MY_INFO "Unable to register input device\n");
 +		return -ENOMEM;
 +	}
 +
 +	toshiba_acpi.hotkey_dev->name = "Toshiba input device";
 +	toshiba_acpi.hotkey_dev->phys = device;
 +	toshiba_acpi.hotkey_dev->id.bustype = BUS_HOST;
 +	toshiba_acpi.hotkey_dev->getkeycode = toshiba_acpi_getkeycode;
 +	toshiba_acpi.hotkey_dev->setkeycode = toshiba_acpi_setkeycode;
 +
 +	for (key = toshiba_acpi_keymap; key->type != KE_END; key++) {
 +		set_bit(EV_KEY, toshiba_acpi.hotkey_dev->evbit);
 +		set_bit(key->keycode, toshiba_acpi.hotkey_dev->keybit);
 +	}
 +
 +	result = input_register_device(toshiba_acpi.hotkey_dev);
 +	if (result) {
 +		printk(MY_INFO "Unable to register input device\n");
 +		return result;
 +	}
 +
 +	return 0;
 +}
 +
  static void toshiba_acpi_exit(void)
  {
- 	if (toshiba_acpi.poll_dev) {
- 		input_unregister_polled_device(toshiba_acpi.poll_dev);
- 		input_free_polled_device(toshiba_acpi.poll_dev);
+ 	if (toshiba_acpi.bt_rfk) {
+ 		rfkill_unregister(toshiba_acpi.bt_rfk);
+ 		rfkill_destroy(toshiba_acpi.bt_rfk);
  	}
  
 +	if (toshiba_acpi.hotkey_dev)
 +		input_unregister_device(toshiba_acpi.hotkey_dev);
 +
- 	if (toshiba_acpi.rfk_dev)
- 		rfkill_unregister(toshiba_acpi.rfk_dev);
- 
  	if (toshiba_backlight_device)
  		backlight_device_unregister(toshiba_backlight_device);
  

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-06-18  1:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-03  2:20 linux-next: manual merge of the wireless tree with the acpi tree Stephen Rothwell
2009-06-03  3:03 ` Matthew Garrett
2009-06-03  2:27 Stephen Rothwell
2009-06-03  3:05 ` Matthew Garrett
2009-06-03  4:42   ` Stephen Rothwell
2009-06-18  1:29 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).