linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard "fn" key
       [not found] ` <Pine.LNX.4.64.0802122143280.7699@twin.jikos.cz>
@ 2008-02-13 12:44   ` Tobias Müller
  2008-02-13 12:57     ` Jiri Kosina
  0 siblings, 1 reply; 8+ messages in thread
From: Tobias Müller @ 2008-02-13 12:44 UTC (permalink / raw)
  To: Jiri Kosina, linux-input

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

Jiri Kosina schrieb:
> Some part of the patch is already in 2.6.25-rc1 -- please see commit 
> a45d82d19a6c2a717bcc33cff243199b77fa0082, which adds support for Apple 
> Aluminium keyboards. So the patch would need some changes that it would 
> apply on top of current tree.
It seems there is almost everything implemented except for some product ids.

> Also, Tobias (added to CC) seems to be currently working on adding support 
> for a subset of keyboards that this patch adds. Tobias -- it seems like 
> this patch is handling a superset of what your patch does, right?
Yes

> It would be great if you could put this all together into one condensated 
> patch which I could merge into my tree.
I'm working on that, but I found a problem in the new 2.6.25-rc1 code.

Until 2.6.24 hidinput_apple_event which handles the apple specials was called by
hidinput_hid_event and if hidinput_apple_event changed some code, hidinput_hid_event
returned and didn't send any events.

In 2.6.25 hidinput_apple_event is called in hidinput_event_quirks which is called by 
hidinput_hid_event. But if hidinput_event_quirks sent events, hidinput_hid_event doesn't
know of this and send the events too! So if I press some keys on my keyboard, there are
2 keycodes sent.

This seems to be a greater change in 2.6.25 and I don't want to change this, because I think
someone made this change for some good reason.

Regards
  Tobias

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3389 bytes --]

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

* Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard "fn" key
  2008-02-13 12:44   ` [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard "fn" key Tobias Müller
@ 2008-02-13 12:57     ` Jiri Kosina
  2008-02-13 15:49       ` Tobias Müller
  0 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2008-02-13 12:57 UTC (permalink / raw)
  To: Tobias Müller; +Cc: linux-input

[-- Attachment #1: Type: TEXT/PLAIN, Size: 645 bytes --]

On Wed, 13 Feb 2008, Tobias Müller wrote:

> In 2.6.25 hidinput_apple_event is called in hidinput_event_quirks which 
> is called by hidinput_hid_event. But if hidinput_event_quirks sent 
> events, hidinput_hid_event doesn't know of this and send the events too! 
> So if I press some keys on my keyboard, there are 2 keycodes sent.

Hi Tobias,

yes, this is a bug, for which I already have fix in my tree -- see 
http://git.kernel.org/?p=linux/kernel/git/jikos/hid.git;a=commit;h=68a1f2cc8676f22a6fd49f344f99e326eb7f5117

This restores the previous behavior. I just haven't pushed this to Linus 
yet.

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard "fn" key
  2008-02-13 12:57     ` Jiri Kosina
@ 2008-02-13 15:49       ` Tobias Müller
  2008-02-13 16:06         ` Jiri Kosina
  0 siblings, 1 reply; 8+ messages in thread
From: Tobias Müller @ 2008-02-13 15:49 UTC (permalink / raw)
  To: Jiri Kosina, linux-input


[-- Attachment #1.1: Type: text/plain, Size: 270 bytes --]

Jiri Kosina schrieb:
 > On Tue, 12 Fe
 > It would be great if you could put this all together into one
 > condensated patch which I could merge into my tree.

So, this is the updated version. It only adds some product-ids and
some keyboards mappings.

Regards
   Tobias

[-- Attachment #1.2: macbook-2.6.25.patch --]
[-- Type: text/plain, Size: 3933 bytes --]

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 5325d98..6a100e2 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -97,10 +97,11 @@ struct hidinput_key_translation {
 #define APPLE_FLAG_FKEY 0x01

 static struct hidinput_key_translation apple_fn_keys[] = {
+       { KEY_BACKSPACE, KEY_DELETE },                                  /* Needed for MacBook keyboards without delete */
        { KEY_F1,       KEY_BRIGHTNESSDOWN,     APPLE_FLAG_FKEY },
        { KEY_F2,       KEY_BRIGHTNESSUP,       APPLE_FLAG_FKEY },
-       { KEY_F3,       KEY_CYCLEWINDOWS,       APPLE_FLAG_FKEY }, /* Exposé */
-       { KEY_F4,       KEY_FN_F4,              APPLE_FLAG_FKEY }, /* Dashboard */
+       { KEY_F3,       KEY_CYCLEWINDOWS,       APPLE_FLAG_FKEY },      /* Exposé */
+       { KEY_F4,       KEY_FN_F4,              APPLE_FLAG_FKEY },      /* Dashboard */
        { KEY_F5,       KEY_FN_F5 },
        { KEY_F6,       KEY_FN_F6 },
        { KEY_F7,       KEY_BACK,               APPLE_FLAG_FKEY },
@@ -109,6 +110,10 @@ static struct hidinput_key_translation apple_fn_keys[] = {
        { KEY_F10,      KEY_MUTE,               APPLE_FLAG_FKEY },
        { KEY_F11,      KEY_VOLUMEDOWN,         APPLE_FLAG_FKEY },
        { KEY_F12,      KEY_VOLUMEUP,           APPLE_FLAG_FKEY },
+       { KEY_UP,       KEY_PAGEUP },                                   /* Needed for MacBook keyboards without page-up */
+       { KEY_DOWN,     KEY_PAGEDOWN },                                 /* Needed for MacBook keyboards without page-down */
+       { KEY_LEFT,     KEY_HOME },                                     /* Needed for MacBook keyboards without home */
+       { KEY_RIGHT,    KEY_END },                                      /* Needed for MacBook keyboards without end */
        { }
 };

diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index b77b61e..73a5aca 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -66,6 +66,12 @@
 #define USB_DEVICE_ID_APPLE_ALU_ANSI   0x0220
 #define USB_DEVICE_ID_APPLE_ALU_ISO    0x0221
 #define USB_DEVICE_ID_APPLE_ALU_JIS    0x0222
+#define USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI    0x0229
+#define USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO     0x022a
+#define USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS     0x022b
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI  0x022c
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO   0x022d
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS   0x022e
 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY   0x030a
 #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY    0x030b
 #define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242
@@ -593,6 +599,12 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI, HID_QUIRK_APPLE_HAS_FN },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS, HID_QUIRK_APPLE_HAS_FN },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_HAS_FN},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, HID_QUIRK_APPLE_HAS_FN},
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3389 bytes --]

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

* Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard "fn" key
  2008-02-13 15:49       ` Tobias Müller
@ 2008-02-13 16:06         ` Jiri Kosina
  2008-03-14 16:41           ` Tobias Müller
  0 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2008-02-13 16:06 UTC (permalink / raw)
  To: Tobias Müller; +Cc: linux-input

[-- Attachment #1: Type: TEXT/PLAIN, Size: 413 bytes --]

On Wed, 13 Feb 2008, Tobias Müller wrote:

> > It would be great if you could put this all together into one
> > condensated patch which I could merge into my tree.
> So, this is the updated version. It only adds some product-ids and
> some keyboards mappings.

The patch had mangled whitespaces again, but I have cleaned that up 
manually and applied to my tree.

Thanks,

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard "fn" key
  2008-02-13 16:06         ` Jiri Kosina
@ 2008-03-14 16:41           ` Tobias Müller
  2008-03-14 16:52             ` Jiri Kosina
  0 siblings, 1 reply; 8+ messages in thread
From: Tobias Müller @ 2008-03-14 16:41 UTC (permalink / raw)
  To: Jiri Kosina, linux-input

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

Hi!

I 
just 
tested 
the 
rc5 
on 
my 
pc 
and 
macbook 
and 
found 
a 
small 
mistake:

diff 
--git 
a/drivers/hid/usbhid/hid-quirks.c 
b/drivers/hid/usbhid/hid-quirks.c
index 
e6d05f6..de8c5a9 
100644
--- 
a/drivers/hid/usbhid/hid-quirks.c
+++ 
b/drivers/hid/usbhid/hid-quirks.c
@@ 
-624,7 
+624,7 
@@ 
static 
const 
struct 
hid_blacklist 
{
         { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
         { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS, HID_QUIRK_APPLE_HAS_FN },
         { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
- 
       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD },
+ 
       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
         { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
         { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_HAS_FN },
         { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },

Regards
   Tobias

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3389 bytes --]

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

* Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard "fn" key
  2008-03-14 16:41           ` Tobias Müller
@ 2008-03-14 16:52             ` Jiri Kosina
  2008-03-14 20:52               ` Tobias Müller
       [not found]               ` <47DAAFCA.2030005@twam.info>
  0 siblings, 2 replies; 8+ messages in thread
From: Jiri Kosina @ 2008-03-14 16:52 UTC (permalink / raw)
  To: Tobias Müller; +Cc: linux-input

[-- Attachment #1: Type: TEXT/PLAIN, Size: 321 bytes --]

On Fri, 14 Mar 2008, Tobias Müller wrote:

> I just tested the rc5 on my pc and macbook and found a small mistake:

Hi Tobias,

the patch has been horribly mangled by your mailer, could you please 
resend?

Also, a small changelog and Signed-off-by line would be needed.

Thanks,

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard "fn" key
  2008-03-14 16:52             ` Jiri Kosina
@ 2008-03-14 20:52               ` Tobias Müller
       [not found]               ` <47DAAFCA.2030005@twam.info>
  1 sibling, 0 replies; 8+ messages in thread
From: Tobias Müller @ 2008-03-14 20:52 UTC (permalink / raw)
  To: linux-input

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

Hi!

> the patch has been horribly mangled by your mailer, could you please 
> resend?
I'm sorry. My thunderbird is keen on scrambling mails... :/ Hope this time it's fine.

Regards
  Tobias

-----------------------

4th=generation MacBook (product id 0x022a) from Apple doesn't need HID_QUIRK_APPLE_ISO_KEYBOARD fix anymore.

Signed-off-by: Tobias Mueller <Tobias_Mueller@twam.info>

diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index e6d05f6..de8c5a9 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -624,7 +624,7 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS, HID_QUIRK_APPLE_HAS_FN },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_HAS_FN },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3389 bytes --]

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

