aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/adb/adb_kbd.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* kbd: consolidate kb interfaces (phase one)Michael2023-07-071-10/+2
| | | | | | | | | | | | | | 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
* 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
* 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
* 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
* adb: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-101-3/+1
|
* adb: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-6/+4
| | | | Notes: svn path=/head/; revision=365099
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+2
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Revert r355806: kbd drivers: don't double register keyboard driversKyle Evans2019-12-261-4/+0
| | | | | | | | | | | r356087 made it rather innocuous to double-register built-in keyboard drivers; we now set a flag to indicate that it's been registered and only act once on a registration anyways. There is no misleading here, as the follow-up kbd_delete_driver will actually remove the driver as needed now that the linker set isn't also consulted after kbdinit. Notes: svn path=/head/; revision=356091
* kbd drivers: don't double register keyboard driversKyle Evans2019-12-161-0/+4
| | | | | | | | | | | | | | | | | | Keyboard drivers are generally registered via linker set. In these cases, they're also available as kmods which use KPI for registering/unregistering keyboard drivers outside of the linker set. For built-in modules, we still fire off MOD_LOAD and maybe even MOD_UNLOAD if an error occurs, leading to registration via linker set and at MOD_LOAD time. This is a minor optimization at best, but it keeps the internal kbd driver tidy as a future change will merge the linker set driver list into its internal keyboard_drivers list via SYSINIT and simplify driver lookup by removing the need to consult the linker set. Notes: svn path=/head/; revision=355806
* kbd: provide default implementations of get_fkeystr/diagKyle Evans2019-12-161-2/+0
| | | | | | | | | Most keyboard drivers are using the genkbd implementations as it is; formally use them for any that aren't set and make genkbd_get_fkeystr/genkbd_diag private. Notes: svn path=/head/; revision=355796
* keyboard switch definitions: standardize on c99 initializersKyle Evans2019-12-161-19/+19
| | | | | | | | | A future change will provide default implementations for some of these where it makes sense and most of them are already using the genkbd implementation (e.g. get_fkeystr, diag). Notes: svn path=/head/; revision=355794
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* sys/dev: use our nitems() macro when it is avaliable through param.h.Pedro F. Giffuni2016-04-191-1/+1
| | | | | | | | | | No functional change, only trivial cases are done in this sweep, Drivers that can get further enhancements will be done independently. Discussed in: freebsd-current Notes: svn path=/head/; revision=298307
* No need to check if devd is running before posting an event.Justin Hibbits2014-06-211-1/+1
| | | | Notes: svn path=/head/; revision=267697
* Properly sort the arguments to mtx_init(9).Justin Hibbits2014-01-231-1/+1
| | | | | | | | | PR: misc/186020 Submitted by: alfred MFC after: 1 week Notes: svn path=/head/; revision=261068
* Return NOKEY instead of 0 if there are no more key presses queued. ThisNathan Whitehorn2013-10-291-1/+1
| | | | | | | | | | worked by accident if and only if akbd was part of a kbdmux (which it always was in practice). MFC after: 1 week Notes: svn path=/head/; revision=257295
* Release the ADB keyboard mutex when handling the power buttonJustin Hibbits2012-06-231-0/+2
| | | | | | | | | | press/release. Found by WITNESS. Approved by: nwhitehorn (mentor) MFC after: 3 days Notes: svn path=/head/; revision=237480
* Add support for special keys (volume/brightness/eject) on Apple laptops withNathan Whitehorn2011-10-161-1/+71
| | | | | | | | | | ADB keyboards. Submitted by: Justin Hibbits <jrh29 at alumni dot cwru dot edu> MFC after: 9.0-RELEASE Notes: svn path=/head/; revision=226449
* Restore binary compatibility for GIO_KEYMAP and PIO_KEYMAP.Ed Schouten2011-07-171-0/+1
| | | | | | | | | | | | Back in 2009 I changed the ABI of the GIO_KEYMAP and PIO_KEYMAP ioctls to support wide characters. I created a patch to add ABI compatibility for the old calls, but I didn't get any feedback to that. It seems now people are upgrading from 8 to 9 they experience this issue, so add it anyway. Notes: svn path=/head/; revision=224126
* Improve the AT keyboard emulation of the ADB keyboard driver, by supportingNathan Whitehorn2009-01-081-15/+144
| | | | | | | | | | an AT-like K_RAW mode instead of just K_CODE. This has the effect of making the arrow keys on ADB keyboards work in X11. Copied from: sunkbd(4) Notes: svn path=/head/; revision=186906
* Fix some nasty race conditions in the VIA-CUDA driver that ended up preventingNathan Whitehorn2008-12-061-9/+5
| | | | | | | | | my right mouse button and keyboard LEDs from working due to mangled configuration packets. Fixed several other races and associated problems in the main ADB stack that were exposed while fixing this. Notes: svn path=/head/; revision=185724
* Add ADB support. This provides support for the external ADB bus on the PowerMacNathan Whitehorn2008-10-261-0/+692
G3 as well as the internal ADB keyboard and mice in PowerBooks and iBooks. This also brings in Mac GPIO support, for which we should eventually have a better interface. Obtained from: NetBSD (CUDA and PMU drivers) Notes: svn path=/head/; revision=184299