linux/drivers/hid/hid-roccat-koneplus.c
<<
>>
Prefs
   1/*
   2 * Roccat Kone[+] driver for Linux
   3 *
   4 * Copyright (c) 2010 Stefan Achatz <erazor_de@users.sourceforge.net>
   5 */
   6
   7/*
   8 * This program is free software; you can redistribute it and/or modify it
   9 * under the terms of the GNU General Public License as published by the Free
  10 * Software Foundation; either version 2 of the License, or (at your option)
  11 * any later version.
  12 */
  13
  14/*
  15 * Roccat Kone[+] is an updated/improved version of the Kone with more memory
  16 * and functionality and without the non-standard behaviours the Kone had.
  17 */
  18
  19#include <linux/device.h>
  20#include <linux/input.h>
  21#include <linux/hid.h>
  22#include <linux/module.h>
  23#include <linux/slab.h>
  24#include <linux/hid-roccat.h>
  25#include "hid-ids.h"
  26#include "hid-roccat-common.h"
  27#include "hid-roccat-koneplus.h"
  28
  29static uint profile_numbers[5] = {0, 1, 2, 3, 4};
  30
  31static struct class *koneplus_class;
  32
  33static void koneplus_profile_activated(struct koneplus_device *koneplus,
  34                uint new_profile)
  35{
  36        koneplus->actual_profile = new_profile;
  37}
  38
  39static int koneplus_send_control(struct usb_device *usb_dev, uint value,
  40                enum koneplus_control_requests request)
  41{
  42        struct roccat_common2_control control;
  43
  44        if ((request == KONEPLUS_CONTROL_REQUEST_PROFILE_SETTINGS ||
  45                        request == KONEPLUS_CONTROL_REQUEST_PROFILE_BUTTONS) &&
  46                        value > 4)
  47                return -EINVAL;
  48
  49        control.command = ROCCAT_COMMON_COMMAND_CONTROL;
  50        control.value = value;
  51        control.request = request;
  52
  53        return roccat_common2_send_with_status(usb_dev,
  54                        ROCCAT_COMMON_COMMAND_CONTROL,
  55                        &control, sizeof(struct roccat_common2_control));
  56}
  57
  58static int koneplus_get_info(struct usb_device *usb_dev,
  59                struct koneplus_info *buf)
  60{
  61        return roccat_common2_receive(usb_dev, KONEPLUS_COMMAND_INFO,
  62                        buf, sizeof(struct koneplus_info));
  63}
  64
  65static int koneplus_get_profile_settings(struct usb_device *usb_dev,
  66                struct koneplus_profile_settings *buf, uint number)
  67{
  68        int retval;
  69
  70        retval = koneplus_send_control(usb_dev, number,
  71                        KONEPLUS_CONTROL_REQUEST_PROFILE_SETTINGS);
  72        if (retval)
  73                return retval;
  74
  75        return roccat_common2_receive(usb_dev, KONEPLUS_COMMAND_PROFILE_SETTINGS,
  76                        buf, sizeof(struct koneplus_profile_settings));
  77}
  78
  79static int koneplus_set_profile_settings(struct usb_device *usb_dev,
  80                struct koneplus_profile_settings const *settings)
  81{
  82        return roccat_common2_send_with_status(usb_dev,
  83                        KONEPLUS_COMMAND_PROFILE_SETTINGS,
  84                        settings, sizeof(struct koneplus_profile_settings));
  85}
  86
  87static int koneplus_get_profile_buttons(struct usb_device *usb_dev,
  88                struct koneplus_profile_buttons *buf, int number)
  89{
  90        int retval;
  91
  92        retval = koneplus_send_control(usb_dev, number,
  93                        KONEPLUS_CONTROL_REQUEST_PROFILE_BUTTONS);
  94        if (retval)
  95                return retval;
  96
  97        return roccat_common2_receive(usb_dev, KONEPLUS_COMMAND_PROFILE_BUTTONS,
  98                        buf, sizeof(struct koneplus_profile_buttons));
  99}
 100
 101static int koneplus_set_profile_buttons(struct usb_device *usb_dev,
 102                struct koneplus_profile_buttons const *buttons)
 103{
 104        return roccat_common2_send_with_status(usb_dev,
 105                        KONEPLUS_COMMAND_PROFILE_BUTTONS,
 106                        buttons, sizeof(struct koneplus_profile_buttons));
 107}
 108
 109/* retval is 0-4 on success, < 0 on error */
 110static int koneplus_get_actual_profile(struct usb_device *usb_dev)
 111{
 112        struct koneplus_actual_profile buf;
 113        int retval;
 114
 115        retval = roccat_common2_receive(usb_dev, KONEPLUS_COMMAND_ACTUAL_PROFILE,
 116                        &buf, sizeof(struct koneplus_actual_profile));
 117
 118        return retval ? retval : buf.actual_profile;
 119}
 120
 121static int koneplus_set_actual_profile(struct usb_device *usb_dev,
 122                int new_profile)
 123{
 124        struct koneplus_actual_profile buf;
 125
 126        buf.command = KONEPLUS_COMMAND_ACTUAL_PROFILE;
 127        buf.size = sizeof(struct koneplus_actual_profile);
 128        buf.actual_profile = new_profile;
 129
 130        return roccat_common2_send_with_status(usb_dev,
 131                        KONEPLUS_COMMAND_ACTUAL_PROFILE,
 132                        &buf, sizeof(struct koneplus_actual_profile));
 133}
 134
 135static ssize_t koneplus_sysfs_read(struct file *fp, struct kobject *kobj,
 136                char *buf, loff_t off, size_t count,
 137                size_t real_size, uint command)
 138{
 139        struct device *dev =
 140                        container_of(kobj, struct device, kobj)->parent->parent;
 141        struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev));
 142        struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
 143        int retval;
 144
  94        if (">request = command)
  46  30 0ef">retval;
 117
  94        if (size_t command)
  59                return -EINVAL;
 120
  51        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
  92        retval = roccat_common2_receive(usb_dev, usb_dev, buf, );
  51        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
 144
  94        if (retval)
  46  30 a>        int retval;
  57
 118        return retval;
 119}
 120
 135static ssize_t file *fp, struct kobject *kobj,
  62   33 const *buf, loff_t off, size_t count,
  93                size_t real_size, uint command)
 138{
  39        struct device *dev =
  66  93                container_of(kobj, struct device, kobj)->parent->parent;
  39        struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev));
  42        struct usb_device *usb_dev = interface_to_usbdev(to_usb_intevdata(dev));
  43        int retval;
 120
  94        if (size_t command)
  62                return -EINVAL;
  13
 151        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
  92        retval = roccat_common2_send_with_status(usb_dev,   76                        buf, );
 127        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
  78
  94        if (retval)
  80  30 a>        int retval;
  91
  82        return retval;
 133}
 144
 135static ssize_t file * 144
  66                struct kobject *kobject * 144
 137                loff_t off, size_t retval)
 138{
  82        return file *buf, off, count,
 140          ref">buf, sizeof(struct usb_dev,  133}
  52
 135static ssize_t file * 144
  66                struct kobject *kobject * 144
  95                loff_t off, size_t retval)
 138{
  97        return file *buf, off, count,
  98          ref">buf, sizeof(struct usb_dev, KONMACRUactual_profile);
  99}
 100
 135static ssize_t file * 144
 102                struct kobject *kobject * 144
  93                loff_t off, size_t retval)
 138{
 197        return koneplus_sef">file *buf, off, count,
 106          ref">buf, sizeof(struct usb_dev, KONSENSORactual_profile);
 107}
 108
 135static ssize_t file * 144
  80                struct kobject *kobject * 144
 131                loff_t off, size_t retval)
 138{
 197        return file *buf, off, count,
  84          ref">buf, sizeof(struct usb_dev, KONSENSORactual_profile);
  85}
  96
 135static ssize_t file * 144
  88                struct kobject *kobject * 144
  59                loff_t off, size_t retval)
 138{
 197        return file *buf, off, count,
 122          ref">buf, sizeof(struct usb_dev,  133}
 144
 135static ssize_t file * 144
  66                struct kobject *kobject * 144
 137                loff_t off, size_t retval)
 138{
  82        return koneplus_sef">file *buf, off,  138{
 140          ref">buf, sizeof(struct usb_dev,  133}
  52
 135static ssize_t file * 144
  66                struct kobject *kobject * 144
  95                loff_t off, size_t retval)
 138{
  39        struct device *dev =
  98                        container_of(kobj, struct device, kobj)->parent->parent;
 139        struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev));
 100
  94        if (">>buttons, sizeof(struct  100
  62         0ef">retval;
  13
  94        if (size_t >>buttons, sizeof(struct  100
  95                >buttons, sizeof(struct loff_t retval;
  96
 127        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
 128        (parent->(parent->size_t   59  95                 127        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
  91
  82        return  133}
 144
 135static ssize_t file * 144
  46                struct kobject *kobject * 144
 137                loff_t off, size_t retval)
 138{
 139        struct device *dev =
 140                        container_of(kobj, struct device, kobj)->parent->parent;
 141        struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev));
 142        struct usb_device *usb_dev = interface_to_usbdev(to_usb_intevdata(dev));
 143        int 0ef">retval;
 143        int parent;
  43        int parent;
  s, sizeof(struct parent;
  57
  94        if (size_t  100
  59                return -EINVAL;
 120
  51        (ns, sizeof(struct kobj)->parent;
  92                      &parent->        parent;
  13
 151        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
  92        usb_dev = ( 144
  76          >buttons, sizeof(struct );
 194        if ( 138{
  98  a>        int ">ssize_t ( 138{
  59  95          ns, sizeof(struct );
  80  94        int  100
 131  L124"> 151        ( 100
 122          76          >buttons, sizeof(struct );
 1L133"> 133}
 151        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
);
  94        if (retval)
 137  30 a>        int retval;
 108
  82 >buttons, sizeof(struct retval;
 133}
  91
 135static ssize_t file * 144
  93                struct kobject *kobject * 144
  66                loff_t off, size_t retval)
 138{
  s, sizeof(struct device *dev =
 137  66                container_of(kobj, struct device, kobj)->parent->parent;
  42        struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev));
dev));
  94        if (">>buttons, sizeof(struct  100
 131         0ef">retval;
  52
  94        if (size_t >>buttons, sizeof(struct  100
  66                >buttons, sizeof(struct loff_t retval;
);
 151        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
 127        (parent->(parent->size_t   98                         151        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
 120
 197        return  133}
  13
 135static ssize_t file * 144
  95                struct kobject *kobject * 144
  76                loff_t off, size_t retval)
 138{
  42        struct device *dev =
  59                        container_of(kobj, struct device, kobj)->parent->parent;
  42        struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev));
 141        struct usb_device *usb_dev = interface_to_usbdev(to_usb_intevdata(dev));
 143        int 0ef">retval;
 143        int parent;
 151        parent;
  42        struct parent;
  96
 194        if (size_t  100
  98                return -EINVAL;
dev));
 127        (ns, sizeof(struct kobj)->parent;
  51                      &parent->        parent;
  52
  51        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
 151        usb_dev = ( 144
  95  "L68">  4buttons, sizeof(struct );
  94        if ( 138{
 137                ">ssize_t ( 138{
  98                  ns, sizeof(struct );
  59  94        int  100
 140                        ( 100
 131  L124"> 195  "L68">  4buttons, sizeof(struct );
  L133"> 133}
  51        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
 144
  94        if (retval)
  76  30 a>        int retval;
  57
 182 >buttons, sizeof(struct retval;
 133}
 120
 135static ssize_t device * 100
 122  ysfs_read(struct kobject *retval)
 138{
 142        struct koneplus_device *138"> 138{
  95  "L68">  oneplus = hid_get_drvdata(dev_get_drvdata(kobj)->parent->);
  30 a>        int ("%d\n"device, parent->);
 133}
 108
 135static ssize_t (struct device * 100
 140  ysfs_read(struct kobject *(size_t < cla="+code=size_t" claasssef">retval)
 138{
 142        struct koneplus_device * 141        struct usb_device * 1unsigned longsarent->);
  43        int retval;
  s, sizeof(struct size_t retval;
  57
 128        kobj)->parent->parent;
 151        koneplus = hid_get_drvdata(dev_get_drvdata(dev));
 127        usb_dev = interface_to_usbdev(to_usb_intevdata(dev));
  91
  92        ">ssize_t (dev));
  94        if (retval)
  66  30 a>        int retval;
);
  94        if (>4ef">retval)
 137  30        return -EINVAL;
 108
 151        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
 120
  51        ">ssize_t ();
 194        if ( 138{
 1L106"> 151        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
  66  30 a>        int retval;
  L133"> 133}
  96
 127        < class="scode=konactivat_dofile_settings" class="scode=konactivat_dlus_st_drvdata();
 108
 151        (">ssize_t retval;
 127        (d1"+code=kobject"f">d1="srf">">ssize_t retval;
  51        (d2"+code=kobject"f">d2="srf">0ef">retval;
  92        (">ssize_t retval;
  51        (parent-> 100
  66          ith_status();
);
  51        parent->< class="skuck="+code=EINVAL" class="skuckactual_profile);
  57
 182 f">size_t < cla="+code=size_t" claasssl_profile);
 133}
 120
 135static ssize_t   85href="drivers/hid/hid-rocca3t-kne"31name="L13">  13
 100
 122  ysfs_read(struct kobject *retval)
 138{
 142        struct loff_t4138"> 138{
  95  "L68">  oneplus = hid_get_drvdata(();
  30 a>        int (  51         135e=ssize_t" class="srto_usbdev();
size_t4);
 100
 138{
retval)
retva__ATTRlu3s.c#L48" id=__ATTRt-koneplu3s.c#L56" idetring">"%d\n"device<, 0660occa3t-kne"31name="L13">  13
 100
 135static   13
 100
 135static   13
retva__ATTRlu3s.c#L48" id=__ATTRt-koneplu3s.c#L56" is=3rtup"line35ame="L135"> 135  13
 100
 135static   13
file 100
 135static   13
 135e=ssize_t" class="sr, 0440occa3t-kne"31name="L13">  13
size_t dev =
 135static -&NULrs/hid/hid-roccaNULr cla)occa3t-kne"31name="L13">  13
  __ATTR_NULrs/hid/hid-rocca__ATTR_NULrtings"code=ko"sreal_profile);
device *4a hre4="+cod}o_usbdev(parent-> 133}
dev_get_drvdata(<4 href421class=3"lin100"> 100
kob/a> =
retval)
to_usb_intevdata(<4 href4"+code=dev" clde=buf" classsef">retval)
 122  ysfs_read2 122  y hre>  92(  5660 }occa3t-kne"31name="L13">  13
  51   nsor cla)occa3t-kne"31name="L13">  13
  51  href="+codsensorlassocca3t-kne"31name="L13">  13
"+cod/hid-rocca3t-koneplu3s.c#L81" idhref="+codesensorne38name="L51">  51  href="+codesensorlass=3"line39name=L133"> 133}
  13
retval)
 122  ysfs_read2 122  y hre>  92(  5220 }occa3t-kne"31name="L13">  13
  51 tcu cla)occa3t-kne"31name="L13">  13
kobj)->"+cod/hid-rocca3t-koneplu3s.c#L81" idhref="+codetcune38name="L51">  51 dhref="+codetculass=3"line39name=L133"> 133}
  13
retval)
 122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
  51 tcu_image cla)occa3t-kne"31name="L13">  13
  51 dhref="+codtcu_imagelass=3"line39name=L133"> 133}
  13
retval)
 122  ysfs_read2 122  y hre>  92(  5220 }occa3t-kne"31name="L13">  13
occa3t-kne"31name="L13">  13
"+cod/hid-rocca3t-koneplu3s.c#L81" idhref="+coded-rocca2t-koneplu2s.c#L89" id="L89" clasdhref="+coded-rocca2t-konepllass=3"line39name=L133"> 133}
  13
retval)
 122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
occa3t-kne"31name="L13">  13
  13
-><"34ame="L140"> 140  -><"52" [0]cca3t-kne"31name="L13">  13
  13
retval)
 122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
occa3t-kne"31name="L13">  13
device 4  13
-><"34ame="L140"> 140  -><"52" [1]cca3t-kne"31name="L13">  13
  13
retval)
parent-> 122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
occa3t-kne"31name="L13">  13
  13
-><"34ame="L140"> 140  -><"52" [2]cca3t-kne"31name="L13">  13
device 4  13
size_t <4cla="461plus" class=de=buf" classsef">retval)
 122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
konep4us_device *occa3t-kne"31name="L13">  13
usb_device *  13
-><"34ame="L140"> 140  -><"52" [3]cca3t-kne"31name="L13">  13
  13
retval)
 122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
parent->occa3t-kne"31name="L13">  13
dev_get_drvdata(<4 href47e=retval" class="srsLlu3s.c#L92" id=""+cors/hid/hid-rocca3ad/hid-rocca3t-koneplu3s.c#L81" idhref="+cods=2"linx2t-koneplu2s.c#L89" id="L89" clasdhref="+cods=2"linx2t-konepllassocca3t-kne"31name="L13">  13
to_usb_intevdata(<4 href47="+code=buf" class="Llu3s.c#L92" id="L9_status(-><"34ame="L140"> 140  -><"52" [4]cca3t-kne"31name="L13">  13
  13
  4           &retval)
4 94        if ( 122  ysfs_read2 122  y hre>  92(  5220 }occa3t-kne"31name="L13">  13
  13
"+cod/hid-rocca3t-koneplu3s.c#L81" idhref="+codes=3line"33ame="L137"> 137           href="+codes=3line"33ame="lass=3"line39name=L133"> 133}
  13
retval)
 122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
  13
 137           href="+cods=2"linx233ame="lassocca3t-kne"31name="L13">  13
->-><"34ame="L140"> 140  -><"52" [0]cca3t-kne"31name="L13">  13
 144        if (  13
4>< class="skuck="+cod4=EINV4L" class="skucde=buf" classsef">retval)
 122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
  13
 137           href="+cods=2"linx233ame="lassocca3t-kne"31name="L13">  13
-><"34ame="L140"> 140  -><"52" [1]cca3t-kne"31name="L13">  13
  13
retval)
4>ssize_t  122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
d2"4code=49="+code=dev" class="Llu3s.c#L92" id="  13
6>ssize_t  137           href="+cods=2"linx233ame="lassocca3t-kne"31name="L13">  13
parent<4a>->-><"34ame="L140"> 140  -><"52" [2]cca3t-kne"31name="L13">  13
  13
retval)
 122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
  13
size_t <4cla="49"+code=buf" classssl_lu3s.c#L92" id=""+cors/hid/hid-rocca3ad/hid-rocca3t-koneplu3s.c#L81" idhref="+cods=2"linx233ame="L137"> 137           href="+cods=2"linx233ame="lassocca3t-kne"31name="L13">  13
-><"34ame="L140"> 140  -><"52" [3]cca3t-kne"31name="L13">  13
  13
retval)
 122  ysfs_read2 122  y hre>  92(  5440"}occa3t-kne"31name="L13">  13
  13
loff_t51lu3s.c#L92" id=""+cors/hid/hid-rocca3ad/hid-rocca3t-koneplu3s.c#L81" idhref="+cods=2"linx233ame="L137"> 137           href="+cods=2"linx233ame="lassocca3t-kne"31name="L13">  13
-><"34ame="L140"> 140  -><"52" [4]cca3t-kne"31name="L13">  13
  13
size_t5retval)
 122  ysfs_read2 122  y hre>  92(  5220 }occa3t-kne"31name="L13">  13
 137          macro"L128occa3t-kne"31name="L13">  13
"+cod/hid-rocca3t-koneplu3s.c#L81" idhref="+codemacroL137"> 137          dhref="+codemacrolass=3"line39name=L133"> 133}
  13
retval)
 122  ysfs_read2 122  y hre>  92(  5220 }occa3t-kne"31name="L13">  13
file 137          talk"L128occa3t-kne"31name="L13">  13
"+cod/hid-rocca3t-koneplu3s.c#L81" idhref="+codetalkL137"> 137          dhref="+codetalklass=3"line39name=L133"> 133}
size_t   13
  __ATTR_NULrs/hid/hid-rocca__ATTR_NULrtings"code=ko"sreal_profile);
