aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/atkbdc
Commit message (Collapse)AuthorAgeFilesLines
* chore: replace {0, 0} with {DEV,KOBJ}METHOD_ENDEnji Cooper10 days3-4/+4
| | | | | | | | | | | | | | Both of the aforementioned macros have been present in FreeBSD for well over a decade: 2009 for `KOBJMETHOD_END`; 2011 for `DEVMETHOD_END`. Adapt all hardcoded references of `{0, 0}` with `DEVMETHOD_END` and `KOBJMETHOD_END` as appropriate. This helps ensure that future adaptations to drivers following patterns documented in driver(9) can be made more easily/without issue. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55414
* bus: Document special ranges of IVARsJohn Baldwin2026-02-171-1/+1
| | | | | | | | | | | | | Some IVAR indices are special in that they have global meaning across multiple buses where as other IVARs are always private to the local bus. Try to document this a bit and add constants for the various ranges to avoid future conflicts. This is a no-op, but IVAR indices are now generally defined as enums as that makes it easier to define them in terms of ranges. Reviewed by: imp, royger, andrew Differential Revision: https://reviews.freebsd.org/D54159
* psm(4): Add middle button support for Elantech V4 touchpadsVladimir Kondratyev2026-02-101-2/+13
| | | | | | | based on firmware version. PR: 291262 MFC after: 1 month
* bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin2025-12-091-3/+3
| | | | | | | | | The wrapper functions such as bus_alloc_resource_any() still support passing the rid by value or pointer, but the underlying implementation now passes by value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53402
* psm: Fix three finger tap on elantech v4 touchpadsRobert Wahlberg2025-12-011-0/+7
| | | | | | | | | | Fix an issue where a three finger tap would generate additional events when fingers moved slightly during the tap. Signed-off-by: Robert Wahlberg <freebsd@robertwahlberg.se> Pull Request: https://github.com/freebsd/freebsd-src/pull/1792 Reviewed by: wulf MFC after: 1 month
* knotes: kqueue: handle copy for trivial filtersKonstantin Belousov2025-10-181-0/+1
| | | | | | | | Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D52045
* psm: fix buildGleb Smirnoff2025-06-271-0/+1
| | | | Fixes: b93063c84e4e792ede844d30452d82c4fe12bdd2
* psm(4): Add kqueue supportVladimir Kondratyev2025-06-261-0/+45
| | | | MFC after: 2 weeks
* atkbd: Fix first keystroke force resetSHENGYI HUNG2025-05-281-1/+13
| | | | | | | | | | | | | | | Some i8042 falsely return KBD_ACK for ECHO command which cuase the keyboard echo test failed. Without passing echo test, the keyboard is considered as unconfigured. Though it is an incorrect behavior, we still regard it as a correct to prevent the force reset (a step for configure a keyboard) of whole keyboard when the first key interrupt reached. Co-Authored-By: Aymeric Wibo <obiwac@freebsd.org> Reviewed By: wulf, obiwac, emaste Sponsored By: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50498
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-1/+1
| | | | | 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
* new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCEJohn Baldwin2024-03-131-5/+4
| | | | | | | | | | The public bus_release_resource() API still accepts both forms, but the internal kobj method no longer passes the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44131
* psm: recognize post-IBM trackpoints on ThinkpadsGleb Smirnoff2023-09-191-10/+23
| | | | | | | | | | Newer Thinkpads come with trackpoints from different vendors. They are mostly compatible with the original one. Not sure all features are going to work, but at least this fixes resume operation. Tested on: Thinkpad X1 Carbon 7th Gen Reviewed by: wulf, imp Diffrential Revision: https://reviews.FreeBSD.org/D41871
* atkbdc: Add additional heurstic for Chromebook keyboardsWarner Losh2023-09-091-0/+11
| | | | | | | | | | | | | | | It turns out that that heurstic used to determine if we have a Google coreboot, and thus have the i8042 emulation bugs, is incorrect. At least one Acer "Peppy" Chromebook has an issue because Acer space'd out the smbios.bios.version string we're using as part of the heuristic. So, if the version starts with a space, then enable the workarounds if the smbios.bios.reldate is 2018 or earlier. While not perfect, it should be a reasonable dividing line and still allow newer core boot-based machines that aren't Chromebooks to not have the workaround. Tested by: Matthias Apitz Sponsored by: Netflix MFC After: 3 days (14.0 candiate)
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-166-12/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* psm(4): Fix a typo in a source code commentGordon Bergling2023-08-021-1/+1
| | | | | | - s/diable/disable/ MFC after: 3 days
* kbd: consolidate kb interfaces (phase one)Michael2023-07-071-12/+6
| | | | | | | | | | | | | | Refactor to eliminate duplicated rate and delay tables, with minor style tweaks for changed lines. Remove an obsolete comment about needing to convert from microseconds to ticks (that's done elsewhere). Remove traiing whitespace in kbdcontrol.c. Except for the new warning, no change in behavior Sponsored by: DSS GmbH Reviewed by: imp [minor style tweaks as well] Pull Request: https://github.com/freebsd/pull/683 Differential Revision: https://reviews.freebsd.org/D38818
* atkbc: Better test for old chromebooksWarner Losh2023-06-291-11/+29
| | | | | | | | | | | | | | | | | | | | Older Chromebooks have issues in their embedded controller (EC) firmware which need working around in atkbd and atkbdc. On these systems, rather than use a standard EC, Google used their own arm-based EC. For a while, its firmware incorrectly implemented the i8042, requiring workaroundsd in the driver. Implement a heuristic recommended by MrChromebox <mrchromebox@gmail.com> to detect them: If the bios.version starts with Google_, or the maker is either Google or GOOGLE, assume that it's a chromebook with the affected bios. While this isn't strictly true, the number of updated systems without the bug is very small and this will exclude all the non-Google coreboot user that use a standard EC. There's no simple way to test the hardware to see if it's implemented with the buggy EC. Sponsored by: Netflix Reviewed by: jon@thesoo.org, MrChromebox Differential Revision: https://reviews.freebsd.org/D40789
* atkbdc: Minor style nitsWarner Losh2023-06-281-6/+6
| | | | | | 'char* ' -> 'char *', per style(9) Sponsored by: Netflix
* Adds support for Purism coreboot keyboardsJon Hopper2023-06-281-0/+1
| | | | | | | | | | On Purism coreboot systems the quirks mode in atkbdc prevents built in Keyboard from being used. Add quirk to prevent that. MFC After: 2 weeks PR: 271737 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D40405
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-126-6/+6
| | | | | | | | | 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
* kbdreg.h: include opt_kbd.hWarner Losh2023-02-271-2/+2
| | | | | | | | | | This is a kernel-only file, so it's safe to include opt_kbd.h. However, add #ifdef _KERNEL guards to emphasize that. And also move the include of opt_kbd.h in atkbdcreg.h to inside the kernel guards. Nothing outside the kernel in tree uses the rest of that file, but I'm less comfortable moving the #ifdef _KERNEL to the top of that file. Sponsored by: Netflix
* atkbd: correct bogus character in #ifdefEd Maste2023-02-141-1/+1
| | | | | Fixes: f20058955c9d ("sys/kbio.h: make pre-unicode keymap...") Sponsored by: The FreeBSD Foundation
* sys/kbio.h: make pre-unicode keymap support optionalStefan Eßer2023-02-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD-9 had introduced support for the full set of Unicode characters to the parsing and processing of keymap character tables. This support has been extended to cover the table for accented characters that are reached via dead key combinations in FreeBSD-13.2. New ioctls have been introduced to support both the pre-Unicode and the Unicode formats and keyboard drivers have been extended to support those ioctls. This commit makes the ABI compatibility functions in the kernel optional and dependent on COMPAT_FREEBSD13 in -CURRENT. The kbdcontrol command in -CURRENT and 13-STABLE (before 13.2) has been made ABI compatible with old kernels to allow a new world to be run on an old kernel (that does not have full Unicode support for keymaps). This commit is not to merged back to 12-STABLE or 13-STABLE. It is part of review D38465, which has been split into 3 separate commits due to different MFC and life-time requirements of either commit. Approved by: imp Differential Revision: https://reviews.freebsd.org/D38465
* psm: ansifyMateusz Guzik2023-02-131-3/+2
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* Support Unicode characters in keymap dead key tablesStefan Eßer2023-02-061-0/+1
| | | | | | | | | | | | | | | | | | | Support for Unicode characters had been added to the keyboard code, but there are keymaps that have accented characters accessed via dead key combinations, and those were still restricted to 8 bit codes. This update to kbd.c adds support for Unicode characters and compatibility code that allows a kbdcontrol command built from kbio.h without these patches to work on a new kernel. Compatibility code that allows a new kbdcontrol binary running on an old kernel to load and display the dead key map will be committed in a separate commit. Reviewed by: imp, brooks Approved by: brooks MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38381
* evdev: Extend EVIOCGRAB ioctl scope to cover kbd interfaceVladimir Kondratyev2022-11-181-0/+3
| | | | | | | | | | | | | | of various keyboard drivers. EVIOCGRAB ioctl execution on /dev/input/event# device node gains exclusive access to this device to caller. It is used mostly for development purposes and remote control software. See e.g. https://reviews.freebsd.org/D30020 which is the reason of creation of this change. Keyboard grabbing is disabled in KDB and during panics. MFC with: 4a0db5e2920c Tested by: corvink Differential revision: https://reviews.freebsd.org/D30542
* evdev: Extend EVIOCGRAB ioctl scope to cover sysmouse interfaceVladimir Kondratyev2022-11-171-4/+8
| | | | | | | | | | | | | of psm(4), ums(4) and sysmouse(4) drivers. EVIOCGRAB ioctl execution on /dev/input/event# device node gains exclusive access to this device to caller. It is used mostly for development purposes and remote control software. See e.g. https://reviews.freebsd.org/D30020 which is the reason of creation of this change. MFC after: 2 weeks Tested by: corvink Differential revision: https://reviews.freebsd.org/D30542
* atkbd(4): Fix "hancha" and "han/yong" korean keys handling.Vladimir Kondratyev2022-07-191-0/+10
| | | | | | | | | | | | | | | The Korean keyboard has two keys, the Korean/Chinese and the Korean/English toggles, that generate scancodes 0xF1 and 0xF2 (respectively) when pressed, and nothing when released. They do not repeat. As Hanyong/Hancha keys are generally greater than 0x80, which is generally considered a release key, add extra preceding press key event to generate press/release pair. Swap Hanyong/Hancha key codes to match reality. Reported by: Warioburn <warioburn@yahoo.co.jp> PR: 265260 MFC after: 1 week
* atkbd/psm: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-065-15/+6
|
* psm: Swap the unit member in the softc for a device_t.John Baldwin2022-04-211-107/+92
| | | | | | | | | | | This entails various changes to make this driver more "modern" (new-bus vs pre-new-bus) using device_log() and device_printf() rather than psm%d. It also fixes the device_busy/unbusy calls to use sc->dev directly rather than looking the device_t up via the devclass and unit. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D35006
* psm: Remove write-only variables.John Baldwin2022-04-061-8/+1
|
* atkbd: Disable periodic polling by default.Alexander Motin2022-01-051-1/+1
| | | | | | | | | | It is one of the few remaining Giant-locked callouts. It would be good to remove it, not mentioning that polling itself is not good. If this cause keyboard/mouse freezes on some hardware, please set loader tunable hw.atkbd.hz=1 as workaround and report the issue. Submitted by: imp, jhb
* atkbd: Reduce polling rate from 10Hz to ~1Hz.Alexander Motin2022-01-051-2/+13
| | | | | | | | | | In my understanding this is only needed to workaround lost interrupts. I was thinking to remove it completely, but the comment about edge- triggered interrupt may be true and needs deeper investigation. ~1Hz should be often enough to handle the supposedly rare loss cases, but rare enough to not appear in top. Add sysctl hw.atkbd.hz to tune it. MFC after: 1 month
* psm(4): Disable KVM switch "jitter" clamping for absolute touchpads.Vladimir Kondratyev2021-09-091-1/+5
| | | | | | | | | | | | | | | | r123442 introduced solution for clamping of PS/2 mice jitter when using a KVM. Solution is to buffer mouse packets for 0.050ms if mouse activity has not been seen for more than 0.5 seconds. Then flush that data to driver if no validation errors found or drop the entire queue otherwise. While it works well with relative devices it has issues with absolute ones Depending on history buffering may results in delaying of the touch front edge for 0.050ms that affects gesture processing (tap detection). As absolute touchpads usually are built-in devices we can safely disable bufferization and KVM jitter clamping to avoid such a delays. MFC after: 2 weeks
* psm: Use evdev autorelease feature for Synaptics and Elantech driversVladimir Kondratyev2021-09-021-15/+4
| | | | MFC after: 2 weeks
* psm: Enable touch-tracking for late Synaptics PS/2 touchpads.Vladimir Kondratyev2021-09-021-0/+2
| | | | | | | They are true multitouch internally but Synaptics PS/2 protocol limitations do not all allow to export touch identificators. MFC after: 2 weeks
* psm(4): Probe Synaptics touchpad with active multiplexing mode enabledVladimir Kondratyev2021-07-141-14/+28
| | | | | | | | | | if it is only multiplexed device. Also enable syncbit checks for them. This fixes touchpad recognition on Panasonic Toughbook CF-MX4 laptop. Reported by: Tomasz "CeDeROM" CEDRO <tomek_AT_cedro_DOT_info> MFC after: 1 month PR: 253279 Differential revision: https://reviews.freebsd.org/D28502
* evdev: Remove useless "initial value" parameter from evdev_support_abs()Vladimir Kondratyev2021-01-071-2/+2
| | | | | It can not be used for setting of state of multitouch events. If necessary, use evdev_push_event() instead of it.
* psm(4): Always initialize Synaptics touchpad report range with defaultsVladimir Kondratyev2020-12-231-14/+9
| | | | | | | | | | Otherwise libinput refuses to recoginize some Synaptics touchpads with "kernel bug: device has min == max on ABS_X" message in Xorg.log. PR: 251149 Reported-by: Jens Grassel <freebsd-ports@jan0sch.de> Tested-by: Jens Grassel <freebsd-ports@jan0sch.de> MFC-after: 2 weeks
* atkbd(4): Just use nitems() for quirk enumerationConrad Meyer2020-12-051-3/+1
| | | | | | | | | Reviewed by: imp, wulf X-MFC-With: r368365 Differential Revision: https://reviews.freebsd.org/D27489 Notes: svn path=/head/; revision=368374
* atkbd(4): Change quirk table end-of-list marker to NULL vendor/maker/productVladimir Kondratyev2020-12-051-1/+2
| | | | | | | | | | | | | This fixes regression introduced in r367349 which effectively resulted in truncation of quirk table. PR: 250711 Submitted by: grembo Reported by: Matthias Apitz <guru@unixarea.de> X-MFC with: r367349 Notes: svn path=/head/; revision=368365
* psm(4): Disable AUX multiplexer probing on all Lenovo laptops.Vladimir Kondratyev2020-11-203-2/+6
| | | | | | | | | | | | | | | | | | | | Rudimentary AUX multiplexing support was added to kernel to make possible touchpad initialization on some HP EliteBook laptops with trackpoint. Disable multiplexer probing on all Lenovo laptops now as they use touchpad pass-through port rather than AUX multiplexer to connect trackpoint and at least two model (X120e and X121e) is known for getting PS/2 AUX port dysfunctional after switching back to hidden multiplexing mode. AUX MUX probing can be reenabled with setting of hw.psm.mux_disabled loader tunable to 0. PR: 249987 Reported by: jwb MFC after: 2 weeks Notes: svn path=/head/; revision=367854
* atkbdc(4): Add quirk for "System76 lemur Pro" laptops.Vladimir Kondratyev2020-11-041-0/+1
| | | | | | | | | | | | | | | | | | | Currently atkbdc(4) assumes all coreboot BIOSes belonging to Chromebooks and unconditionally sets a number of quirks to workaround known issues. Exclude "System76" laptops from this set as they appeared to be a traditional hardware ("lemur Pro" is a rebranded Clevo chassis) with coreboot firmware on board. KBDC_QUIRK_KEEP_ACTIVATED quirk activated for Chromebook platform makes keyboard on this devices inoperable. "Purism Librem" laptops may require the same exclusion too. PR: 250711 Reported by: nick.lott@gmail.com MFC after: 2 weeks Notes: svn path=/head/; revision=367349
* atkbdc: clean up empty lines in .c and .h filesMateusz Guzik2020-09-014-14/+5
| | | | Notes: svn path=/head/; revision=365117
* [psm] Workaround active PS/2 multiplexor hangVladimir Kondratyev2020-06-021-0/+22
| | | | | | | | | | | | which happens on some laptops after returning to legacy multiplexing mode at initialization stage. PR: 242542 Reported by: Felix Palmen <felix@palmen-it.de> MFC after: 1 week Notes: svn path=/head/; revision=361718
* [psm] Do not disable trackpoint when hw.psm.elantech.touchpad_off is enabledVladimir Kondratyev2020-06-021-1/+1
| | | | | | | | | PR: 246117 Reported by: Alexander Sieg <ports@xanderio.de> MFC after: 1 week Notes: svn path=/head/; revision=361715
* psm(4): Fix wrong key-release event occuring after trackpoint use.Vladimir Kondratyev2020-04-261-1/+1
| | | | | | | | | | | | | | Some models of laptops e.g. "X1 Carbon 3rd Gen Thinkpad" have LRM buttons wired as so called "Synaptic touchpads extended buttons" rather thah real trackpoint buttons. Handle this case with merging of events from both sources. PR: 245877 Reported by: Raichoo <raichoo@googlemail.com> MFC after: 1 week Notes: svn path=/head/; revision=360353