File tree Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 1
- MODULE:= rtmouse
1
+ MODULE:= rtmouse_mod
2
+ DESIRED_MODULE:= rtmouse
2
3
obj-m:= $(MODULE).o
4
+ $(MODULE)-objs := rtmouse.o spi_lib.o
3
5
clean-files:= *.o *.ko *.mod.[co] *~
4
6
5
7
LINUX_SRC_DIR:=/usr/src/linux-headers-$(shell uname -r)
6
8
VERBOSE:=0
7
9
8
- rtmouse.ko: rtmouse.c
10
+ all:
9
11
make -C $(LINUX_SRC_DIR) M=$(shell pwd) V=$(VERBOSE) modules
12
+ mv $(MODULE).ko $(DESIRED_MODULE).ko
10
13
11
14
clean:
12
15
make -C $(LINUX_SRC_DIR) M=$(shell pwd) V=$(VERBOSE) clean
13
16
14
- install: rtmouse .ko
17
+ install: $(DESIRED_MODULE) .ko
15
18
cp ../../50-rtmouse.rules /etc/udev/rules.d/
16
19
17
20
uninstall:
Original file line number Diff line number Diff line change 51
51
// Raspberry Pi 2 B : 2
52
52
// Raspberry Pi 3 B/A+/B+ : 2
53
53
// Raspberry Pi 4 B : 4
54
- #define RASPBERRYPI 2
54
+ #define RASPBERRYPI 4
55
55
56
56
MODULE_AUTHOR ("RT Corporation" );
57
57
MODULE_LICENSE ("GPL" );
@@ -87,6 +87,10 @@ MODULE_DESCRIPTION("Raspberry Pi Mouse device driver");
87
87
88
88
#define DRIVER_NAME "rtmouse"
89
89
90
+ /* --- Declare External Functions --- */
91
+ extern struct spi_controller * spi_busnum_to_master (int bus_num );
92
+
93
+
90
94
/* --- Device Major and Minor Numbers --- */
91
95
#define DEV_MAJOR 0
92
96
#define DEV_MINOR 0
@@ -425,7 +429,7 @@ static int motor_motion_pop(t_motor_motion **ret)
425
429
426
430
if (motor_motion_tail == motor_motion_head ) {
427
431
return -1 ;
428
- }
432
+ }/ home / ubuntu /. ssh
429
433
430
434
if (next_head >= MAX_MOTORBUFLEN ) {
431
435
next_head = 0 ;
Original file line number Diff line number Diff line change
1
+
2
+ #include <linux/spi/spi.h>
3
+
4
+
5
+
6
+ struct spi_controller * spi_busnum_to_master (int bus_num )
7
+ {
8
+ // struct device *dev;
9
+ struct spi_controller * ctlr = NULL ;
10
+
11
+ // dev = class_find_device(&spi_master_class, NULL, &bus_num,
12
+ // __spi_controller_match);
13
+ // if (dev)
14
+ // ctlr = container_of(dev, struct spi_controller, dev);
15
+ // /* reference got in class_find_device */
16
+ return ctlr ;
17
+ }
You can’t perform that action at this time.
0 commit comments