Changeset 013c4d6 in mainline for kernel/genarch/src/kbd/i8042.c


Ignore:
Timestamp:
2009-02-19T23:55:23Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f32d90b
Parents:
d1eece6
Message:

Improve the ns16550 driver.

  • The driver support multiple instances.
  • It still remembers the last registered IRQ in a global structure (cannot be easily fixed now)
  • Was converted to use PIO directly
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/kbd/i8042.c

    rd1eece6 r013c4d6  
    5353
    5454i8042_instance_t lgcy_i8042_instance = {
    55         .i8042 = (i8042_t *) i8042_BASE,
     55        .i8042 = (i8042_t *) I8042_BASE,
    5656};
    5757
     
    8989        .suspend = i8042_suspend,
    9090        .resume = i8042_resume,
    91         .read = i8042_key_read
    9291};
    9392
     
    229228}
    230229
    231 char i8042_key_read(chardev_t *d)
    232 {
    233         i8042_t *dev = lgcy_i8042_instance.i8042;
    234         char ch;
    235        
    236         while (!(ch = active_read_buff_read())) {
    237                 uint8_t x;
    238                
    239                 while (!(pio_read_8(&dev->status) & i8042_BUFFER_FULL_MASK))
    240                         ;
    241                
    242                 x = pio_read_8(&dev->data);
    243                 if (x & KEY_RELEASE)
    244                         key_released(x ^ KEY_RELEASE);
    245                 else
    246                         active_read_key_pressed(x);
    247         }
    248         return ch;
    249 }
    250 
    251230/** @}
    252231 */
Note: See TracChangeset for help on using the changeset viewer.