* Re: [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard "fn" key
       [not found]               ` <47DAAFCA.2030005@twam.info>
@ 2008-03-14 22:26                 ` Jiri Kosina
  0 siblings, 0 replies; 8+ messages in thread
From: Jiri Kosina @ 2008-03-14 22:26 UTC (permalink / raw)
  To: Tobias Müller; +Cc: linux-input

[-- Attachment #1: Type: TEXT/PLAIN, Size: 509 bytes --]

On Fri, 14 Mar 2008, Tobias Müller wrote:

> > the patch has been horribly mangled by your mailer, could you please resend?
> I'm sorry. My thunderbird is keen on scrambling mails... :/ Hope this time
> it's fine.

No, it is still mangled. Also, you seem to have sent the mail to linux-ide 
instead of linus-input :)

Never mind, as this is oneliner I will fix it by hand, just to let you 
know in case you will be submitting any more sophisticated patches.

Thanks,

-- 
Jiri Kosina
SUSE Labs

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

end of thread, other threads:[~2008-03-14 22:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fosskb$klp$1@ger.gmane.org>
     [not found] ` <Pine.LNX.4.64.0802122143280.7699@twin.jikos.cz>
2008-02-13 12:44   ` [PATCH] hid, 2.6.23 - add support for new macbook and apple aluminum keyboard "fn" key Tobias Müller
2008-02-13 12:57     ` Jiri Kosina
2008-02-13 15:49       ` Tobias Müller
2008-02-13 16:06         ` Jiri Kosina
2008-03-14 16:41           ` Tobias Müller
2008-03-14 16:52             ` Jiri Kosina
2008-03-14 20:52               ` Tobias Müller
     [not found]               ` <47DAAFCA.2030005@twam.info>
2008-03-14 22:26                 ` Jiri Kosina

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).