Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _I8042_H |
| 2 | #define _I8042_H |
| 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
| 5 | /* |
| 6 | * Copyright (c) 1999-2002 Vojtech Pavlik |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License version 2 as published by |
| 10 | * the Free Software Foundation. |
| 11 | */ |
| 12 | |
| 13 | /* |
| 14 | * Arch-dependent inline functions and defines. |
| 15 | */ |
| 16 | |
| 17 | #if defined(CONFIG_MACH_JAZZ) |
| 18 | #include "i8042-jazzio.h" |
Thomas Bogendoerfer | f47831f | 2008-03-10 11:43:54 -0700 | [diff] [blame] | 19 | #elif defined(CONFIG_SGI_HAS_I8042) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #include "i8042-ip22io.h" |
Thomas Bogendoerfer | f178244 | 2008-03-12 14:58:16 -0400 | [diff] [blame] | 21 | #elif defined(CONFIG_SNI_RM) |
| 22 | #include "i8042-snirm.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | #elif defined(CONFIG_PPC) |
| 24 | #include "i8042-ppcio.h" |
Adrian Bunk | 0b57ee9 | 2005-12-22 21:03:47 -0800 | [diff] [blame] | 25 | #elif defined(CONFIG_SPARC) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #include "i8042-sparcio.h" |
| 27 | #elif defined(CONFIG_X86) || defined(CONFIG_IA64) |
| 28 | #include "i8042-x86ia64io.h" |
GuanXuetao | 425ad52 | 2011-01-15 18:28:19 +0800 | [diff] [blame] | 29 | #elif defined(CONFIG_UNICORE32) |
| 30 | #include "i8042-unicore32io.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #else |
| 32 | #include "i8042-io.h" |
| 33 | #endif |
| 34 | |
| 35 | /* |
| 36 | * This is in 50us units, the time we wait for the i8042 to react. This |
| 37 | * has to be long enough for the i8042 itself to timeout on sending a byte |
| 38 | * to a non-existent mouse. |
| 39 | */ |
| 40 | |
| 41 | #define I8042_CTL_TIMEOUT 10000 |
| 42 | |
| 43 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | * Return codes. |
| 45 | */ |
| 46 | |
| 47 | #define I8042_RET_CTL_TEST 0x55 |
| 48 | |
| 49 | /* |
| 50 | * Expected maximum internal i8042 buffer size. This is used for flushing |
| 51 | * the i8042 buffers. |
| 52 | */ |
| 53 | |
| 54 | #define I8042_BUFFER_SIZE 16 |
| 55 | |
| 56 | /* |
| 57 | * Number of AUX ports on controllers supporting active multiplexing |
| 58 | * specification |
| 59 | */ |
| 60 | |
| 61 | #define I8042_NUM_MUX_PORTS 4 |
| 62 | |
| 63 | /* |
| 64 | * Debug. |
| 65 | */ |
| 66 | |
| 67 | #ifdef DEBUG |
| 68 | static unsigned long i8042_start_time; |
| 69 | #define dbg_init() do { i8042_start_time = jiffies; } while (0) |
Joe Perches | 4eb3c30 | 2010-11-29 23:33:07 -0800 | [diff] [blame] | 70 | #define dbg(format, arg...) \ |
| 71 | do { \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | if (i8042_debug) \ |
Joe Perches | 4eb3c30 | 2010-11-29 23:33:07 -0800 | [diff] [blame] | 73 | printk(KERN_DEBUG KBUILD_MODNAME ": [%d] " format, \ |
| 74 | (int) (jiffies - i8042_start_time), ##arg); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | } while (0) |
Stephen Chandler Paul | e1443d2 | 2015-07-15 10:20:17 -0700 | [diff] [blame] | 76 | |
| 77 | #define filter_dbg(filter, data, format, args...) \ |
| 78 | do { \ |
| 79 | if (!i8042_debug) \ |
| 80 | break; \ |
| 81 | \ |
| 82 | if (!filter || i8042_unmask_kbd_data) \ |
| 83 | dbg("%02x " format, data, ##args); \ |
| 84 | else \ |
| 85 | dbg("** " format, ##args); \ |
| 86 | } while (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | #else |
| 88 | #define dbg_init() do { } while (0) |
Joe Perches | 4eb3c30 | 2010-11-29 23:33:07 -0800 | [diff] [blame] | 89 | #define dbg(format, arg...) \ |
| 90 | do { \ |
| 91 | if (0) \ |
| 92 | printk(KERN_DEBUG pr_fmt(format), ##arg); \ |
| 93 | } while (0) |
Stephen Chandler Paul | e1443d2 | 2015-07-15 10:20:17 -0700 | [diff] [blame] | 94 | |
| 95 | #define filter_dbg(filter, data, format, args...) do { } while (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | #endif |
| 97 | |
| 98 | #endif /* _I8042_H */ |