11da177e4SLinus Torvalds #ifndef _I8042_JAZZ_H
21da177e4SLinus Torvalds #define _I8042_JAZZ_H
31da177e4SLinus Torvalds 
41da177e4SLinus Torvalds #include <asm/jazz.h>
51da177e4SLinus Torvalds 
61da177e4SLinus Torvalds /*
71da177e4SLinus Torvalds  * This program is free software; you can redistribute it and/or modify it
81da177e4SLinus Torvalds  * under the terms of the GNU General Public License version 2 as published by
91da177e4SLinus Torvalds  * the Free Software Foundation.
101da177e4SLinus Torvalds  */
111da177e4SLinus Torvalds 
121da177e4SLinus Torvalds /*
131da177e4SLinus Torvalds  * Names.
141da177e4SLinus Torvalds  */
151da177e4SLinus Torvalds 
161da177e4SLinus Torvalds #define I8042_KBD_PHYS_DESC "R4030/serio0"
171da177e4SLinus Torvalds #define I8042_AUX_PHYS_DESC "R4030/serio1"
181da177e4SLinus Torvalds #define I8042_MUX_PHYS_DESC "R4030/serio%d"
191da177e4SLinus Torvalds 
201da177e4SLinus Torvalds /*
211da177e4SLinus Torvalds  * IRQs.
221da177e4SLinus Torvalds  */
231da177e4SLinus Torvalds 
241da177e4SLinus Torvalds #define I8042_KBD_IRQ JAZZ_KEYBOARD_IRQ
251da177e4SLinus Torvalds #define I8042_AUX_IRQ JAZZ_MOUSE_IRQ
261da177e4SLinus Torvalds 
271da177e4SLinus Torvalds #define I8042_COMMAND_REG	((unsigned long)&jazz_kh->command)
281da177e4SLinus Torvalds #define I8042_STATUS_REG	((unsigned long)&jazz_kh->command)
291da177e4SLinus Torvalds #define I8042_DATA_REG		((unsigned long)&jazz_kh->data)
301da177e4SLinus Torvalds 
311da177e4SLinus Torvalds static inline int i8042_read_data(void)
321da177e4SLinus Torvalds {
331da177e4SLinus Torvalds 	return jazz_kh->data;
341da177e4SLinus Torvalds }
351da177e4SLinus Torvalds 
361da177e4SLinus Torvalds static inline int i8042_read_status(void)
371da177e4SLinus Torvalds {
381da177e4SLinus Torvalds 	return jazz_kh->command;
391da177e4SLinus Torvalds }
401da177e4SLinus Torvalds 
411da177e4SLinus Torvalds static inline void i8042_write_data(int val)
421da177e4SLinus Torvalds {
431da177e4SLinus Torvalds 	jazz_kh->data = val;
441da177e4SLinus Torvalds }
451da177e4SLinus Torvalds 
461da177e4SLinus Torvalds static inline void i8042_write_command(int val)
471da177e4SLinus Torvalds {
481da177e4SLinus Torvalds 	jazz_kh->command = val;
491da177e4SLinus Torvalds }
501da177e4SLinus Torvalds 
511da177e4SLinus Torvalds static inline int i8042_platform_init(void)
521da177e4SLinus Torvalds {
531da177e4SLinus Torvalds #if 0
541da177e4SLinus Torvalds 	/* XXX JAZZ_KEYBOARD_ADDRESS is a virtual address */
551da177e4SLinus Torvalds 	if (!request_mem_region(JAZZ_KEYBOARD_ADDRESS, 2, "i8042"))
568d5987a6SDmitry Torokhov 		return -EBUSY;
571da177e4SLinus Torvalds #endif
581da177e4SLinus Torvalds 
591da177e4SLinus Torvalds 	return 0;
601da177e4SLinus Torvalds }
611da177e4SLinus Torvalds 
621da177e4SLinus Torvalds static inline void i8042_platform_exit(void)
631da177e4SLinus Torvalds {
641da177e4SLinus Torvalds #if 0
651da177e4SLinus Torvalds 	release_mem_region(JAZZ_KEYBOARD_ADDRESS, 2);
661da177e4SLinus Torvalds #endif
671da177e4SLinus Torvalds }
681da177e4SLinus Torvalds 
691da177e4SLinus Torvalds #endif /* _I8042_JAZZ_H */
70