Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH v2 1/3] eeepc-laptop: Add support for extended hotkeys

0 views
Skip to first unread message

Matthew Garrett

unread,
Nov 20, 2008, 10:40:12 AM11/20/08
to
Newer Eees have extra hotkeys above the function keys. This patch adds support
for sending them through the input layer.

Signed-off-by: Matthew Garrett <m...@redhat.com>
---
drivers/misc/eeepc-laptop.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c
index 9ef98b2..e81ef18 100644
--- a/drivers/misc/eeepc-laptop.c
+++ b/drivers/misc/eeepc-laptop.c
@@ -161,6 +161,10 @@ static struct key_entry eeepc_keymap[] = {
{KE_KEY, 0x13, KEY_MUTE },
{KE_KEY, 0x14, KEY_VOLUMEDOWN },
{KE_KEY, 0x15, KEY_VOLUMEUP },
+ {KE_KEY, 0x1a, KEY_COFFEE },
+ {KE_KEY, 0x1b, KEY_ZOOM },
+ {KE_KEY, 0x1c, KEY_PROG2 },
+ {KE_KEY, 0x1d, KEY_PROG3 },
{KE_KEY, 0x30, KEY_SWITCHVIDEOMODE },
{KE_KEY, 0x31, KEY_SWITCHVIDEOMODE },
{KE_KEY, 0x32, KEY_SWITCHVIDEOMODE },

--
Matthew Garrett | mj...@srcf.ucam.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Matthew Garrett

unread,
Nov 20, 2008, 10:40:12 AM11/20/08
to
Error out if rfkill registration fails, and also set the default system state
appropriately on boot

Signed-off-by: Matthew Garrett <m...@redhat.com>
---

Includes Alan's suggested cleanup for the failure path

drivers/misc/eeepc-laptop.c | 51 +++++++++++++++++++++++++++++++-----------
1 files changed, 37 insertions(+), 14 deletions(-)

diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c
index e81ef18..3de44fb 100644
--- a/drivers/misc/eeepc-laptop.c
+++ b/drivers/misc/eeepc-laptop.c
@@ -562,7 +562,7 @@ static int eeepc_hotk_add(struct acpi_device *device)
ehotk->device = device;
result = eeepc_hotk_check();
if (result)
- goto end;
+ goto ehotk_fail;
status = acpi_install_notify_handler(ehotk->handle, ACPI_SYSTEM_NOTIFY,
eeepc_hotk_notify, ehotk);
if (ACPI_FAILURE(status))
@@ -573,18 +573,25 @@ static int eeepc_hotk_add(struct acpi_device *device)
RFKILL_TYPE_WLAN);

if (!ehotk->eeepc_wlan_rfkill)
- goto end;
+ goto wlan_fail;

ehotk->eeepc_wlan_rfkill->name = "eeepc-wlan";
ehotk->eeepc_wlan_rfkill->toggle_radio = eeepc_wlan_rfkill_set;
ehotk->eeepc_wlan_rfkill->get_state = eeepc_wlan_rfkill_state;
- if (get_acpi(CM_ASL_WLAN) == 1)
+ if (get_acpi(CM_ASL_WLAN) == 1) {
ehotk->eeepc_wlan_rfkill->state =
RFKILL_STATE_UNBLOCKED;
- else
+ rfkill_set_default(RFKILL_TYPE_WLAN,
+ RFKILL_STATE_UNBLOCKED);
+ } else {
ehotk->eeepc_wlan_rfkill->state =
RFKILL_STATE_SOFT_BLOCKED;
- rfkill_register(ehotk->eeepc_wlan_rfkill);
+ rfkill_set_default(RFKILL_TYPE_WLAN,
+ RFKILL_STATE_SOFT_BLOCKED);
+ }
+ result = rfkill_register(ehotk->eeepc_wlan_rfkill);
+ if (result)
+ goto wlan_fail;
}

