1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef _I8042_JAZZ_H
3 #define _I8042_JAZZ_H
4 
5 #include <asm/jazz.h>
6 
7 
8 /*
9  * Names.
10  */
11 
12 #define I8042_KBD_PHYS_DESC "R4030/serio0"
13 #define I8042_AUX_PHYS_DESC "R4030/serio1"
14 #define I8042_MUX_PHYS_DESC "R4030/serio%d"
15 
16 /*
17  * IRQs.
18  */
19 
20 #define I8042_KBD_IRQ JAZZ_KEYBOARD_IRQ
21 #define I8042_AUX_IRQ JAZZ_MOUSE_IRQ
22 
23 #define I8042_COMMAND_REG	((unsigned long)&jazz_kh->command)
24 #define I8042_STATUS_REG	((unsigned long)&jazz_kh->command)
25 #define I8042_DATA_REG		((unsigned long)&jazz_kh->data)
26 
27 static inline int i8042_read_data(void)
28 {
29 	return jazz_kh->data;
30 }
31 
32 static inline int i8042_read_status(void)
33 {
34 	return jazz_kh->command;
35 }
36 
37 static inline void i8042_write_data(int val)
38 {
39 	jazz_kh->data = val;
40 }
41 
42 static inline void i8042_write_command(int val)
43 {
44 	jazz_kh->command = val;
45 }
46 
47 static inline int i8042_platform_init(void)
48 {
49 #if 0
50 	/* XXX JAZZ_KEYBOARD_ADDRESS is a virtual address */
51 	if (!request_mem_region(JAZZ_KEYBOARD_ADDRESS, 2, "i8042"))
52 		return -EBUSY;
53 #endif
54 
55 	return 0;
56 }
57 
58 static inline void i8042_platform_exit(void)
59 {
60 #if 0
61 	release_mem_region(JAZZ_KEYBOARD_ADDRESS, 2);
62 #endif
63 }
64 
65 #endif /* _I8042_JAZZ_H */
66