device *5a hre5="+cod}o_usbdev(parent-> 133}
dev_get_drvdata(<5 href521class=3"linko"srel_profile         init_         u3s.c#L3c.c#LL137"> 137          init_         u3s.c#L3c.c#Lclass3c.c#L94" id="L94" cla 141  13
to_usb_intevdata(<5 href52="+code=dev" class="L5ame="L138"> 138{
 142        sef_attribut_"sref">kobject *        int retval)
"drivers/hid/hid-rocca3t-koneplass="sarent-&irs/hid/hid-roccineplo_usbdev( -kons=3"line36ame="Lin/hid-rocca4-koneplus4wains=3"line36ame="wain/hid-ro2051        5*  L133"> 133}
  /hid-rinitef="drivers/hid/hid-rinitclassplu3s.c#L96" id="L96" class=3"line39name="L66">  51        5>le"coiva5butt_buofile_settings" c5ass="52ttings"code=ko"sreal_profile);
 100
 141  51        5/hid/hid-5occa3-koneplus3c#L129" i5="L1253="+code=dev" o"sresref">dev));
kobj)->dev));
( 138{
 122 122  y hline39name="L66"sleep          55*dev));
   13
dev_3">   13
  51        dev));
5/hid/hid-5  13

dev));
 122  y hs=3"line37n5f" classs5ref">kobj)->dev));
  55*dev));
