Tue Jan 26 01:15:39 2021 UTC ()
Back out unintended change in previous.


(thorpej)
diff -r1.14 -r1.15 src/sys/dev/i2c/ihidev.c

cvs diff -r1.14 -r1.15 src/sys/dev/i2c/ihidev.c (expand / switch to unified diff)

--- src/sys/dev/i2c/ihidev.c 2021/01/25 13:30:20 1.14
+++ src/sys/dev/i2c/ihidev.c 2021/01/26 01:15:39 1.15
@@ -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
116static bool ihidev_suspend(device_t, const pmf_qual_t *); 116static bool ihidev_suspend(device_t, const pmf_qual_t *);
117static bool ihidev_resume(device_t, const pmf_qual_t *); 117static bool ihidev_resume(device_t, const pmf_qual_t *);
118static int ihidev_hid_command(struct ihidev_softc *, int, void *, bool); 118static int ihidev_hid_command(struct ihidev_softc *, int, void *, bool);
119static int ihidev_intr(void *); 119static int ihidev_intr(void *);
120static void ihidev_softintr(void *); 120static void ihidev_softintr(void *);
121static int ihidev_reset(struct ihidev_softc *, bool); 121static int ihidev_reset(struct ihidev_softc *, bool);
122static int ihidev_hid_desc_parse(struct ihidev_softc *); 122static int ihidev_hid_desc_parse(struct ihidev_softc *);
123 123
124static int ihidev_maxrepid(void *, int); 124static int ihidev_maxrepid(void *, int);
125static int ihidev_print(void *, const char *); 125static int ihidev_print(void *, const char *);
126static int ihidev_submatch(device_t, cfdata_t, const int *, void *); 126static int ihidev_submatch(device_t, cfdata_t, const int *, void *);
127 127
128static const struct device_compatible_entry compat_data[] = { 128static 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
135static int 133static int
136ihidev_match(device_t parent, cfdata_t match, void *aux) 134ihidev_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