aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorGuanXuetao <gxt@mprc.pku.edu.cn>2011-02-18 05:38:33 -0500
committerGuanXuetao <gxt@mprc.pku.edu.cn>2011-03-16 21:19:18 -0400
commit3838b82c0a6806daf820acacf02cd9aefe9df7b8 (patch)
treed3c1c29009b670298d7f18dd6e164421af3eda05 /drivers/input/serio
parentbd42aa75b4231b5fd3742de4c4b84ad590a7d654 (diff)
unicore32 i8042: adjust io funcs of i8042-unicore32io.h
replace inb/outb with readb/writeb in i8042-unicore32io.h and correct typecasting of register and region macros -- by advice with Arnd Bergmann Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/i8042-unicore32io.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/input/serio/i8042-unicore32io.h b/drivers/input/serio/i8042-unicore32io.h
index 6a7e8b3ce61a..2cdd8726446f 100644
--- a/drivers/input/serio/i8042-unicore32io.h
+++ b/drivers/input/serio/i8042-unicore32io.h
@@ -29,33 +29,36 @@
29/* 29/*
30 * Register numbers. 30 * Register numbers.
31 */ 31 */
32#define I8042_COMMAND_REG ((unsigned long)&PS2_COMMAND) 32#define I8042_COMMAND_REG ((volatile void __iomem *)&PS2_COMMAND)
33#define I8042_STATUS_REG ((unsigned long)&PS2_STATUS) 33#define I8042_STATUS_REG ((volatile void __iomem *)&PS2_STATUS)
34#define I8042_DATA_REG ((unsigned long)&PS2_DATA) 34#define I8042_DATA_REG ((volatile void __iomem *)&PS2_DATA)
35
36#define I8042_REGION_START (resource_size_t)(&PS2_DATA)
37#define I8042_REGION_SIZE (resource_size_t)(16)
35 38
36static inline int i8042_read_data(void) 39static inline int i8042_read_data(void)
37{ 40{
38 return inb(I8042_DATA_REG); 41 return readb(I8042_DATA_REG);
39} 42}
40 43
41static inline int i8042_read_status(void) 44static inline int i8042_read_status(void)
42{ 45{
43 return inb(I8042_STATUS_REG); 46 return readb(I8042_STATUS_REG);
44} 47}
45 48
46static inline void i8042_write_data(int val) 49static inline void i8042_write_data(int val)
47{ 50{
48 outb(val, I8042_DATA_REG); 51 writeb(val, I8042_DATA_REG);
49} 52}
50 53
51static inline void i8042_write_command(int val) 54static inline void i8042_write_command(int val)
52{ 55{
53 outb(val, I8042_COMMAND_REG); 56 writeb(val, I8042_COMMAND_REG);
54} 57}
55 58
56static inline int i8042_platform_init(void) 59static inline int i8042_platform_init(void)
57{ 60{
58 if (!request_region(I8042_DATA_REG, 16, "i8042")) 61 if (!request_region(I8042_REGION_START, I8042_REGION_SIZE, "i8042"))
59 return -EBUSY; 62 return -EBUSY;
60 63
61 i8042_reset = 1; 64 i8042_reset = 1;
@@ -64,7 +67,7 @@ static inline int i8042_platform_init(void)
64 67
65static inline void i8042_platform_exit(void) 68static inline void i8042_platform_exit(void)
66{ 69{
67 release_region(I8042_DATA_REG, 16); 70 release_region(I8042_REGION_START, I8042_REGION_SIZE);
68} 71}
69 72
70#endif /* _I8042_UNICORE32_H */ 73#endif /* _I8042_UNICORE32_H */