"+cod/hid-rocca3t-ko5eplu35.c#L81" idhref="+codedline370me=".c#L81" is   13>  13
   13>  13  51        dev));

5/hid/hid-5  13>  13
dev));
 122  y hs=3"line37n5f" classs5ref">kobj)-> 122 122  y hLsLsLsLsLsLsLsLsLsLsLs+code=dev" o"sresref">dev));
);
  /hid-rinitef="dtus(<5 href="+code=uint#L131" 5d="L154L96" class=3"line39name="L66"sleep          55*dev));
);
 "L13">  13
 "L13">  13line39name="L66">  51        dev));
kobj)-> 122 122  y hLsLsLsLsLsLsLs+code=dev" o"sresref">dev));
  13
<"L1ca3t-137         ="L13">  13
<"L1ca3t-1line39name="L66">  5amp;kobj)->
  L133"> 133}

);
paren5-55id="L95" class=3"line39ame="_profile);
 122
 "_p       sef_attribut_"s"_p       > *        );
(<5/hid/hid-ro3-4oneplus3c.5#L94"5id="L9ode=retval" class="sre L138"> 138{
 141<   erfa3t-kne"31name="L13">    erfa3t> * a>        int   5h>        5/hid/hid-5ata( 1id-4occa3-koneplus3c#L105" i4="ng52line38name="L45">  L133"> 133}
 141  13
