diff options
author | GuanXuetao <gxt@mprc.pku.edu.cn> | 2011-01-15 05:28:19 -0500 |
---|---|---|
committer | GuanXuetao <gxt@mprc.pku.edu.cn> | 2011-03-16 21:19:15 -0400 |
commit | 425ad52b86d9710719b3aa811d6cab56b3852981 (patch) | |
tree | e1de025046d8c242309683b223e8991f6682a6bb | |
parent | 700598cef866011b878f389c30414d31fa5bb87b (diff) |
unicore32 machine related files: ps2 driver
This patch implements arch-specific ps2 driver.
By reviewed with Dmitry Torokhov:
1. move i8042-ucio.h to drivers/input/serio/i8042-unicore32io.h
2. move puv3_ps2_init() to arch/unicore32/kernel/puv3-core.c
3. remove unused comments.
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r-- | drivers/input/serio/i8042-unicore32io.h | 70 | ||||
-rw-r--r-- | drivers/input/serio/i8042.h | 2 |
2 files changed, 72 insertions, 0 deletions
diff --git a/drivers/input/serio/i8042-unicore32io.h b/drivers/input/serio/i8042-unicore32io.h new file mode 100644 index 000000000000..6a7e8b3ce61a --- /dev/null +++ b/drivers/input/serio/i8042-unicore32io.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * Code specific to PKUnity SoC and UniCore ISA | ||
3 | * | ||
4 | * Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn> | ||
5 | * Copyright (C) 2001-2011 Guan Xuetao | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef _I8042_UNICORE32_H | ||
12 | #define _I8042_UNICORE32_H | ||
13 | |||
14 | #include <mach/hardware.h> | ||
15 | |||
16 | /* | ||
17 | * Names. | ||
18 | */ | ||
19 | #define I8042_KBD_PHYS_DESC "isa0060/serio0" | ||
20 | #define I8042_AUX_PHYS_DESC "isa0060/serio1" | ||
21 | #define I8042_MUX_PHYS_DESC "isa0060/serio%d" | ||
22 | |||
23 | /* | ||
24 | * IRQs. | ||
25 | */ | ||
26 | #define I8042_KBD_IRQ IRQ_PS2_KBD | ||
27 | #define I8042_AUX_IRQ IRQ_PS2_AUX | ||
28 | |||
29 | /* | ||
30 | * Register numbers. | ||
31 | */ | ||
32 | #define I8042_COMMAND_REG ((unsigned long)&PS2_COMMAND) | ||
33 | #define I8042_STATUS_REG ((unsigned long)&PS2_STATUS) | ||
34 | #define I8042_DATA_REG ((unsigned long)&PS2_DATA) | ||
35 | |||
36 | static inline int i8042_read_data(void) | ||
37 | { | ||
38 | return inb(I8042_DATA_REG); | ||
39 | } | ||
40 | |||
41 | static inline int i8042_read_status(void) | ||
42 | { | ||
43 | return inb(I8042_STATUS_REG); | ||
44 | } | ||
45 | |||
46 | static inline void i8042_write_data(int val) | ||
47 | { | ||
48 | outb(val, I8042_DATA_REG); | ||
49 | } | ||
50 | |||
51 | static inline void i8042_write_command(int val) | ||
52 | { | ||
53 | outb(val, I8042_COMMAND_REG); | ||
54 | } | ||
55 | |||
56 | static inline int i8042_platform_init(void) | ||
57 | { | ||
58 | if (!request_region(I8042_DATA_REG, 16, "i8042")) | ||
59 | return -EBUSY; | ||
60 | |||
61 | i8042_reset = 1; | ||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | static inline void i8042_platform_exit(void) | ||
66 | { | ||
67 | release_region(I8042_DATA_REG, 16); | ||
68 | } | ||
69 | |||
70 | #endif /* _I8042_UNICORE32_H */ | ||
diff --git a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h index ac1d759d0f55..3452708fbe3b 100644 --- a/drivers/input/serio/i8042.h +++ b/drivers/input/serio/i8042.h | |||
@@ -26,6 +26,8 @@ | |||
26 | #include "i8042-sparcio.h" | 26 | #include "i8042-sparcio.h" |
27 | #elif defined(CONFIG_X86) || defined(CONFIG_IA64) | 27 | #elif defined(CONFIG_X86) || defined(CONFIG_IA64) |
28 | #include "i8042-x86ia64io.h" | 28 | #include "i8042-x86ia64io.h" |
29 | #elif defined(CONFIG_UNICORE32) | ||
30 | #include "i8042-unicore32io.h" | ||
29 | #else | 31 | #else |
30 | #include "i8042-io.h" | 32 | #include "i8042-io.h" |
31 | #endif | 33 | #endif |