clean up ssc driver
[openwrt.git] / target / linux / etrax / patches / cris / 020-syscalls.patch
1 diff -urN linux-2.6.19.2.orig/include/asm-cris/unistd.h linux-2.6.19.2/include/asm/unistd.h
2 --- linux-2.6.19.2.orig/include/asm-cris/unistd.h 2007-06-16 23:59:11.000000000 +0200
3 +++ linux-2.6.19.2/include/asm/unistd.h 2007-06-17 03:43:10.000000000 +0200
4 @@ -325,9 +325,52 @@
5 #define __NR_getcpu 318
6 #define __NR_epoll_pwait 319
7
8 +#ifdef CONFIG_ETRAX_GPIO
9 + #ifdef CONFIG_FOXBONE
10 + #define __NR_gpiosetbits 320
11 + #define __NR_gpioclearbits 321
12 + #define __NR_gpiosetdir 322
13 + #define __NR_gpiotogglebit 323
14 + #define __NR_gpiogetbits 324
15 + #define __NR_foxboneread 325
16 + #define __NR_foxbonewrite 326
17 + #define __NR_foxbonebulkread 327
18 + #define __NR_foxbonebulkwrite 328
19 + #define __NR_foxbonereset 329
20 + #define __NR_foxboneintreg 330
21 + #define __NR_foxboneintcheck 331
22 + #define __NR_foxboneintwait 332
23 + #define NR_syscalls 333
24 +
25 + #else
26 + #define __NR_gpiosetbits 320
27 + #define __NR_gpioclearbits 321
28 + #define __NR_gpiosetdir 322
29 + #define __NR_gpiotogglebit 323
30 + #define __NR_gpiogetbits 324
31 +
32 + #define NR_syscalls 325
33 + #endif
34 +#else
35 + #ifdef CONFIG_FOXBONE
36 + #define __NR_foxboneread 320
37 + #define __NR_foxbonewrite 321
38 + #define __NR_foxbonebulkread 322
39 + #define __NR_foxbonebulkwrite 323
40 + #define __NR_foxboneintreg 324
41 + #define __NR_foxboneintcheck 325
42 + #define __NR_foxboneintwait 326
43 +
44 + #define NR_syscalls 327
45 +
46 + #else
47 +
48 + #define NR_syscalls 320
49 + #endif
50 +#endif
51 +
52 #ifdef __KERNEL__
53
54 -#define NR_syscalls 320
55
56 #include <asm/arch/unistd.h>
57
58 --- linux-2.6.19.2.orig/include/linux/gpio_syscalls.h 1970-01-01 01:00:00.000000000 +0100
59 +++ linux-2.6.19.2/include/linux/gpio_syscalls.h 2007-06-17 03:44:49.000000000 +0200
60 @@ -0,0 +1,75 @@
61 +#ifndef __LINUX_SYSCALL_GPIO
62 +#define __LINUX_SYSCALL_GPIO
63 +#include <linux/autoconf.h>
64 +#include <linux/kernel.h>
65 +#include <linux/errno.h>
66 +#include <asm/unistd.h>
67 +
68 +// port defines
69 +#define PORTA 'A'
70 +#define PORTB 'B'
71 +#define PORTG 'G'
72 +
73 +//direction defines
74 +#define DIRIN 'I'
75 +#define DIROUT 'O'
76 +
77 +// pin defines for PORTG
78 +#define PG0 (1<<0)
79 +#define PG1 (1<<1)
80 +#define PG2 (1<<2)
81 +#define PG3 (1<<3)
82 +#define PG4 (1<<4)
83 +#define PG5 (1<<5)
84 +#define PG6 (1<<6)
85 +#define PG7 (1<<7)
86 +#define PG8 (1<<8)
87 +#define PG9 (1<<9)
88 +#define PG10 (1<<10)
89 +#define PG11 (1<<11)
90 +#define PG12 (1<<12)
91 +#define PG13 (1<<13)
92 +#define PG14 (1<<14)
93 +#define PG15 (1<<15)
94 +#define PG16 (1<<16)
95 +#define PG17 (1<<17)
96 +#define PG18 (1<<18)
97 +#define PG19 (1<<19)
98 +#define PG20 (1<<20)
99 +#define PG21 (1<<21)
100 +#define PG22 (1<<22)
101 +#define PG23 (1<<23)
102 +#define PG24 (1<<24)
103 +
104 +#define PG8_15 0x00ff00
105 +#define PG16_23 0xff0000
106 +
107 +
108 +// pin defines for PORTA
109 +#define PA0 (1<<0)
110 +#define PA1 (1<<1)
111 +#define PA2 (1<<2)
112 +#define PA3 (1<<3)
113 +#define PA4 (1<<4)
114 +#define PA5 (1<<5)
115 +#define PA6 (1<<6)
116 +#define PA7 (1<<7)
117 +
118 +// pin defines for PORTB
119 +#define PB0 (1<<0)
120 +#define PB1 (1<<1)
121 +#define PB2 (1<<2)
122 +#define PB3 (1<<3)
123 +#define PB4 (1<<4)
124 +#define PB5 (1<<5)
125 +#define PB6 (1<<6)
126 +#define PB7 (1<<7)
127 +
128 +int errno;
129 +_syscall2(void, gpiosetbits, unsigned char, port, unsigned int, bits);
130 +_syscall2(void, gpioclearbits, unsigned char, port, unsigned int, bits);
131 +_syscall3(void, gpiosetdir, unsigned char, port, unsigned char, dir, unsigned int, bits);
132 +_syscall2(void, gpiotogglebit, unsigned char, port, unsigned int, bits);
133 +_syscall2(unsigned int, gpiogetbits, unsigned char, port, unsigned int, bits);
134 +
135 +#endif
136 --- linux-2.6.19.2.orig/arch/cris/arch-v10/kernel/entry.S 2007-06-16 23:58:14.000000000 +0200
137 +++ linux-2.6.19.2/arch/cris/arch-v10/kernel/entry.S 2007-06-17 03:48:21.000000000 +0200
138 @@ -1200,6 +1200,23 @@
139 .long sys_move_pages
140 .long sys_getcpu
141 .long sys_epoll_pwait
142 +#ifdef CONFIG_ETRAX_GPIO
143 + .long sys_gpiosetbits
144 + .long sys_gpioclearbits
145 + .long sys_gpiosetdir
146 + .long sys_gpiotogglebit
147 + .long sys_gpiogetbits
148 +#endif
149 +#ifdef CONFIG_FOXBONE
150 + .long sys_foxboneread
151 + .long sys_foxbonewrite
152 + .long sys_foxbonebulkread
153 + .long sys_foxbonebulkwrite
154 + .long sys_foxbonereset
155 + .long sys_foxboneintreg
156 + .long sys_foxboneintcheck
157 + .long sys_foxboneintwait
158 +#endif
159
160 /*
161 * NOTE!! This doesn't have to be exact - we just have
162 diff linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/Makefile linux-2.6.19.2/arch/cris/arch-v10/drivers/Makefile
163 --- linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/Makefile 2007-06-16 23:58:14.000000000 +0200
164 +++ linux-2.6.19.2/arch/cris/arch-v10/drivers/Makefile 2007-06-17 03:48:21.000000000 +0200
165 8a9
166 > obj-$(CONFIG_ETRAX_GPIO) += gpio_syscalls.o
This page took 0.048885 seconds and 5 git commands to generate.