summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-roccat-kone.c
AgeCommit message (Collapse)Author
2011-11-19HID: roccat: Use kmemdup rather than duplicating its implementationThomas Meyer
Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07HID: roccat: Kone now reports external profile changes via roccat deviceStefan Achatz
Profile changes were only reported when issued mouse internal. Now all changes are reported. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07HID: roccat: cleaned up code for Kone and fixed wrong initialization valueStefan Achatz
Introduced function kone_profile_activated() to reduce code duplication. This by the way fixes a wrong initialization value. Also fixes early mutex unlocks. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07HID: roccat: Fixed false dpi reporting when using osd eventStefan Achatz
Actual dpi resolution was set on wrong occassion. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-13HID: roccat: fix NULL pointer dereference, add range checksStefan Achatz
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>
2011-06-13HID: roccat: correction and cleanup of HID feature reportsStefan Achatz
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>
2011-02-03HID: roccat: Rename header roccat.h -> hid-roccat.hStefan Achatz
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>
2011-02-03HID: roccat: Fix NULL pointer dereference when unloading moduleStefan Achatz
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>
2011-02-03HID: roccat: Add ioctl command to retreive report size from chardevStefan Achatz
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>
2011-02-03HID: roccat: Introduce module hid-roccat-commonStefan Achatz
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>
2011-01-08HID: roccat: reduce number of functions in kone and pyra driversStefan Achatz
The profile number is now passed via bin_attribute->private instead of function parameter to reduce number of functions. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-01-08HID: roccat: use class for char device for sysfs attribute creationStefan Achatz
Adding sysfs attributes to an already created device raises no userland notification. Now the device drivers associate the devices attributes with a class and use this for roccat event char device creation. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-12-10HID: Add and use hid_<level>: dev_<level> equivalentsJoe Perches
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-06-21HID: roccat: remove obsolete kone_abi_version sysfs attributeStefan Achatz
The newest version of the accompanying userland tools cuts backward compatibility and uses libudev to find its devices superseding the quirky kone_abi_version sysfs attribute. Therefore it should be removed. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-06-21HID: roccat: fix offset errors in bin_attribute readStefan Achatz
Fixing wrong calculated offsets in bin_attribute read functions. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-31HID: roccat: change kone_driver_version to kone_abi_versionStefan Achatz
Renamed the sysfs attribute kone_driver_version to kone_abi_version and simplified returned data to integer. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-31HID: roccat: remove obsolete commentStefan Achatz
Removed comment that is obsolete since roccat char device is implemented Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-25HID: roccat: propagate special events of roccat hardware to userspaceStefan Achatz
Module roccat is a char device used to report special events of roccat hardware to userland. These events include requests for on-screen-display of profile or dpi settings or requests for execution of macro sequences that are not stored in device. The information in these events depends on hid device implementation and contains data that is not available in a single hid event or else hidraw could have been used. It is inspired by hidraw, but uses only one circular buffer for all readers. The device is as generic as possible so that the functionality is usable by all (kone and upcomming) roccat device drivers. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-24HID: fix hid-roccat-kone for bin_attr API changeStephen Rothwell
After merging the driver-core tree, today's linux-next build (x86_64 allmodconfig) produced these warnings: drivers/hid/hid-roccat-kone.c:694: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:696: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:701: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:703: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:708: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:710: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:715: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:717: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:722: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:724: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:729: warning: initialization from incompatible pointer type drivers/hid/hid-roccat-kone.c:731: warning: initialization from incompatible pointer type Introduced by commit 867040163f10f2b52b45bc573f330d6eb28f5914 ("sysfs: add struct file* to bin_attr callbacks") from the driver-core tree interacting with commit 14bf62cde79423a02a590e02664ed29a36facec1 ("HID: add driver for Roccat Kone gaming mouse") from the hid tree. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-19HID: roccat: cleanup preprocessor macrosStefan Achatz
Removed useless preprocessor macros and renamed remaining one to be more qualified. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-19HID: roccat: refactor special event handlingStefan Achatz
As special events are reported along with hid event information all events are now processed further by standard handler. Also cleaned up this code. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-19HID: roccat: fix special button supportStefan Achatz
Added new data and changed workaround for abnormal button behaviour according to new gained knowledge about Roccat Kone device. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-18HID: roccat: Correctly mark init and exit functionsStefan Achatz
Added the __init and __exit hints for module functions. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-29HID: update gfp/slab.h includesTejun Heo
Implicit slab.h inclusion via percpu.h is about to go away. Make sure gfp.h or slab.h is included as necessary. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-22HID: add driver for Roccat Kone gaming mouseStefan Achatz
This Patch adds support for Kone gaming mouse from Roccat. It provides access to profiles, settings, firmware, weight, actual settings etc. through sysfs attributes. Event handling of this mouse differs from standard hid behaviour in that tilt button press is reported in each move event which results in strange behaviour if not handled by the driver. This is a heavily reworked version of the previously introduced driver. The changes include most of the previously raised concerns, memory leak and other fixes, code cleanups, adoption of additional achieved knowlege about the hardware and is (IMHO) a much better version than before even when I exchanged reduced USB-IO with a bigger memory consumption. I refused to implement one mentioned point: Removing the 'just-because-we-can' attributes. Motivation: Reading the clipped in weight: I'm no gamer and can't determine the usefulness of this feature but if the manufacturer implements such a feature it might make sense to someone and I would unwillingly limit the functionality besides its such a small feature. Reading the actual profile and dpi settings: Here I can testify that one can get lost of the actual settings when switching back and forth. The manufacturers windows driver has the ability for on-screen-display of the values and there is a mouse in the market that has an lcd on the underside of it to show these values. So I think this feature makes sense not only for me and shouldn't be removed. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>