@@ -139,6 +139,99 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev,
139
139
return 1 ;
140
140
}
141
141
142
+ static int samsung_kbd_input_mapping (struct hid_device * hdev ,
143
+ struct hid_input * hi , struct hid_field * field , struct hid_usage * usage ,
144
+ unsigned long * * bit , int * max )
145
+ {
146
+ if (!(HID_UP_CONSUMER == (usage -> hid & HID_USAGE_PAGE ) ||
147
+ HID_UP_KEYBOARD == (usage -> hid & HID_USAGE_PAGE )))
148
+ return 0 ;
149
+
150
+ dbg_hid ("samsung wireless keyboard input mapping event [0x%x]\n" ,
151
+ usage -> hid & HID_USAGE );
152
+
153
+ if (HID_UP_KEYBOARD == (usage -> hid & HID_USAGE_PAGE )) {
154
+ set_bit (EV_REP , hi -> input -> evbit );
155
+ switch (usage -> hid & HID_USAGE ) {
156
+ case 0x32 :
157
+ samsung_kbd_mouse_map_key_clear (KEY_BACKSLASH );
158
+ break ;
159
+ case 0x64 :
160
+ samsung_kbd_mouse_map_key_clear (KEY_102ND );
161
+ break ;
162
+ /* Only for BR keyboard */
163
+ case 0x87 :
164
+ samsung_kbd_mouse_map_key_clear (KEY_RO );
165
+ break ;
166
+ default :
167
+ return 0 ;
168
+ }
169
+ }
170
+
171
+ if (HID_UP_CONSUMER == (usage -> hid & HID_USAGE_PAGE )) {
172
+ switch (usage -> hid & HID_USAGE ) {
173
+ /* report 2 */
174
+ /* MENU */
175
+ case 0x040 :
176
+ samsung_kbd_mouse_map_key_clear (KEY_MENU );
177
+ break ;
178
+ case 0x18a :
179
+ samsung_kbd_mouse_map_key_clear (KEY_MAIL );
180
+ break ;
181
+ case 0x196 :
182
+ samsung_kbd_mouse_map_key_clear (KEY_WWW );
183
+ break ;
184
+ case 0x19e :
185
+ samsung_kbd_mouse_map_key_clear (KEY_SCREENLOCK );
186
+ break ;
187
+ case 0x221 :
188
+ samsung_kbd_mouse_map_key_clear (KEY_SEARCH );
189
+ break ;
190
+ case 0x223 :
191
+ samsung_kbd_mouse_map_key_clear (KEY_HOMEPAGE );
192
+ break ;
193
+ /* Smtart Voice Key */
194
+ case 0x300 :
195
+ samsung_kbd_mouse_map_key_clear (BTN_TRIGGER_HAPPY13 );
196
+ break ;
197
+ /* RECENTAPPS */
198
+ case 0x301 :
199
+ samsung_kbd_mouse_map_key_clear (BTN_TRIGGER_HAPPY1 );
200
+ break ;
201
+ /* APPLICATION */
202
+ case 0x302 :
203
+ samsung_kbd_mouse_map_key_clear (BTN_TRIGGER_HAPPY2 );
204
+ break ;
205
+ /* Voice search */
206
+ case 0x305 :
207
+ samsung_kbd_mouse_map_key_clear (BTN_TRIGGER_HAPPY4 );
208
+ break ;
209
+ /* QPANEL on/off */
210
+ case 0x306 :
211
+ samsung_kbd_mouse_map_key_clear (BTN_TRIGGER_HAPPY5 );
212
+ break ;
213
+ /* SIP on/off */
214
+ case 0x307 :
215
+ samsung_kbd_mouse_map_key_clear (BTN_TRIGGER_HAPPY3 );
216
+ break ;
217
+ /* LANG */
218
+ case 0x308 :
219
+ samsung_kbd_mouse_map_key_clear (KEY_LANGUAGE );
220
+ break ;
221
+ case 0x30a :
222
+ samsung_kbd_mouse_map_key_clear (KEY_BRIGHTNESSDOWN );
223
+ break ;
224
+ case 0x30b :
225
+ samsung_kbd_mouse_map_key_clear (KEY_BRIGHTNESSUP );
226
+ break ;
227
+ default :
228
+ return 0 ;
229
+ }
230
+ }
231
+
232
+ return 1 ;
233
+ }
234
+
142
235
static __u8 * samsung_report_fixup (struct hid_device * hdev , __u8 * rdesc ,
143
236
unsigned int * rsize )
144
237
{
@@ -156,6 +249,9 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi,
156
249
if (hdev -> product == USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE && hid_is_usb (hdev ))
157
250
ret = samsung_kbd_mouse_input_mapping (hdev ,
158
251
hi , field , usage , bit , max );
252
+ else if (hdev -> product == USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD )
253
+ ret = samsung_kbd_input_mapping (hdev ,
254
+ hi , field , usage , bit , max );
159
255
160
256
return ret ;
161
257
}
@@ -198,6 +294,7 @@ static int samsung_probe(struct hid_device *hdev,
198
294
static const struct hid_device_id samsung_devices [] = {
199
295
{ HID_USB_DEVICE (USB_VENDOR_ID_SAMSUNG , USB_DEVICE_ID_SAMSUNG_IR_REMOTE ) },
200
296
{ HID_USB_DEVICE (USB_VENDOR_ID_SAMSUNG , USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE ) },
297
+ { HID_BLUETOOTH_DEVICE (USB_VENDOR_ID_SAMSUNG_ELECTRONICS , USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD ) },
201
298
{ }
202
299
};
203
300
MODULE_DEVICE_TABLE (hid , samsung_devices );
0 commit comments