1 // SPDX-License-Identifier: GPL-2.0
3 * HID support for Vivaldi Keyboard
5 * Copyright 2020 Google LLC.
6 * Author: Sean O'Brien <seobrien@chromium.org>
9 #include <linux/device.h>
10 #include <linux/hid.h>
11 #include <linux/input/vivaldi-fmap.h>
12 #include <linux/kernel.h>
13 #include <linux/module.h>
15 #include "hid-vivaldi-common.h"
17 static int vivaldi_probe(struct hid_device *hdev,
18 const struct hid_device_id *id)
20 struct vivaldi_data *drvdata;
23 drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
27 hid_set_drvdata(hdev, drvdata);
29 ret = hid_parse(hdev);
33 return hid_hw_start(hdev, HID_CONNECT_DEFAULT);
36 static const struct hid_device_id vivaldi_table[] = {
37 { HID_DEVICE(HID_BUS_ANY, HID_GROUP_VIVALDI, HID_ANY_ID, HID_ANY_ID) },
41 MODULE_DEVICE_TABLE(hid, vivaldi_table);
43 static struct hid_driver hid_vivaldi = {
44 .name = "hid-vivaldi",
45 .id_table = vivaldi_table,
46 .probe = vivaldi_probe,
47 .feature_mapping = vivaldi_feature_mapping,
49 .dev_groups = vivaldi_attribute_groups,
53 module_hid_driver(hid_vivaldi);
55 MODULE_AUTHOR("Sean O'Brien");
56 MODULE_DESCRIPTION("HID vivaldi driver");
57 MODULE_LICENSE("GPL");