Skip to content

Commit 8cb3746

Browse files
bentissJiri Kosina
authored andcommitted
HID: logitech-dj: merge header file into the source
There is no point in keeping the header in a separate file, nobody but hid-logitech-dj should have access to its content. Signed-off-by: Benjamin Tissoires <[email protected]> Tested-by: Andrew de los Reyes <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent d610274 commit 8cb3746

File tree

2 files changed

+87
-116
lines changed

2 files changed

+87
-116
lines changed

drivers/hid/hid-logitech-dj.c

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,95 @@
2626
#include <linux/hid.h>
2727
#include <linux/module.h>
2828
#include <linux/usb.h>
29+
#include <linux/kfifo.h>
2930
#include <asm/unaligned.h>
3031
#include "hid-ids.h"
31-
#include "hid-logitech-dj.h"
32+
33+
#define DJ_MAX_PAIRED_DEVICES 6
34+
#define DJ_MAX_NUMBER_NOTIFICATIONS 8
35+
#define DJ_RECEIVER_INDEX 0
36+
#define DJ_DEVICE_INDEX_MIN 1
37+
#define DJ_DEVICE_INDEX_MAX 6
38+
39+
#define DJREPORT_SHORT_LENGTH 15
40+
#define DJREPORT_LONG_LENGTH 32
41+
42+
#define REPORT_ID_DJ_SHORT 0x20
43+
#define REPORT_ID_DJ_LONG 0x21
44+
45+
#define REPORT_TYPE_RFREPORT_LAST 0x1F
46+
47+
/* Command Switch to DJ mode */
48+
#define REPORT_TYPE_CMD_SWITCH 0x80
49+
#define CMD_SWITCH_PARAM_DEVBITFIELD 0x00
50+
#define CMD_SWITCH_PARAM_TIMEOUT_SECONDS 0x01
51+
#define TIMEOUT_NO_KEEPALIVE 0x00
52+
53+
/* Command to Get the list of Paired devices */
54+
#define REPORT_TYPE_CMD_GET_PAIRED_DEVICES 0x81
55+
56+
/* Device Paired Notification */
57+
#define REPORT_TYPE_NOTIF_DEVICE_PAIRED 0x41
58+
#define SPFUNCTION_MORE_NOTIF_EXPECTED 0x01
59+
#define SPFUNCTION_DEVICE_LIST_EMPTY 0x02
60+
#define DEVICE_PAIRED_PARAM_SPFUNCTION 0x00
61+
#define DEVICE_PAIRED_PARAM_EQUAD_ID_LSB 0x01
62+
#define DEVICE_PAIRED_PARAM_EQUAD_ID_MSB 0x02
63+
#define DEVICE_PAIRED_RF_REPORT_TYPE 0x03
64+
65+
/* Device Un-Paired Notification */
66+
#define REPORT_TYPE_NOTIF_DEVICE_UNPAIRED 0x40
67+
68+
69+
/* Connection Status Notification */
70+
#define REPORT_TYPE_NOTIF_CONNECTION_STATUS 0x42
71+
#define CONNECTION_STATUS_PARAM_STATUS 0x00
72+
#define STATUS_LINKLOSS 0x01
73+
74+
/* Error Notification */
75+
#define REPORT_TYPE_NOTIF_ERROR 0x7F
76+
#define NOTIF_ERROR_PARAM_ETYPE 0x00
77+
#define ETYPE_KEEPALIVE_TIMEOUT 0x01
78+
79+
/* supported DJ HID && RF report types */
80+
#define REPORT_TYPE_KEYBOARD 0x01
81+
#define REPORT_TYPE_MOUSE 0x02
82+
#define REPORT_TYPE_CONSUMER_CONTROL 0x03
83+
#define REPORT_TYPE_SYSTEM_CONTROL 0x04
84+
#define REPORT_TYPE_MEDIA_CENTER 0x08
85+
#define REPORT_TYPE_LEDS 0x0E
86+
87+
/* RF Report types bitfield */
88+
#define STD_KEYBOARD 0x00000002
89+
#define STD_MOUSE 0x00000004
90+
#define MULTIMEDIA 0x00000008
91+
#define POWER_KEYS 0x00000010
92+
#define MEDIA_CENTER 0x00000100
93+
#define KBD_LEDS 0x00004000
94+
95+
struct dj_report {
96+
u8 report_id;
97+
u8 device_index;
98+
u8 report_type;
99+
u8 report_params[DJREPORT_SHORT_LENGTH - 3];
100+
};
101+
102+
struct dj_receiver_dev {
103+
struct hid_device *hdev;
104+
struct dj_device *paired_dj_devices[DJ_MAX_PAIRED_DEVICES +
105+
DJ_DEVICE_INDEX_MIN];
106+
struct work_struct work;
107+
struct kfifo notif_fifo;
108+
spinlock_t lock;
109+
bool querying_devices;
110+
};
111+
112+
struct dj_device {
113+
struct hid_device *hdev;
114+
struct dj_receiver_dev *dj_receiver_dev;
115+
u32 reports_supported;
116+
u8 device_index;
117+
};
32118

33119
/* Keyboard descriptor (1) */
34120
static const char kbd_descriptor[] = {

drivers/hid/hid-logitech-dj.h

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)