aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid/usbkbd.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-08-25HID: move from strlcpy with unused retval to strscpyWolfram Sang1-1/+1
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2022-04-23HID: usbhid: remove third argument of usb_maxpacket()Vincent Mailhol1-1/+1
The third argument of usb_maxpacket(): in_out has been deprecated because it could be derived from the second argument (e.g. using usb_pipeout(pipe)). N.B. function usb_maxpacket() was made variadic to accommodate the transition from the old prototype with three arguments to the new one with only two arguments (so that no renaming is needed). The variadic argument is to be removed once all users of usb_maxpacket() get migrated. CC: Jiri Kosina <jikos@kernel.org> CC: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/r/20220317035514.6378-3-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-15HID: usbkbd: Avoid GFP_ATOMIC when GFP_KERNEL is possibleHyeonggon Yoo1-2/+2
usb_kbd_alloc_mem is called in usb_kbd_probe, which is not in atomic context. So constraints can be relaxed here. Use GFP_KERNEL instead of GFP_ATOMIC. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-04-07HID: usbhid: Repair a formatting issue in a struct descriptionLee Jones1-9/+9
Fixes the following W=1 kernel build warning(s): drivers/hid/usbhid/usbkbd.c:66: warning: bad line: should be on Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: message to <vojtech@ucw.cz> Cc: linux-usb@vger.kernel.org Cc: linux-input@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156Thomas Gleixner1-13/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1334 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-10HID: usbkbd: constify usb_device_id and fix space before '[' error.Arvind Yadav1-1/+1
usb_device_id are not supposed to change at runtime. All functions working with usb_device_id provided by <linux/usb.h> work with const usb_device_id. So mark the non-const structs as const. Fix checkpatch.pl error: ERROR: space prohibited before open square bracket '['. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-01-06HID: remove use of DRIVER_LICENSEGrant Grundler1-2/+1
Local "#define DRIVER_LICENSE" obfuscates which license is used in MODULE_LICENSE(). "fgrep -R MODULE_LICENSE" is more informative when the string is hard coded in MODULE_LICENSE. Signed-off-by: Grant Grundler <grundler@google.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-11-19HID: usbkbd: fix inconsistent debugging outputAdam Cozzette1-1/+1
It looks like this typo was introduced by a mistake in a copy-and-paste in commit ddbe32491951. Signed-off-by: Adam Cozzette <acozzette@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-01-10Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hidLinus Torvalds1-5/+59
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (68 commits) hid-input/battery: add FEATURE quirk hid-input/battery: remove battery_val hid-input/battery: power-supply type really *is* a battery hid-input/battery: make the battery setup common for INPUTs and FEATUREs hid-input/battery: deal with both FEATURE and INPUT report batteries hid-input/battery: add quirks for battery hid-input/battery: remove apparently redundant kmalloc hid-input: add support for HID devices reporting Battery Strength HID: hid-multitouch: add support 9 new Xiroku devices HID: multitouch: add support for 3M 32" HID: multitouch: add support of Atmel multitouch panels HID: usbhid: defer LED setting to a workqueue HID: usbhid: hid-core: submit queued urbs before suspend HID: usbhid: remove LED_ON HID: emsff: use symbolic name instead of hardcoded PID constant HID: Enable HID_QUIRK_MULTI_INPUT for Trio Linker Plus II HID: Kconfig: fix syntax HID: introduce proper dependency of HID_BATTERY on POWER_SUPPLY HID: multitouch: support PixArt optical touch screen HID: make parser more verbose about parsing errors by default ... Fix up rename/delete conflict in drivers/hid/hid-hyperv.c (removed in staging, moved in this branch) and similarly for the rules for same file in drivers/staging/hv/{Kconfig,Makefile}.
2011-11-23HID: usbkbd: kill LED URB on disconnectWillem Penninckx1-0/+1
The LED URB was left unkilled when the USB device is disconnected. Signed-off-by: Willem Penninckx <willem.penninckx@cs.kuleuven.be> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23HID: usbkbd: synchronize LED URB submissionWillem Penninckx1-5/+58
usb_kbd_event() and usb_kbd_led() can be called concurrently, but they are not synchronized. They both readwrite kbd->leds, and usb_kbd_event() originally just checked the URB status field, while urb.h states that "It [status field] should not be examined before the URB is returned to the completion handler." To fix this unsynchronized behavior, this patch introduces a boolean representing whether the URB is submitted, and a spinlock. Signed-off-by: Willem Penninckx <willem.penninckx@cs.kuleuven.be> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-18USB: convert drivers/hid/* to use module_usb_driver()Greg Kroah-Hartman1-16/+1
This converts the drivers in drivers/hid/* to use the module_usb_driver() macro which makes the code smaller and a bit simpler. Added bonus is that it removes some unneeded kernel log messages about drivers loading and/or unloading. Cc: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10HID: Add and use hid_<level>: dev_<level> equivalentsJoe Perches1-10/+14
Neaten current uses of dev_<level> by adding and using hid specific hid_<level> macros. Convert existing uses of dev_<level> uses to hid_<level>. Convert hid-pidff printk uses to hid_<level>. Remove err_hid and use hid_err instead. Add missing newlines to logging messages where necessary. Coalesce format strings. Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt Other miscellaneous changes: Add const struct hid_device * argument to hid-core functions extract() and implement() so hid_<level> can be used by them. Fix bad indentation in hid-core hid_input_field function that calls extract() function above. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-21Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hidLinus Torvalds1-0/+1
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (59 commits) HID: fix up 'EMBEDDED' mess in Kconfig HID: roccat: cleanup preprocessor macros HID: roccat: refactor special event handling HID: roccat: fix special button support HID: roccat: Correctly mark init and exit functions HID: hidraw: Use Interrupt Endpoint for OUT Transfers if Available HID: hid-samsung: remove redundant key mappings HID: add omitted hid-zydacron.c file HID: hid-samsung: add support for Creative Desktop Wireless 6000 HID: picolcd: Eliminate use after free HID: Zydacron Remote Control driver HID: Use kmemdup HID: magicmouse: fix input registration HID: make Prodikeys driver standalone config option HID: Prodikeys PC-MIDI HID Driver HID: hidraw: fix indentation HID: ntrig: add filtering module parameters HID: ntrig: add sysfs access to filter parameters HID: ntrig: add sensitivity and responsiveness support HID: add multi-input quirk for eGalax Touchcontroller ...
2010-05-20USB: rename usb_buffer_alloc() and usb_buffer_free() usersDaniel Mack1-4/+4
For more clearance what the functions actually do, usb_buffer_alloc() is renamed to usb_alloc_coherent() usb_buffer_free() is renamed to usb_free_coherent() They should only be used in code which really needs DMA coherency. All call sites have been changed accordingly, except for staging drivers. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Pedro Ribeiro <pedrib@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: remove uses of URB_NO_SETUP_DMA_MAPAlan Stern1-5/+3
This patch (as1350) removes all usages of coherent buffers for USB control-request setup-packet buffers. There's no good reason to reserve coherent memory for these things; control requests are hardly ever used in large quantity (the major exception is firmware transfers, and they aren't time-critical). Furthermore, only seven drivers used it. We might as well always use streaming DMA mappings for setup-packet buffers, and remove some extra complexity from usbcore. The DMA-mapping portion of hcd.c is currently in flux. A separate patch will be submitted to remove support for URB_NO_SETUP_DMA_MAP after everything else settles down. The removal should go smoothly, as by then nobody will be using it. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-03HID: usbhid: enable remote wakeup for keyboardsAlan Stern1-0/+1
This patch (as1365) enables remote wakeup by default for USB keyboard devices. Keyboards in general are supposed to be wakeup devices, but the correct place to enable it depends on the device's bus; no single approach will work for all keyboard devices. In particular, this covers only USB keyboards (and then only those supporting the boot protocol). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-23Input: do not overwrite the first part of phys stringMárton Németh1-1/+1
Use strlcat() to append a string to the previously created first part. Signed-off-by: Márton Németh <nm127@freemail.hu> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-10-14HID: remove warn() macro from usb hid driversFrom: Greg Kroah-Hartman1-1/+2
USB should not be having it's own printk macros, so remove warn() and use the system-wide standard of dev_warn() wherever possible. In the few places that will not work out, use a basic printk(). Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14HID: remove info() macro from usb HID driversGreg Kroah-Hartman1-3/+6
USB should not be having it's own printk macros, so remove info() and use the system-wide standard of dev_info() wherever possible. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23HID: remove quirk lookup from usbkbd/usbmouseJiri Kosina1-8/+0
This patch completely removes the dependency of usbkbd and usbmouse drivers on usbhid code. usbkbd/usbmouse drivers are not needed in the vast majority of cases anyway, and they shouldn't be loaded in standard configurations at all. They are supposed to be as trivial as possible, and searching for HID_QUIRK_IGNORE can even be bad in some cases. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23HID: fix quirk handling in usbmouse/kbdJiri Slaby1-1/+1
When usbmouse/kbd is set to build, USB_HID is never defined due to the USB_HID!=y Kconfig rule. Test CONFIG_USB_HID_MODULE in both drivers instead. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23HID:usbkbd:mark usb_kbd_keycode array as constMing Lei1-1/+1
mark it as const because it is read only Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-05-20HID: remove CVS keywordsAdrian Bunk1-2/+0
This patch removes CVS keywords that weren't updated for a long time from comments. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: fix compilation of hidbp drivers without usbhidJiri Kosina1-0/+2
We can use the blacklist only if usbhid code is compiled. Reported-by: jurriaan <thunder7@xs4all.nl> Cc: Pascal Terjan <pterjan@mandriva.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-01-28HID: Use hid blacklist in usbmouse/usbkbdPascal Terjan1-0/+6
This fixes wacom tablets not working if usbmouse is loaded. Signed-off-by: Pascal Terjan <pterjan@mandriva.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-10-19get rid of input BIT* duplicate definesJiri Slaby1-2/+5
get rid of input BIT* duplicate defines use newly global defined macros for input layer. Also remove includes of input.h from non-input sources only for BIT macro definiton. Define the macro temporarily in local manner, all those local definitons will be removed further in this patchset (to not break bisecting). BIT macro will be globally defined (1<<x) Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: <dtor@mail.ru> Acked-by: Jiri Kosina <jkosina@suse.cz> Cc: <lenb@kernel.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Cc: <perex@suse.cz> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: <vernux@us.ibm.com> Cc: <malattia@linux.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-09HID: make debugging output runtime-configurableJiri Kosina1-3/+3
There have been many reports recently about broken HID devices, the diagnosis of which required users to recompile their kernels in order to be able to provide debugging output needed for coding a quirk for a particular device. This patch makes CONFIG_HID_DEBUG default y if !EMBEDDED and makes it possible to control debugging output produced by HID code by supplying 'debug=1' module parameter. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-05-09HID: switch to using input_dev->dev.parentDmitry Torokhov1-6/+6
In preparation for struct class_device -> struct device input core conversion switch to using input_dev->dev.parent when specifying device position in sysfs tree. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-05-09USB HID: usb_buffer_free() cleanupDmitry Torokhov1-6/+3
usb_buffer_free() now handles NULLs so remove unneeded checks form callers. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-04-11USB HID: usbkbd/usbmouse - handle errors when registering devicesDmitry Torokhov1-4/+9
Handle errors when registering input devices in usbkbd/usbmouse. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2007-04-11USB HID: move usbhid code from drivers/usb/input to drivers/hid/usbhidJiri Kosina1-0/+362
Separate usbhid code into dedicated drivers/hid/usbhid directory as discussed previously with Greg, so that it eases maintaineance process. Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>