to_usb_intevdata(<5 hrL63" class=3"line3   erfa3t_to_1415">to_usb_intevdat   erfa3t_to_1415">line39name="L66">  5/a> a>        int   L133"> 133}

5ize_t <4cls=3"line35ame="L124"> 142        sef_attribut_"sref">kobject *        int   L133"> 133}
  L133"> 133}

 a>        int 5/hid/hid-5cur_alt
        int 5/hid/hid-5atsc( bI  erfa3tProtoco"+code=to_usb_inbI  erfa3tProtoco"ref="drivers/hid/hid-rocca3riverta(
 138{
(<5 href="+code=uint#L131" 5d="L156id="L95" class=3"line39ame="_profile);

(deGFP_KERNE ref="ng52line38name="L45">  L133"> 133}
(<5rivers4hbutt_bue4occa3tk5neplu56 hre22"> 122  y hs=3"!tractual_pr5lhid/hid-5/a>        int  138{
 122  y h+codtcu_tractual_pr5lhi"_p erget_drvdata("_p ergline39name="L66">  5h>          5220 }occa3t-kne"31ncan't alloc ect  13  L133"> 133}
  5ENOMEM        L133"> 133}
);
(<5 href="+code=uint#L131" 5d="L151" class=rent->tractual_pr5lhi"_p     drvdataet_drvdata("_p     drvdataline39name="L66">  5h>                int   L133"> 133}

  4      5    &57href="drivers/hid/hid-rocca3riverta(4 945     57 hre22"> 122  y h
  51                int   L133"> 133}

 122  y hs=3"line37n5f" classs5ref">kobj)-> 138{
("_p ergline39name="L66">  5h>          5220 }occa3t-kne"31ncouldn't t-kols=3"lineplu3s.c#L63" i\n"L13">  13  L133"> 133}
"+cod/hid-rocca3t-ko5eplu35.c#L81" idhref="+codesssssssssgoto_tractual_pr5lhiexkonfre sef_attribut_"sexkonfre e" 5ng52line38name="L45">  L133"> 133}
(<5f="drive7  304/a>   5    r57 hre22"> 122  y hhr40ttings"code=ko"sreal_profile);
 100
 122  y h
 10_conneef="drivers/hid/h8"> 10_conneefline39name="L66">  5amp;         100
  13
 10_reporf="drivers/hid/hid-rocca38"> 10_reporf5ract"ng52line38name="L45">  L133"> 133}
kobj)-> 138{
(<5 href="+code=uint#L131" 5d="L151" class=rent->+codtcu_tractual_pr5lhi"_p erget_drvdata("_p ergline39name="L66">  5h>          5220 }occa3t-kne"31ncouldn't t-kolchar ect\n"L13">  13  L133"> 133}

4>< 5lass=58 hre22"> 122  y h} elsecode=retval" class="sre L138"> 138{

  34 a>5     58L81" idhref="+cods=2"""""""""me="L1foonep  &5/hid/hid-5chrect_min="driversc7id/hidchrect_min="id="L63" class=3"line38ref="+code=to_usb_interface" 5ng52line38name="L45">  L133"> 133}
 122  y h""""""""me="L1foonep  &5/hid/hid-58"> 10_claim-137         8"> 10_claim-1id="L631ng52line38name="L45">  L133"> 133}
);
 138{
->tractual_pr5lhi"_p     drvdataet_drvdata("_p     drvdataline39name="L66">  5h>        de> *5a hr"ng52line38name="L45">  L133"> 133}
 122  L133"> 133}
4>ssize_5 595 href521class=3"linko"srel_profile         ini"> 122 122  L133"> 133}
  L133"> 133}

  5amp;  L133"> 133}
(<5 href="+code=uint#L131" 5d="L151" class=rentdev));

  L133"> 133}
 4>< c5ass="595="L1252 class=3"line38name="L96">  /hid-rinitef="d"> 122  13
 "_p       sef_attribut_"s"_p       > *        );
 138{
 141<   erfa3t-kne"31name="L13">    erfa3t> * a>        int   5h>        5/hid/hid-5ata( 1id-4occa3-koneplus3c#L105" i4="ng52line38name="L45">  L133"> 133}
(<6 href="+code=uint#L131" 6d="L160ze_t <4cls=3"line35ame="L124"> 142        sef_attribut_"sref">kobject *        int   L133"> 133}

  L133"> 133}

 a>        int 5/hid/hid-5cur_alt
        int 5/hid/hid-5atsc( bI  erfa3tProtoco"+code=to_usb_inbI  erfa3tProtoco"ref="drivers/hid/hid-rocca3rive> 133}

 122  y hhhhhhhhh=63" class=3"line3USB_INTERFACE_PROTOCOL_MOUSE+code=to_usb_inUSB_INTERFACE_PROTOCOL_MOUSE5pro+code=retval" class="sre L138"> 138{
        int ("_p g   drvdataline39name="L66">  5h>          L133"> 133}
4occa3t6lu3s.6#L81" idhref="+cods=2"s=3"line37n5f" clasamp;5/hid/hid-58"> 10_claim-137         8"> 10_claim-1id="L95" class=3"line39ame="_profile);
(<6 href="+code=uint#L131" 6d="L161" class=rent->=3line"dtractual_pr5lhi8"> 10_disconneef="drivers/hid/h8"> 10_disconneefe" 539name="L66">  5amp;5/hid/hid-5chrect_min="driversc7id/hidchrect_min="id=""ng52line38name="L45">  L133"> 133}
(<6  ysfs_read2 122  y hme="L1foonep  &afre sef_attribut_"skfre e" 539name="L66">  5amp;  L133"> 133}
  L133"> 133}
 122  L133"> 133}
         in6e38name="651">"+cod/hid-rocca3t-ko6eplu361      init_         u3s.c#L3c.c#Lclass3cprob sef_attribut_"sref">kobjprob  class=3"line36ame="L143"> "_p       sef_attribut_"s"_p       > *         100

->constls=3"line35ame="L124"> "_p       _i137         "_p       _i1> *         i1id="L95" class=3"line39ame="_profile);
"drivers/h6"> 122(  L133"> 133}
);
"+cod/hid-rocca3t-ko6eplu36.c#L81" idhref
  5h>          L133"> 133}

kobj)-> 138{
->tractual_pr5lhi"_p erget_drvdata("_p ergline39name="L66">  5h>          5220 }occa3t-kne"31n#L1s  failed\n"L13">  13  L133"> 133}
parent6><61 hre22"> 122  y hgoto_tractual_pr5lhiexkosef_attribut_"sexkoe" 5ng52line38name="L45">  L133"> 133}
dev_get_drvda6a620      L133"> 133}
 1376/a>  623lineg52line38name="L45">  L133"> 133}
  5h>          L133"> 133}
5       int kobj)-> 138{
("_p ergline39name="L66">  5h>          5220 }occa3t-kne"31nhw  inrf failed\n"L13">  13  L133"> 133}
  L133"> 133}
  L133"> 133}

  L133"> 133}
);

  5h>          L133"> 133}
kobj)-> 138{
("_p ergline39name="L66">  5h>          5220 }occa3t-kne"31ncouldn't t- inll mousi\n"L13">  13  L133"> 133}
  L133"> 133}
  L133"> 133}
  L133"> 133}
  L133"> 133}
);
  L133"> 133}
  5h>          L133"> 133}
  L133"> 133}
(  L133"> 133}
  L133"> 133}
"+cod/hid-rocca3t-ko6eplu3643lineg52line38name="L45">  L133"> 133}


 "_p       sef_attribut_"s"_p       > *        );
"drivers/h6"> 122 122<  13
  5h>          L133"> 133}
  5h>          L133"> 133}
  L133"> 133}
  L133"> 133}
  -><"52" [4f="driv5/keep_facues_up_to_d/a> class=3"line36ame="L143"> 142        sef_attribut_"sref">kobject *        int  100
 122  y h
);
 122"drivers/h6f="driver6/hid/hid-ro3-4oneplus3c.6#L94"6id="L94" classme="L13">  13
kobj5ousi_reporf>>  13  13<_reporf="drivers/hid/h>  13<_reporfe" 5ng52line38name="L45">  L133"> 133}

(dataline[0]tcode=retval" class="sre L138"> 138{

 122  13
(KONEPLUS_MOUSE_REPORT_NUMBER_BUTTONe" 5:g52line38name="L45">  L133"> 133}
paren6-65d="L94" class=3line"tline370me=".c#L>  13<_reporf="drivers/hid/h>  13<_reporfe" 5 = ame="L13">  13
kobj5ousi_reporf>>  13(datalineng52line38name="L45">  L133"> 133}
->switch3"line37n5f" clas>  13<_reporf="drivers/hid/h>  13<_reporfe" 5"srefef">5/hid/hid-5typt-kne"31name="L1typt5ractcode=retval" class="sre L138"> 138{
(<6/hid/hid-ro3-4oneplus3c.6#L94"65 hre22"> 122  y hcase3">  13
  L133"> 133}
 122  y h+codtcu_tractual_pr5lhiref">kobjpro/a>
<"L1ca3t-137         ="L13">  13
<"L1ca3t-1line39name="L66">  5amp;  13<_reporf="drivers/hid/h>  13<_reporfe" 5"srefef">5/hid/hid-5data1et_drvdata(datad="L94- 1"ng52line38name="L45">  L133"> 133}
  L133"> 133}

66L81" idhref="+cods=2"hr40ttings"code=ko"sreal_profile);
  L133"> 133}

  L133"> 133}
  L133"> 133}

  L133"> 133}
  13
to_chrect class=3"line36ame="L143"> 142        sef_attribut_"sref">kobject *        int  100

);
(<6rivers4hbutt_bue4occa3tk6neplu66d="L9ode=retval" class="sre L138"> 138{
 v5h6=konb8"> 10_reporf="drivers/hid/hid-rocca38"> 10_reporf5racdtractual_pr5lhi8"> 10_reporf="drivers/hid/h8"> 10_reporf5racng52line38name="L45">  L133"> 133}
 ref="driv5ousi_reporf>>  13kobj5ousi_reporf>>  13  13<_reporf="drivers/hid/h>  13<_reporfe" 5ng52line38name="L45">  L133"> 133}
         in6tus(<6 href="+code=uint#L131" 6d="L161" class=rent(dataline[0] !63" class=3"line3KONEPLUS_MOUSE_REPORT_NUMBER_BUTTONet_drvdata(KONEPLUS_MOUSE_REPORT_NUMBER_BUTTONe" 5L95" class=3"line39ame="_profile);

  4      6    &67" class=rent->LsLsLsng52line38name="L45">  L133"> 133}
4 946     67uck="g52line38name="L45">  L133"> 133}

 122<  13
  13<_reporf="drivers/hid/h>  13<_reporfe" 5 = ame="L13">  13
kobj5ousi_reporf>>  13(datalineng52line38name="L45">  L133"> 133}
);
"+cod/hid-rocca3t-ko6eplu36.c#L81" idhrefs=3""line37n5f" clas>  13<_reporf="drivers/hid/h>  13<_reporfe" 5"srefef">5/hid/hid-5typt-kne"31name="L1typt5rach=63" class=3"line3KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH+code=to_usb_inKONEPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH5rach||95" class=3"line39ame="_profile);
(<6f="drive7  304/a>   6    r67 hre22"> 122  y h2"> 122<  13
  13<_reporf="drivers/hid/h>  13<_reporfe" 5"srefef">5/hid/hid-5typt-kne"31name="L1typt5rach=63" class=3"line3KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER+code=to_usb_inKONEPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER5ractcne370ne37095" class=3"line39ame="_profile);
 122  y h+codtcu_tractual_pr5lhi>  13<_reporf="drivers/hid/h>  13<_reporfe" 5"srefef">5/hid/hid-5data2et_drvdata(data" clas!63" class=3"line3KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS+code=to_usb_inKONEPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESSe" 5L95" class=3"line39ame="_profile);
 122  y hLsLsLsng52line38name="L45">  L133"> 133}
         in6/hid/hid-6occa3ad/hid-rocca3t-kone6lu3s.68d="L94" classca3t-kne"31name8"> 10_reporf="drivers/hid/h8"> 10_reporf5rac<"34ame="L140"> typt-kne"31name="L1typt5rach=<  13
  13<_reporf="drivers/hid/h>  13<_reporfe" 5"srefef">5/hid/hid-5typt-kne"31name="L1typt5racng52line38name="L45">  L133"> 133}

 10_reporf="drivers/hid/h8"> 10_reporf5rac<"34ame="L140"> data1et_drvdata(datad="L94=<  13
  13<_reporf="drivers/hid/h>  13<_reporfe" 5"srefef">5/hid/hid-5data1et_drvdata(datad="L9ng52line38name="L45">  L133"> 133}
4>< 6lass=68L81" idhref="me="L1foonep  &8"> 10_reporf="drivers/hid/h8"> 10_reporf5rac<"34ame="L140"> data2et_drvdata(data" clas=<  13
  13<_reporf="drivers/hid/h>  13<_reporfe" 5"srefef">5/hid/hid-5data2et_drvdata(data" clang52line38name="L45">  L133"> 133}

  34 a>6     68 hre22"> 122<  13
 10_reporf="drivers/hid/h8"> 10_reporf5rac<"34ame="L140">  13
        int 5/hid/hid-5"L13">  13
  13line +31ng52line38name="L45">  L133"> 133}
 122 10_reporf_ev-4occa3-koneplus3c8"> 10_reporf_ev-4oline39name="L66">  5amp;5/hid/hid-5chrect_min="driversc7id/hidchrect_min="id=",c52 class=3"line38ame="L108"> 100
  51int8_  10_reporf="drivers/hid/h8"> 10_reporf5rac"ng52line38name="L45">  L133"> 133}
  L133"> 133}
 100
 122 "_p       sef_attribut_"s"_p       > *         100
4>ssize_6 69L81" idhref="+cods=2"s=3"line36ame="L143"> "_p reporf="drivers/hid/h"_p reporf> * *< e=konbut5gt;        int (dataline,         u3s.c#L3c.c"31net_drvdata("31ne" 5L95" class=3"line39ame="_profile);
 122 138{
 141<   erfa3t-kne"31name="L13">    erfa3t> * a>        int   5h>        5/hid/hid-5ata( 1id-4occa3-koneplus3c#L105" i4="ng52line38name="L45">  L133"> 133}

 142        sef_attribut_"sref">kobject *        int ("_p g   drvdataline39name="L66">  5h>          L133"> 133}
(<6 href="+code=uint#L131" 6d="L169L81" g52line38name="L45">  L133"> 133}

 a>        int 5/hid/hid-5cur_alt
        int 5/hid/hid-5atsc( bI  erfa3tProtoco"+code=to_usb_inbI  erfa3tProtoco"ref="drivers/hid/hid-rocca3rive> 133}
 133}
 122  y hLsLsLsLing52line38name="L45">  L133"> 133}
 100
        int de> *5a hr"c52 class=3"line38ame="L108"> 100
(<7 href="+code=uint#L131" 7d="L170 hre22"> 122  y hLsLsLsLing52line38name="L45">  L133"> 133}

  L133"> 133}

  5amp;(datalineLng52line38name="L45">  L133"> 133}

  L133"> 133}
5/hid/hid-58"> 10_claim-137         8"> 10_claim-1id="L95" class=3"line39ame="_profile);
4occa3t7lu3s.7#L81" idhref="+cods=2"  13
to_chrect clas9name="L66">  5amp;(datalineLng52line38name="L45">  L133"> 133}
 4>< c7d="L1705="L1252 class=3"line38name="L96">  /hid-rinitef="7t7s(<7  ysfs_read2 122  L133"> 133}
(<7 hid/hid-ro3-4oneplus3c.7     7      _g52line38name="L45">  L133"> 133}
 122 "_p       _i137         "_p       _i1> * 142        /a>
 138{
"+cod/hid-rocca3t-ko7eplu371d="L94" class{=Lractual_pr5lhiHID_USB_DEVICE+code=to_usb_inHID_USB_DEVICE clas9name="L66">  5USB_VENDOR_ID_ROCCAT       100

  L133"> 133}
  L133"> 133}
 122  L133"> 133}
  5hi137         "_pass= e=konbut5gt;        /a>
  L133"> 133}
"+cod/hid-rocca3t-ko7eplu3715="L1252 class=3"line38name="L96">  /hid-rinitef="7/a>
 "_p  "line37         "_p  "line> * 142   "line37         142   "line5codL63ode=retval" class="sre L138"> 138{
(<7a__ATTR_NULrtings"code=k7"srea71" class=rent-><"34ame="L140"> "cod37         "cod5codL63"51">  5220 }occa3t-kne"31n/a>{
  13 100
 122parent7><71 hre22"> 122  y h<"34ame="L140"> _p taba>

 100
dev_get_drvda7a72 hre22"> 122  y h<"34ame="L140">  13b sef_attribut_"sprob  claL63" class=3"line36ame="L1 prob sef_attribut_"sref">kobjprob  cla,c52 class=3"line38ame="L108"> 100
 1377/a>  72sLsLsLsLsLsLsLsLsLsLs<"34ame="L140"> 8emovea>

 100

-><"34ame="L140"> 8aw_ev-4occa3-koneplus3craw_ev-4o claL63" class=3"line36ame="L1 8aw_ev-4occa3-koneplus3c#Lclass3craw_ev-4o clac52 class=3"line38ame="L108"> 100
  L133"> 133}
  L133"> 133}
 142  .c#Lcca3-koneplus3c142  .c#Lline3voidL95" class=3"line39ame="_profile);
 138{

(  L133"> 133}
 100
  5220 }comm-4oc>/*  5220onepl has to be sepl as 3"lineonepl */  13 100
 142  id-rocca3-koneplus3c142  a3-ko claL63" class=3"line3a3-ko_cre/a>  -><"52" [4a3-ko_cre/a>line39name="L66">  5THIS_MODULE  -><"52" [4THIS_MODULEass= e=51">  5220 }occa3t-kne"31n/a>{
  13  L133"> 133}
  5amp;  a3-ko cla)L95" class=3"line39ame="_profile);
->LsLsLs3" class=3"line3PTR_ERR+code=to_usb_inPTR_ERR clas9name="L66">  5amp;  a3-ko cla)ng52line38name="L45">  L133"> 133}
  a3-ko cla"srefef">5/hid/hid-5ata_attrocca3-koneplus3cata_attro claL63" class=3"line36ame="L1 attribut /a>
  L133"> 133}
 122<  13
  a3-ko cla"srefef">5/hid/hid-5ata_bin_attrocca3-koneplus3cata_bin_attro claL63" class=3"line36ame="L1 bin_attribut /a>
  L133"> 133}
);
         "_p register  "line clasne370me="L1foonep  &142   "line37         142   "line5cod)ng52line38name="L45">  L133"> 133}

kobj)->  L133"> 133}
->tractual_pr5lhia3-ko_deoccoy  -><"52" [4a3-ko_deoccoy clas9name="L66">  5amp;  a3-ko cla)ng52line38name="L45">  L133"> 133}
(  L133"> 133}
  L133"> 133}
"+cod/hid-rocca3t-ko7eplu3743lineg52line38name="L45">  L133"> 133}

 * 142  exkosef_attribut_"s142  exkoline3voidL95" class=3"line39ame="_profile);
"drivers/h7"> 122 122<  13
         "_p unregister  "line clasne370me="L1foonep  &142   "line37         142   "line5cod)ng52line38name="L45">  L133"> 133}
  5amp;  a3-ko cla)ng52line38name="L45">  L133"> 133}
  L133"> 133}
  L133"> 133}
  5amp;  .c#Lline)ng52line38name="L45">  L133"> 133}
  5amp;  exkoline)ng52line38name="L45">  L133"> 133}
 122         in7f="driver7/hid/hid-ro3-4oneplus3c.7#L94"7id="L9=konbut5gt;  5220 }occa3t-kne"31nStef"> Achatz"L13">  13  L133"> 133}

  5220 }occa3t-kne"31nUSB R> 133 Ka>}[+] 3"line"L13">  13  L133"> 133}
  5220 }occa3t-kne"31nGPL v2"L13">  13  L133"> 133}
 12275 hre2


The original LXR software by the3"> 13LXR commuc#Lyass= ethis experim-4oal ="L4ion by "> 13lxr@d/hux.noe=de<
lxr.d/hux.no kindly hosted by "> 13Redpill L/hpro ASass= eprovider of L/hux consul hre and opernitons ser / since 1995.