Go to the documentation of this file. 1 #ifndef __HID_WIIMOTE_H
2 #define __HID_WIIMOTE_H
17 #include <linux/device.h>
18 #include <linux/hid.h>
19 #include <linux/input.h>
21 #include <linux/module.h>
26 #define WIIMOTE_NAME "Nintendo Wii Remote"
27 #define WIIMOTE_BUFSIZE 32
29 #define WIIPROTO_FLAG_LED1 0x01
30 #define WIIPROTO_FLAG_LED2 0x02
31 #define WIIPROTO_FLAG_LED3 0x04
32 #define WIIPROTO_FLAG_LED4 0x08
33 #define WIIPROTO_FLAG_RUMBLE 0x10
34 #define WIIPROTO_FLAG_ACCEL 0x20
35 #define WIIPROTO_FLAG_IR_BASIC 0x40
36 #define WIIPROTO_FLAG_IR_EXT 0x80
37 #define WIIPROTO_FLAG_IR_FULL 0xc0
38 #define WIIPROTO_FLAGS_LEDS (WIIPROTO_FLAG_LED1 | WIIPROTO_FLAG_LED2 | \
39 WIIPROTO_FLAG_LED3 | WIIPROTO_FLAG_LED4)
40 #define WIIPROTO_FLAGS_IR (WIIPROTO_FLAG_IR_BASIC | WIIPROTO_FLAG_IR_EXT | \
41 WIIPROTO_FLAG_IR_FULL)
44 #define WIIPROTO_FLAG_LED(num) (WIIPROTO_FLAG_LED1 << (num - 1))
116 #define dev_to_wii(pdev) hid_get_drvdata(container_of(pdev, struct hid_device, \
125 #define wiiproto_req_rreg(wdata, os, sz) \
126 wiiproto_req_rmem((wdata), false, (os), (sz))
127 #define wiiproto_req_reeprom(wdata, os, sz) \
128 wiiproto_req_rmem((wdata), true, (os), (sz))
132 #ifdef CONFIG_HID_WIIMOTE_EXT
150 #ifdef CONFIG_DEBUG_FS
163 static inline bool wiimote_cmd_pending(
struct wiimote_data *wdata,
int cmd,
170 static inline void wiimote_cmd_complete(
struct wiimote_data *wdata)
176 static inline int wiimote_cmd_acquire(
struct wiimote_data *wdata)
182 static inline void wiimote_cmd_set(
struct wiimote_data *wdata,
int cmd,
190 static inline void wiimote_cmd_release(
struct wiimote_data *wdata)
195 static inline int wiimote_cmd_wait(
struct wiimote_data *wdata)