History log of /linux-master/drivers/hid/hid-roccat-koneplus.c
Revision Date Author Comments
# fadfcf36 20-Jun-2023 Ivan Orlov <ivan.orlov0322@gmail.com>

HID: roccat: make all 'class' structures const

Now that the driver core allows for struct class to be in read-only
memory, making all 'class' structures to be declared at build time
placing them into read-only memory, instead of having to be dynamically
allocated at load time.

Cc: Stefan Achatz <erazor_de@users.sourceforge.net>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# afdf5dd3 20-Jun-2023 Ivan Orlov <ivan.orlov0322@gmail.com>

HID: roccat: make all 'class' structures const

Now that the driver core allows for struct class to be in read-only
memory, making all 'class' structures to be declared at build time
placing them into read-only memory, instead of having to be dynamically
allocated at load time.

Cc: Stefan Achatz <erazor_de@users.sourceforge.net>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230620183141.681353-3-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1aaba11d 13-Mar-2023 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

driver core: class: remove module * from class_create()

The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
something. So just remove it and fix up all callers of the function in
the kernel tree at the same time.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20230313181843.1207845-4-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 93020953 01-Dec-2021 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

HID: check for valid USB device for many HID drivers

Many HID drivers assume that the HID device assigned to them is a USB
device as that was the only way HID devices used to be able to be
created in Linux. However, with the additional ways that HID devices
can be created for many different bus types, that is no longer true, so
properly check that we have a USB device associated with the HID device
before allowing a driver that makes this assumption to claim it.

Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Michael Zaidman <michael.zaidman@gmail.com>
Cc: Stefan Achatz <erazor_de@users.sourceforge.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: linux-input@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
[bentiss: amended for thrustmater.c hunk to apply]
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20211201183503.2373082-3-gregkh@linuxfoundation.org


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

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

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2cf83833 27-Dec-2015 Geliang Tang <geliangtang@163.com>

HID: use kobj_to_dev()

Use kobj_to_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 550dbf47 27-Sep-2013 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Fix "cannot create duplicate filename" problems

Fixing some wrong macro stringification/concatenation.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# eb3156e0 19-Aug-2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

hid: roccat-koneplus: convert class code to use bin_attrs in groups

Now that attribute groups support binary attributes, use them instead of
the dev_bin_attrs field in struct class, as that is going away soon.

Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 46a58c44 24-Jul-2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

HID: roccat: convert class code to use dev_groups

The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the roccat class code to use the
correct field.

Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dfc450b5 19-Jul-2013 Jingoo Han <jg1.han@samsung.com>

HID: replace strict_strtoul() with kstrtoul()

The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# bb060d65 10-Nov-2012 Stefan Achatz <stefan_achatz@web.de>

HID: roccat: deprecate some Koneplus attributes

Introduced attribute "control" and made profile_settings and profile_buttons
readable, which makes profile[1-5]_settings and profile[1-5]_buttons obsolete.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# f114fec5 04-Nov-2012 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Cleanup of koneplus module

Removed caching of profile data which lowers memory footprint,
speeds up init and fixes problems with device reset.
Removed unnecessary infos in header.
Code moved nearer to format of newer drivers.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# fabe51eb 04-Nov-2012 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: enable Koneplus device reset

Device can be reset to factory state by sending a command via info sysfs attr.
Added binary attribute info for this purpose, which obsoletes firmware_version
attribute.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 8e74a2d3 04-Nov-2012 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: add support for KoneXTD

KoneXTD is just a Kone[+] with updated sensor, so it's handled by
koneplus driver.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 5277e97c 17-Oct-2012 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: allow readout of koneplus sensor register data

tcu sysfs attr was used to only control calibration process so far. Direct
sensor register access possibility has been revealed. Allowing readout of tcu
permits usage of this feature.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 7392d73b 20-May-2012 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: rename roccat_common functions to roccat_common2

