| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ihidev.c,v 1.14 2021/01/25 13:30:20 thorpej Exp $ */ | | 1 | /* $NetBSD: ihidev.c,v 1.15 2021/01/26 01:15:39 thorpej Exp $ */ |
2 | /* $OpenBSD ihidev.c,v 1.13 2017/04/08 02:57:23 deraadt Exp $ */ | | 2 | /* $OpenBSD ihidev.c,v 1.13 2017/04/08 02:57:23 deraadt Exp $ */ |
3 | | | 3 | |
4 | /*- | | 4 | /*- |
5 | * Copyright (c) 2017 The NetBSD Foundation, Inc. | | 5 | * Copyright (c) 2017 The NetBSD Foundation, Inc. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * This code is derived from software contributed to The NetBSD Foundation | | 8 | * This code is derived from software contributed to The NetBSD Foundation |
9 | * by Manuel Bouyer. | | 9 | * by Manuel Bouyer. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -44,27 +44,27 @@ | | | @@ -44,27 +44,27 @@ |
44 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | | 44 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
45 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | | 45 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
46 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | | 46 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
47 | */ | | 47 | */ |
48 | | | 48 | |
49 | /* | | 49 | /* |
50 | * HID-over-i2c driver | | 50 | * HID-over-i2c driver |
51 | * | | 51 | * |
52 | * https://msdn.microsoft.com/en-us/library/windows/hardware/dn642101%28v=vs.85%29.aspx | | 52 | * https://msdn.microsoft.com/en-us/library/windows/hardware/dn642101%28v=vs.85%29.aspx |
53 | * | | 53 | * |
54 | */ | | 54 | */ |
55 | | | 55 | |
56 | #include <sys/cdefs.h> | | 56 | #include <sys/cdefs.h> |
57 | __KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.14 2021/01/25 13:30:20 thorpej Exp $"); | | 57 | __KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.15 2021/01/26 01:15:39 thorpej Exp $"); |
58 | | | 58 | |
59 | #include <sys/param.h> | | 59 | #include <sys/param.h> |
60 | #include <sys/systm.h> | | 60 | #include <sys/systm.h> |
61 | #include <sys/device.h> | | 61 | #include <sys/device.h> |
62 | #include <sys/kmem.h> | | 62 | #include <sys/kmem.h> |
63 | | | 63 | |
64 | | | 64 | |
65 | #include <dev/i2c/i2cvar.h> | | 65 | #include <dev/i2c/i2cvar.h> |
66 | #include <dev/i2c/ihidev.h> | | 66 | #include <dev/i2c/ihidev.h> |
67 | | | 67 | |
68 | #include <dev/hid/hid.h> | | 68 | #include <dev/hid/hid.h> |
69 | | | 69 | |
70 | #if defined(__i386__) || defined(__amd64__) | | 70 | #if defined(__i386__) || defined(__amd64__) |
| @@ -116,28 +116,26 @@ static void ihiddev_intr_fini(struct ihi | | | @@ -116,28 +116,26 @@ static void ihiddev_intr_fini(struct ihi |
116 | static bool ihidev_suspend(device_t, const pmf_qual_t *); | | 116 | static bool ihidev_suspend(device_t, const pmf_qual_t *); |
117 | static bool ihidev_resume(device_t, const pmf_qual_t *); | | 117 | static bool ihidev_resume(device_t, const pmf_qual_t *); |
118 | static int ihidev_hid_command(struct ihidev_softc *, int, void *, bool); | | 118 | static int ihidev_hid_command(struct ihidev_softc *, int, void *, bool); |
119 | static int ihidev_intr(void *); | | 119 | static int ihidev_intr(void *); |
120 | static void ihidev_softintr(void *); | | 120 | static void ihidev_softintr(void *); |
121 | static int ihidev_reset(struct ihidev_softc *, bool); | | 121 | static int ihidev_reset(struct ihidev_softc *, bool); |
122 | static int ihidev_hid_desc_parse(struct ihidev_softc *); | | 122 | static int ihidev_hid_desc_parse(struct ihidev_softc *); |
123 | | | 123 | |
124 | static int ihidev_maxrepid(void *, int); | | 124 | static int ihidev_maxrepid(void *, int); |
125 | static int ihidev_print(void *, const char *); | | 125 | static int ihidev_print(void *, const char *); |
126 | static int ihidev_submatch(device_t, cfdata_t, const int *, void *); | | 126 | static int ihidev_submatch(device_t, cfdata_t, const int *, void *); |
127 | | | 127 | |
128 | static const struct device_compatible_entry compat_data[] = { | | 128 | static const struct device_compatible_entry compat_data[] = { |
129 | { .compat = "PNP0C50" }, | | | |
130 | { .compat = "ACPI0C50" }, | | | |
131 | { .compat = "hid-over-i2c" }, | | 129 | { .compat = "hid-over-i2c" }, |
132 | { } | | 130 | { } |
133 | }; | | 131 | }; |
134 | | | 132 | |
135 | static int | | 133 | static int |
136 | ihidev_match(device_t parent, cfdata_t match, void *aux) | | 134 | ihidev_match(device_t parent, cfdata_t match, void *aux) |
137 | { | | 135 | { |
138 | struct i2c_attach_args * const ia = aux; | | 136 | struct i2c_attach_args * const ia = aux; |
139 | int match_result; | | 137 | int match_result; |
140 | | | 138 | |
141 | if (iic_use_direct_match(ia, match, compat_data, &match_result)) | | 139 | if (iic_use_direct_match(ia, match, compat_data, &match_result)) |
142 | return I2C_MATCH_DIRECT_COMPATIBLE; | | 140 | return I2C_MATCH_DIRECT_COMPATIBLE; |
143 | | | 141 | |