mpc5xxx keyboard BUG found

Igor Luri iluri at fagorautomation.es
Fri Mar 17 22:38:48 EST 2006


We have an MPC5200LiteB board with a Microsoft USB keyboard atached and 
we have realized that some keys don't work properly, like up, down, lef 
and right arrows, PageUp, PageDown etc.

We have found that when those keys are pressed, first it sends a special 
scancode 0xe0 and then pressed key scancode.

Modifiying mpc5xxx_translate function to ignore the first scancode
 

                 // special prefix scancodes..
                  if (scancode == 0xe0 || scancode == 0xe1) {
                        return 0;
                  } 

our keyboard works well. Other cpus ignorates this special scancode or  
it evaluates.

Now, mpc5xxx_translate looks like this:

int mpc5xxx_translate(unsigned char scancode, unsigned char *keycode,
               char raw_mode)
{
    
  // special prefix scancodes..
  if (scancode == 0xe0 || scancode == 0xe1) {
        return 0;
  }  

  //0xFF is sent by a few keyboards, ignore it. 0x00 is error
  if (scancode == 0x00 || scancode == 0xff) {
    return 0;
  }
  *keycode = scancode;
  return 1;
}





More information about the Linuxppc-embedded mailing list