#include <linux/device.h>
#include <linux/module.h>
#define GFRM100_SEARCH_KEY_REPORT_ID 0xF7
#define GFRM100_SEARCH_KEY_DOWN 0x0
#define GFRM100_SEARCH_KEY_AUDIO_DATA 0x1
#define GFRM100_SEARCH_KEY_UP 0x2
static u8 search_key_dn[3] = {0x40, 0x21, 0x02};
static u8 search_key_up[3] = {0x40, 0x00, 0x00};
static int gfrm_input_mapping(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
unsigned long hdev_type = (unsigned long) hid_get_drvdata(hdev);
if (hdev_type == GFRM100) {
if (usage->hid == (HID_UP_CONSUMER | 0x4)) {
hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_INFO);
if (usage->hid == (HID_UP_CONSUMER | 0x41)) {
hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_OK);
static int gfrm_raw_event(struct hid_device *hdev, struct hid_report *report,
unsigned long hdev_type = (unsigned long) hid_get_drvdata(hdev);
if (hdev_type != GFRM100)
if (size < 2 || data[0] != GFRM100_SEARCH_KEY_REPORT_ID)