if (get_acpi(CM_ASL_BLUETOOTH) != -1) {
@@ -592,27 +599,43 @@ static int eeepc_hotk_add(struct acpi_device *device)
rfkill_allocate(&device->dev, RFKILL_TYPE_BLUETOOTH);

if (!ehotk->eeepc_bluetooth_rfkill)
- goto end;
+ goto bluetooth_fail;

ehotk->eeepc_bluetooth_rfkill->name = "eeepc-bluetooth";
ehotk->eeepc_bluetooth_rfkill->toggle_radio =
eeepc_bluetooth_rfkill_set;
ehotk->eeepc_bluetooth_rfkill->get_state =
eeepc_bluetooth_rfkill_state;
- if (get_acpi(CM_ASL_BLUETOOTH) == 1)
+ if (get_acpi(CM_ASL_BLUETOOTH) == 1) {
ehotk->eeepc_bluetooth_rfkill->state =
RFKILL_STATE_UNBLOCKED;
- else
+ rfkill_set_default(RFKILL_TYPE_BLUETOOTH,
+ RFKILL_STATE_UNBLOCKED);
+ } else {
ehotk->eeepc_bluetooth_rfkill->state =
RFKILL_STATE_SOFT_BLOCKED;
- rfkill_register(ehotk->eeepc_bluetooth_rfkill);
+ rfkill_set_default(RFKILL_TYPE_BLUETOOTH,
+ RFKILL_STATE_SOFT_BLOCKED);
+ }
+
+ result = rfkill_register(ehotk->eeepc_bluetooth_rfkill);
+ if (result)
+ goto bluetooth_fail;
}
+ return 0;
+
+ bluetooth_fail:
+ if (ehotk->eeepc_bluetooth_rfkill)
+ rfkill_free(ehotk->eeepc_bluetooth_rfkill);
+ rfkill_unregister(ehotk->eeepc_wlan_rfkill);
+ ehotk->eeepc_wlan_rfkill = NULL;
+ wlan_fail:
+ if (ehotk->eeepc_wlan_rfkill)
+ rfkill_free(ehotk->eeepc_wlan_rfkill);
+ ehotk_fail:
+ kfree(ehotk);
+ ehotk = NULL;

- end:
- if (result) {
- kfree(ehotk);
- ehotk = NULL;
- }
return result;

Matthew Garrett

unread,
Nov 20, 2008, 3:00:12 PM11/20/08
to
On Thu, Nov 20, 2008 at 02:54:36PM -0500, Valdis.K...@vt.edu wrote:
> On Thu, 20 Nov 2008 15:36:28 GMT, Matthew Garrett said:
>
> > + {KE_KEY, 0x1a, KEY_COFFEE },
>
> I'm almost afraid to ask. ;)

Screen lock, derived from "Gone for a coffee break".

Valdis.K...@vt.edu

unread,
Nov 20, 2008, 3:00:14 PM11/20/08
to
On Thu, 20 Nov 2008 15:36:28 GMT, Matthew Garrett said:

> + {KE_KEY, 0x1a, KEY_COFFEE },

I'm almost afraid to ask. ;)

Matthew Garrett

unread,
Dec 28, 2008, 10:30:14 AM12/28/08
to
Hi Len,

Can these be merged for .29?

Corentin Chary

unread,
Dec 29, 2008, 6:20:12 AM12/29/08
to
On Sun, Dec 28, 2008 at 4:20 PM, Matthew Garrett <mj...@srcf.ucam.org> wrote:
> Hi Len,
>
> Can these be merged for .29?

Acked-by: Corentin Chary <coren...@iksaif.net>
--
Corentin Chary
http://xf.iksaif.net

Alan Jenkins

unread,
Jan 18, 2009, 5:10:09 AM1/18/09
to
On 12/29/08, Corentin Chary <corenti...@gmail.com> wrote:
> On Sun, Dec 28, 2008 at 4:20 PM, Matthew Garrett <mj...@srcf.ucam.org>
> wrote:
>> Hi Len,
>>
>> Can these be merged for .29?
>
> Acked-by: Corentin Chary <coren...@iksaif.net>

They're not present in 2.6.29-rc2. Have they just missed the boat?

Thanks
Alan

Corentin Chary

unread,
Jan 20, 2009, 10:20:08 AM1/20/09
to
On Sunday 18 January 2009 11:04:01 Alan Jenkins wrote:
> On 12/29/08, Corentin Chary <corenti...@gmail.com> wrote:
> > On Sun, Dec 28, 2008 at 4:20 PM, Matthew Garrett <mj...@srcf.ucam.org>
> >
> > wrote:
> >> Hi Len,
> >>
> >> Can these be merged for .29?
> >
> > Acked-by: Corentin Chary <coren...@iksaif.net>
>
> They're not present in 2.6.29-rc2. Have they just missed the boat?
>
> Thanks
> Alan

They are now in git://git.iksaif.net/acpi4asus.git acpi4asus and I'll re-send
them soon to Len because this serie is a litle outdated now that the drivers
have been moved into drivers/platform/x86/ .

--

--
Corentin Chary
http://xf.iksaif.net

0 new messages