diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-11 08:27:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-11 08:27:49 +0000 |
commit | ace9429bb58fd418f0c81d4c2835699bddf6bde6 (patch) | |
tree | b2d64bc10158fdd5497876388cd68142ca374ed3 /drivers/hid/hid-vivaldi.c | |
parent | Initial commit. (diff) | |
download | linux-ace9429bb58fd418f0c81d4c2835699bddf6bde6.tar.xz linux-ace9429bb58fd418f0c81d4c2835699bddf6bde6.zip |
Adding upstream version 6.6.15.upstream/6.6.15
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/hid/hid-vivaldi.c')
-rw-r--r-- | drivers/hid/hid-vivaldi.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/drivers/hid/hid-vivaldi.c b/drivers/hid/hid-vivaldi.c new file mode 100644 index 0000000000..cda5938fb0 --- /dev/null +++ b/drivers/hid/hid-vivaldi.c @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * HID support for Vivaldi Keyboard + * + * Copyright 2020 Google LLC. + * Author: Sean O'Brien <seobrien@chromium.org> + */ + +#include <linux/device.h> +#include <linux/hid.h> +#include <linux/input/vivaldi-fmap.h> +#include <linux/kernel.h> +#include <linux/module.h> + +#include "hid-vivaldi-common.h" + +static int vivaldi_probe(struct hid_device *hdev, + const struct hid_device_id *id) +{ + struct vivaldi_data *drvdata; + int ret; + + drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL); + if (!drvdata) + return -ENOMEM; + + hid_set_drvdata(hdev, drvdata); + + ret = hid_parse(hdev); + if (ret) + return ret; + + return hid_hw_start(hdev, HID_CONNECT_DEFAULT); +} + +static const struct hid_device_id vivaldi_table[] = { + { HID_DEVICE(HID_BUS_ANY, HID_GROUP_VIVALDI, HID_ANY_ID, HID_ANY_ID) }, + { } +}; + +MODULE_DEVICE_TABLE(hid, vivaldi_table); + +static struct hid_driver hid_vivaldi = { + .name = "hid-vivaldi", + .id_table = vivaldi_table, + .probe = vivaldi_probe, + .feature_mapping = vivaldi_feature_mapping, + .driver = { + .dev_groups = vivaldi_attribute_groups, + }, +}; + +module_hid_driver(hid_vivaldi); + +MODULE_AUTHOR("Sean O'Brien"); +MODULE_DESCRIPTION("HID vivaldi driver"); +MODULE_LICENSE("GPL"); |