Did this to illustrate my understanding of the firmware generations:
Valo and Kone were 1st generation
Arvo was externaly developed and lies in the middle
All others until now are considered 2nd generation

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 4728f2dc 20-May-2012 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: move functionality to roccat-common

Reduced code duplication by moving functions from individual drivers
to roccat-common module.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 901e64db 12-Jun-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: fix NULL pointer dereference, add range checks

On rare occassions raw events can be triggered before drvdata gets set up
which leads to NULL pointer dereferences. This was only observed with pyra on
2.6.39, but is fixed for all devices now to play it save.
kovaplus returned wrong actual values when profile change was initiated from host.
Added range checks for setting actual profile on all devices.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 1edd5b42 01-Jun-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: correction and cleanup of HID feature reports

Removed analog feature report enums and modified code in roccat_common
to reflect this. Non standard conform Kone got its own copy of the old
code. That helps extracting more generalizations for newer devices.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 6d1dec85 29-May-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Add "Roccat Talk" support for koneplus

Added binary sysfs attribute to support new functionality the manufacturer
added to koneplus.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# b50f315c 13-Apr-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: fix actual/startup profile sysfs attribute in koneplus

startup_profile and actual_profile didn't work as expected. Also
as the actual profile is persistent, the distinction between the
two was ambiguous, so both use the same code now and startup_profile
has been deprecated. Also the event is now propagated through
chardev. The userland tool has been updated to support this change.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 61c29f5b 14-Mar-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat-koneplus: vorrect mode of sysfs attr 'sensor'

Mode of sysfs attribute 'sensor' was wrongly set to writeonly.
Corrected this to readwrite.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 5dc0c983 03-Feb-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Rename header roccat.h -> hid-roccat.h

It was desired that the header roccat.h should be named hid-roccat.h

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 74b643da 30-Jan-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Fix NULL pointer dereference when unloading module

Class was destroyed before starting the unregistering driver chain.
Disconnecting a device from roccat chardev in this process then
raised a NULL pointer dereference.
Fixed this by destroying class after unregistering driver.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 8211e460 30-Jan-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Add ioctl command to retreive report size from chardev

Roccat chardev was reworked to support only a defined report size per
device and this can be retreived by an ioctl now to enable future changes
in report definitions.
Header was moved/renamed from drivers/hid to include/linux for accessibility.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 432762e2 30-Jan-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Increase waiting time for Kone[+] to prevent occasional freezes

On newer kernels the device freezes occasionally on initialization with just
70msec between reads. Increased this value to safe 100msec.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 5772f636 30-Jan-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Introduce module hid-roccat-common

Module hid-roccat-common contains functions used by roccat device driver
modules to reduce code duplication.
At the moment it contains just two wrapper methods for usb_control_msg
that ensure that the buffer used for transfer is dma capable which wasn't
the case before.
The kconfig option is not visible to the user but will be selected by the
device specific drivers.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# a28764ef 30-Jan-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Use new hid_err macros

Using the new hid_err macros instead of dev_err.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# fd82be6c 06-Jan-2011 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Fix an error message when reading more data from bin attributes

Using cat or something to read from binary attributes would try to do an
additional read with offset equal to filesize. This resulted in an invalid
attribute error. This is fixed by giving the right answer instead of EINVAL.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# dacfecdb 17-Jan-2011 Vasiliy Kulikov <segoon@openwall.com>

HID: hid-roccat-koneplus: potential NULL dereference

kmalloc() may fail, if so return -ENOMEM.
Also koneplus_init_koneplus_device_struct() should check return code
of koneplus_get_startup_profile() and propagate its return code.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 47dbdbff 26-Nov-2010 Stefan Achatz <erazor_de@users.sourceforge.net>

HID: roccat: Add support for Roccat Kone[+] v2

This patch adds support for Roccat Kone[+] gaming mouse. Kone[+] is an enhanced version
of the old Kone with more memory for macros, a better sensor and more functionality.
This driver is conceptual similar to the existing Kone and Pyra drivers.
Userland tools can soon be found at http://sourceforge.net/projects/roccat

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>