summaryrefslogtreecommitdiffstats
path: root/sys/dev/i2c/ihidev.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* On some laptops that have a Windows Precision Touchpad (imt) andjcs2020-07-091-7/+12
| | | | | | | | | | | also a trackstick or separate physical buttons, imt was claiming all report ids of the ihidev device preventing the trackstick/buttons from attaching as a separate ims device on other report ids. Just claim the report ids that imt needs and let ims attach to others it may find. Fixes two Dell Latitude laptops and tested in snaps for a bit.
* ihidev(4): tsleep(9) -> tsleep_nsec(9); ok mpi@ jcs@cheloha2020-01-241-10/+3
|
* ihidev: continue doing polling when interrupt setup failsjcs2019-07-311-2/+2
|
* Even when polling is requested, install ihidev's interrupt handlerjcs2019-07-221-7/+62
| | | | | | | | If an interrupt is received, turn off polling and rely on interrupts. This may happen after S3 resume. Also properly shut down polling during suspend and start it up again on resume only after dwiic is back in action.
* change psize to a signed int to cope with it going negative sincejcs2019-04-081-4/+3
| | | | | | | the data read during polling may be junk fixed with Petr Ročkai ok deraadt, mpi, stsp
* fix a memory leak in ihidev_hid_command()jsg2018-09-201-1/+2
| | | | ok claudio@
* Move HID->bus constant conversion for HID report types out of ihidevjcs2018-08-251-12/+3
| | | | | | | | | | | | | | | | | | | | | into hidmt. The HID code uses hid_feature, hid_input, and hid_output constants to refer to report types internally that then need to be converted to their bus-level counterparts before actually getting sent out (so hid_feature becomes UHID_FEATURE_REPORT for USB, I2C_HID_REPORT_TYPE_FEATURE for i2c). This conversion was hard-coded in ihidev but ihidev_[gs]et_report should assume the type passed is already an i2c-level define, not a hid one. This is how uhidev does it. Add a conversion routine callback that any hidmt callers need to set so that hidmt can convert hid constants to the bus-level versions. Also add a similar conversion function to uhidev. ok deraadt
* revert previous changes to enable dwiic on Dell precision as it seemsmlarkin2018-01-121-2/+2
| | | | | to cause issues on Dell XPS 15 9560. Will investigate and recommit later if a better fix can be found.
* Attach dwiic_pci on Dell Precision 7520. Also restrict ihidev reportsmlarkin2018-01-081-2/+2
| | | | | | to those of 3 bytes or more (as per the hid-over-i2c spec). discussed with jcs, kettenis
* add an adaptive polling mode when no interrupt handler is available,jcs2017-11-291-32/+101
| | | | | | | | | such as on PCI dwiic(4) devices. this is a temporary workaround until the underlying interrupt problem is fixed. tested by various
* A pile of sizes to free(9). In test for a few days in snapshots.deraadt2017-04-081-2/+2
| | | | | Errors will result in nice clean panic messages so we know what's wrong. Reviewed by dhill visa natano jsg.
* Print a meaningful interrupt string for i2c devices.kettenis2016-04-231-3/+2
|
* Fix layer violation in the ihidev(4) code by implementing a generic mechanismkettenis2016-04-101-19/+8
| | | | | | | | | | that allows the i2c controller implementation to establish interrupts on behalf of i2c slave device drivers. Use this mechanism in dwiic(4) to let it configure the right acpi interrupt (global or gpio). Change the level to IPL_TTY as this is the appropriate level to use for keyboards and other input devices. ok jsg@
* Add support for I2C HID devices with GPIO signalled interrupts.jsg2016-04-021-3/+12
| | | | | | Required for the keyboard and touchpad on the ideapad 100s. ok kettenis@
* use hid_desc fields since we have them, instead of manual offsetsjcs2016-01-291-34/+23
| | | | | | into hid_desc_buf tested by jsg
* add the ability to set and get reportsjcs2016-01-201-81/+300
| | | | | | establish interrupt before probing for devices to handle each report id sign an int, found by jsg
* Several fixes for dwiic(4).kettenis2016-01-141-10/+10
| | | | | | | | | | | | | * Properly map bus space; using BUS_SPACE_MAP_PREFATCHABLE is not agood idea as it may lead to reordering or merging of register writes in the store buffer. * Properly implement the iic(4) operations in dwiic_i2c_exec(). * Keep timings set up by the firmware if the SSCN and FMCN methods aren't available. ok jcs@
* Use I2C_F_POLL flag when acquiring and releasing the i2c bus in thekettenis2016-01-141-6/+9
| | | | | | interrupt handler. ok jcs@
* When iterating over the report IDs to calculate the maximum size, takekettenis2016-01-141-16/+14
| | | | | | | | into account the 2 bytes needed to store the length. Also make sure that we have at least wMaxInputLength bytes available for reading input reports. ok jcs@
* fix hid packet length calculationjcs2016-01-131-4/+4
| | | | noticed by jsg
* Don't confuse the HID descriptor address (which really is an office into thekettenis2016-01-131-3/+4
| | | | | | | | | register space of the i2c device) with the i2c address. For i2c busses enumerated by ACPI we get the address from the I2C Serial Bus Connection Resource Descriptor returned by the _CRS methide of the i2c device. Pass the HID descriptor address in the ia_size member. ok jcs@
* rename new i2c_attach_args fields to avoid conflict with cpp magic inderaadt2016-01-121-4/+4
| | | | | isavar.h (a few parts of the tree include both) ok jcs
* Add dwiic, a driver for the Synopsys DesignWare i2c controller foundjcs2016-01-121-0/+574
on the Samsung ATIV Book 9 laptop. This initial version only supports ACPI config/attachment. Add ihidev, a HID-over-i2c driver largely based on uhidev. dwiic handles attaching ihidev devices found in ACPI. Add ims, a HID-over-i2c mouse/trackpad driver to get basic cursor and button functionality from HID-compliant i2c trackpads. ok kettenis deraadt