aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hid/hidbus.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove now-redundant calls to device_delete_childrenJohn Baldwin2025-01-021-2/+1
| | | | | | | Earlier calls to bus_generic_detach now take care of deleting children. Differential Revision: https://reviews.freebsd.org/D47962
* bus_delayed_attach_children: Switch return type to voidJohn Baldwin2024-12-061-7/+4
| | | | | | | This function never fails similar to bus_attach_children. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47677
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-3/+4
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* Replace calls to bus_generic_probe with bus_identify_childrenJohn Baldwin2024-12-061-1/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47674
* newbus: replace -1 in BUS_ADD_CHILD(...-1) with DEVICE_UNIT_ANYWarner Losh2024-07-251-1/+1
| | | | Sponsored by: Netflix
* hidbus: Use device_set_descf()Mark Johnston2024-06-161-5/+3
| | | | | | No functional change intended. MFC after: 1 week
* hidbus(4): Fix wrong assertion of busZhenlei Huang2024-06-051-2/+2
| | | | | | | Reviewed by: wulf Fixes: 4151ac9f1292 hidbus(4): Use generic hid methods to ... MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45496
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Add atopcase, the Apple HID over SPI input driverVal Packett2023-08-201-0/+1
| | | | | | | | | | | | | | | | The driver provides support for Human Interface Devices (HID) on Serial Peripheral Interface (SPI) buses on Apple Intel Macs produced in 2015-2018. The driver appears to work more stable after installation of Darwin OSI in acpi(4) driver. To install Darwin OSI insert following lines into /boot/loader.conf: hw.acpi.install_interface="Darwin" hw.acpi.remove_interface="Windows 2009, Windows 2012" Reviewed by: wulf Differential revision: https://reviews.freebsd.org/D39863
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* hidbus(4): Use generic hid methods to start and stop interruptsVladimir Kondratyev2023-08-031-13/+14
|
* hid: Add child device parameter to HID methodsVladimir Kondratyev2023-08-031-14/+64
| | | | | | | | | Some devices like Apple HID-over-SPI may contain more than one report descriptors necessitating creation of multiple hidbus children. Add indentificator of child devices to distinct them. No functional changes intended. Differential Revision: https://reviews.freebsd.org/D41246
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* hv_hid: Hyper-V HID driverYuri2023-02-051-0/+1
| | | | | | | | | Hyper-V HID driver using hidbus/hms. Reviewed by: wulf MFC after: 1 week PR: 221074 Differential revision: https://reviews.freebsd.org/D38140
* hidbus(4): Align refcount checks for hidbus_intr_start() and hidbus_intr_stop().Hans Petter Selasky2022-07-281-6/+6
| | | | | | | | No functional change intended. Discussed with: wulf @ MFC after: 1 week Sponsored by: NVIDIA Networking
* hid: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-061-3/+2
|
* hidbus: Use devclass_find to lookup the devclass for hidbus.John Baldwin2022-04-211-6/+6
| | | | | Reviewed by: wulf, imp Differential Revision: https://reviews.freebsd.org/D35000
* hid: Add hid_ioctl method to HID interfaceVladimir Kondratyev2022-03-021-0/+1
| | | | | | | | | | | hid_ioctl method executes arbitrary transport backend command. Format of the command is defined by hardware transport driver. It is intended to assist HID device drivers to execute non-HID commands on hybrid devices like Elan and Apple touchpads which can be switched between HID and proprietary modes. MFC after: 2 month
* newbus: add bus_topo_assertWarner Losh2021-12-101-2/+2
| | | | | | | | | | Add bus_topo_assert() and implmement it as GIANT_REQUIRED for the moment. This will allow us to change more easily to a newbus-specific lock int he future. Sponsored by: Netflix Reviewed by: wulf, mav, jhb Differential Revision: https://reviews.freebsd.org/D31833
* hidbus(4): Add routine to check presence of collection of given usageVladimir Kondratyev2021-09-021-0/+19
| | | | MFC after: 2 week
* newbus: Move from bus_child_{pnpinfo,location}_src to ↵Warner Losh2021-06-231-9/+8
| | | | | | | | | | | | | | | | | | | | | | bus_child_{pnpinfo,location} with sbuf Now that the upper layers all go through a layer to tie into these information functions that translates an sbuf into char * and len. The current interface suffers issues of what to do in cases of truncation, etc. Instead, migrate all these functions to using struct sbuf and these issues go away. The caller is also in charge of any memory allocation and/or expansion that's needed during this process. Create a bus_generic_child_{pnpinfo,location} and make it default. It just returns success. This is for those busses that have no information for these items. Migrate the now-empty routines to using this as appropriate. Document these new interfaces with man pages, and oversight from before. Reviewed by: jhb, bcr Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29937
* usbhid(4): Add second set of USB transfers to work in polled mode.Vladimir Kondratyev2021-05-281-0/+3
| | | | | | | | | The second set of USB transfer is requested by hkbd(4) and should improve HID keyboard handling in kdb and panic contexts. MFC after: 1 week Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30486
* hid: Import usbhid - USB transport backend for HID subsystem.Vladimir Kondratyev2021-01-071-0/+1
| | | | | | | | | | | | | | | | This change implements hid_if.m methods for HID-over-USB protocol [1]. Also, this change adds USBHID_ENABLED kernel option which changes device_probe() priority and adds/removes PnP records to prefer usbhid over ums, ukbd, wmt and other USB HID device drivers and vice-versa. The module is based on uhid(4) driver. It is disabled by default for now due to conflicts with existing USB HID drivers. [1] https://www.usb.org/sites/default/files/hid1_11.pdf Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D27893
* hid: Import iichid - I2C transport backend for HID subsystemVladimir Kondratyev2021-01-071-0/+1
| | | | | | | | | | | | | | | | | This implements hid_if.m methods for HID-over-I2C protocol [1]. Following kernel options are added: IICHID_SAMPLING - Enable support for a sampling mode as interrupt resource acquisition is not always possible in a case of GPIO interrupts. IICHID_DEBUG - Enable debug output. The module is based on prior Marc Priggemeyer work (D16698). [1] http://download.microsoft.com/download/7/d/d/7dd44bb7-2a7a-4505-ac1c-7227d3d96d5b/hid-over-i2c-protocol-spec-v1-0.docx Differential revision: https://reviews.freebsd.org/D27892
* hid: Import hidbus(4)Vladimir Kondratyev2021-01-071-0/+905
This driver provides support for multiple HID driver attachments to single HID transport backend. This ability existed in Net/OpenBSD (uhidev and ihidev drivers) but has never been ported to FreeBSD. Unlike Net/OpenBSD we do not use report number alone to distinct report source but we follow MS way and use a top level collection (TLC) usage index that report belongs to as a location key. The driver performs child device autodiscovery based on HID report descriptor data, proxying of HID requests from child devices to parent transport backends and broadcasting of interrupts in backward direction. Differential revision: https://reviews.freebsd.org/D27888