aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/pegasus_notetaker.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-08-18Input: 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. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20220818210022.6865-1-wsa+renesas@sang-engineering.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-04-23Input: 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: Ville Syrjala <syrjala@sci.fi> CC: Dmitry Torokhov <dmitry.torokhov@gmail.com> CC: Henk Vergonet <Henk.Vergonet@gmail.com> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/r/20220317035514.6378-4-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-07Input: Use fallthrough pseudo-keywordGustavo A. R. Silva1-1/+1
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20200707180857.GA30600@embeddedor Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: pegasus_notetaker - fix endpoint sanity checkJohan Hovold1-1/+1
The driver was checking the number of endpoints of the first alternate setting instead of the current one, something which could be used by a malicious device (or USB descriptor fuzzer) to trigger a NULL-pointer dereference. Fixes: 1afca2b66aac ("Input: add Pegasus Notetaker tablet driver") Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Martin Kepplinger <martink@posteo.de> Acked-by: Vladis Dronov <vdronov@redhat.com> Link: https://lore.kernel.org/r/20191210113737.4016-2-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-05-21treewide: Add SPDX license identifier for more missed filesThomas Gleixner1-0/+1
Add SPDX license identifiers to all files which: - Have no license information of any form - Have MODULE_LICENCE("GPL*") inside which was used in the initial scan/conversion to ignore the file These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-17Input: pegasus_notetaker - do not rely on input_dev->usersMarcus Folkesson1-2/+5
If the device is unused and suspended, a call to open will cause the device to autoresume through the call to usb_autopm_get_interface(). input_dev->users is already incremented by the input subsystem, therefore this expression will always be evaluated to true: if (pegasus->dev->users && usb_submit_urb(pegasus->irq, GFP_NOIO) < 0) retval = -EIO; The same URB will then be fail when resubmitted in pegasus_open(). Introduce pegasus->is_open to keep track of the state instead. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-03-17Input: pagasus_notetaker - fix deadlock in autosuspendMarcus Folkesson1-6/+19
usb_autopm_get_interface() that is called in pegasus_open() does an autoresume if the device is suspended. input_dev->mutex used in pegasus_resume() is in this case already taken by the input subsystem and will cause a deadlock. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-08-25Input: pegasus_notetaker - directly include workqueue headerMartin Kepplinger1-0/+1
According to the kernel's guidelines, let's directly include the workqueue functions we use. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-07-19Input: pegasus_notetaker - set device mode in reset_resume() if in useMartin Kepplinger1-1/+13
Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-07-19Input: pegasus_notetaker - cancel workqueue's work in suspend()Martin Kepplinger1-0/+1
Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-07-19Input: pegasus_notetaker - fix usb_autopm calls to be balancedMartin Kepplinger1-14/+19
We should only "put" the interface if submitting URB or setting tablet mode in pegasus_open() fails, otherwise leave it to pegasus_close(). Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-07-19Input: pegasus_notetaker - handle usb control msg errorsMartin Kepplinger1-9/+20
Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-06-02Input: add Pegasus Notetaker tablet driverMartin Kepplinger1-0/+421
This adds a driver for the Pegasus Notetaker Pen. When connected, this uses the Pen as an input tablet. This device was sold in various different brandings, for example "Pegasus Mobile Notetaker M210", "Genie e-note The Notetaker", "Staedtler Digital ballpoint pen 990 01", "IRISnotes Express" or "NEWLink Digital Note Taker". Here's an example, so that you know what we are talking about: http://www.genie-online.de/genie-e-note-2/ https://pegatech.blogspot.com/ seems to be a remaining official resource. This device can also transfer saved (offline recorded handwritten) data and there are userspace programs that do this, see https://launchpad.net/m210 (Well, alternatively there are really fast scanners out there :) It's *really* fun to use as an input tablet though! So let's support this for everybody. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>