El-cheapo Lik-sang adaptor now working
Daniel Thompson <[email protected]>
| Newsgroups | gmane.linux.ports.game-cube.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Folks I have now got my Lik-sang keyboard adaptor working. Basically it seems that this device puts the keyboard scan codes into the top 24 bits of the second word (raw[1]) rather than the first. Other than that everything appears to be pretty much the same. The attached patch is all that is needed to get the thing going however it might break the Datel support depending on whether the Datel adaptor sets the top 24-bits of the second word to zero. I think its unlikely but am not in a position to test it. Could someone with a Datel adaptor test this patch and see if their keyboard still works? -- Daniel Thompson <[email protected]>
si-liksang_adaptor.patch
(text/x-patch, 1.5 KB)
--- linux/drivers/input/gcn-si.c 2004-12-03 21:33:45.000000000 +0000
+++ linux-2.6.10/drivers/input/gcn-si.c 2005-02-13 16:42:06.000000000 +0000
@@ -95,7 +95,7 @@
};
typedef struct {
- unsigned char old[3];
+ unsigned char old[6];
} keyboard_status;
typedef enum {CTL_PAD,CTL_KEYBOARD,CTL_UNKNOWN} control_type;
@@ -264,7 +264,7 @@
static void gcn_si_timer(unsigned long portno)
{
unsigned long raw[2];
- unsigned char key[3];
+ unsigned char key[6];
unsigned char oldkey;
int i;
@@ -327,18 +327,24 @@
key[1] = (raw[0] >> 4) & 0xFF;
key[2] = (raw[0] << 4) & 0xFF;
key[2] |= (raw[1] << 28) & 0xFF;
+ key[3] = (raw[1] >> 24) & 0xFF;
+ key[4] = (raw[1] >> 16) & 0xFF;
+ key[5] = (raw[1] >> 8) & 0xFF;
+
+ /*si_printk(KERN_INFO, "raw state = %08x %08x; key state = %02x %02x %02x\n", raw[0], raw[1], key[0], key[1], key[2]);*/
/* check if anything was released */
- for (i = 0; i < 3; ++i) {
+ for (i = 0; i < 6; ++i) {
oldkey = port[portno].keyboard.old[i];
- if (oldkey != key[0] &&
- oldkey != key[1] && oldkey != key[2])
+ if (oldkey != key[0] && oldkey != key[1] &&
+ oldkey != key[2] && oldkey != key[3] &&
+ oldkey != key[4] && oldkey != key[5])
input_report_key(&port[portno].idev,
gamecube_keymap[oldkey], 0);
}
/* report keys */
- for (i = 0; i < 3; ++i) {
+ for (i = 0; i < 6; ++i) {
if (key[i])
input_report_key(&port[portno].idev,
gamecube_keymap[key[i]], 1);