Documentation
arch
block
certs
crypto
drivers
accessibility
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cdrom
char
clk
clocksource
connector
cpufreq
cpuidle
crypto
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware
fmc
fpga
gpio
gpu
hid
i2c-hid
intel-ish-hid
usbhid
Kconfig
Makefile
hid-a4tech.c
hid-alps.c
hid-apple.c
hid-appleir.c
hid-asus.c
hid-aureal.c
hid-axff.c
hid-belkin.c
hid-betopff.c
hid-cherry.c
hid-chicony.c
hid-cmedia.c
hid-core.c
hid-corsair.c
hid-cp2112.c
hid-cypress.c
hid-debug.c
hid-dr.c
hid-elecom.c
hid-elo.c
hid-emsff.c
hid-ezkey.c
hid-gaff.c
hid-gembird.c
hid-generic.c
hid-gfrm.c
hid-gt683r.c
hid-gyration.c
hid-holtek-kbd.c
hid-holtek-mouse.c
hid-holtekff.c
hid-hyperv.c
hid-icade.c
hid-ids.h
hid-input.c
hid-kensington.c
hid-keytouch.c
hid-kye.c
hid-lcpower.c
hid-led.c
hid-lenovo.c
hid-lg.c
hid-lg.h
hid-lg2ff.c
hid-lg3ff.c
hid-lg4ff.c
hid-lg4ff.h
hid-lgff.c
hid-logitech-dj.c
hid-logitech-hidpp.c
hid-magicmouse.c
hid-microsoft.c
hid-monterey.c
hid-multitouch.c
hid-nintendo.c
hid-ntrig.c
hid-ortek.c
hid-penmount.c
hid-petalynx.c
hid-picolcd.h
hid-picolcd_backlight.c
hid-picolcd_cir.c
hid-picolcd_core.c
hid-picolcd_debugfs.c
hid-picolcd_fb.c
hid-picolcd_lcd.c
hid-picolcd_leds.c
hid-pl.c
hid-plantronics.c
hid-primax.c
hid-prodikeys.c
hid-rmi.c
hid-roccat-arvo.c
hid-roccat-arvo.h
hid-roccat-common.c
hid-roccat-common.h
hid-roccat-isku.c
hid-roccat-isku.h
hid-roccat-kone.c
hid-roccat-kone.h
hid-roccat-koneplus.c
hid-roccat-koneplus.h
hid-roccat-konepure.c
hid-roccat-kovaplus.c
hid-roccat-kovaplus.h
hid-roccat-lua.c
hid-roccat-lua.h
hid-roccat-pyra.c
hid-roccat-pyra.h
hid-roccat-ryos.c
hid-roccat-savu.c
hid-roccat-savu.h
hid-roccat.c
hid-saitek.c
hid-samsung.c
hid-sensor-custom.c
hid-sensor-hub.c
hid-sjoy.c
hid-sony.c
hid-speedlink.c
hid-steam.c
hid-steelseries.c
hid-sunplus.c
hid-tivo.c
hid-tmff.c
hid-topseed.c
hid-twinhan.c
hid-uclogic.c
hid-waltop.c
hid-wiimote-core.c
hid-wiimote-debug.c
hid-wiimote-modules.c
hid-wiimote.h
hid-xinmo.c
hid-zpff.c
hid-zydacron.c
hidraw.c
uhid.c
wacom.h
wacom_sys.c
wacom_wac.c
wacom_wac.h
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
ide
idle
iio
infiniband
input
iommu
ipack
irqchip
isdn
leds
lguest
lightnvm
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
mtd
net
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
oprofile
parisc
parport
pci
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sfi
sh
sn
soc
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
uio
usb
uwb
vfio
vhost
video
virt
virtio
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile
firmware
fs
include
init
ipc
kernel
lib
mm
ndm
net
samples
scripts
security
sound
tools
usr
virt
.cocciconfig
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
REPORTING-BUGS
build.config.aarch64
build.config.common
build.config.cuttlefish.aarch64
build.config.cuttlefish.x86_64
build.config.goldfish.arm
build.config.goldfish.arm64
build.config.goldfish.mips
build.config.goldfish.mips64
build.config.goldfish.x86
build.config.goldfish.x86_64
build.config.x86_64
localversion-ndm
verity_dev_keys.x509
git: https://android.googlesource.com/kernel/common branch: android-4.9 commit: 03fcc2fe71308c2d164b4e6cbfc738c63e670444
98 lines
3.1 KiB
C
98 lines
3.1 KiB
C
#ifndef __HID_ROCCAT_COMMON_H
|
|
#define __HID_ROCCAT_COMMON_H
|
|
|
|
/*
|
|
* Copyright (c) 2011 Stefan Achatz <erazor_de@users.sourceforge.net>
|
|
*/
|
|
|
|
/*
|
|
* 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.
|
|
*/
|
|
|
|
#include <linux/usb.h>
|
|
#include <linux/types.h>
|
|
|
|
enum roccat_common2_commands {
|
|
ROCCAT_COMMON_COMMAND_CONTROL = 0x4,
|
|
};
|
|
|
|
struct roccat_common2_control {
|
|
uint8_t command;
|
|
uint8_t value;
|
|
uint8_t request; /* always 0 on requesting write check */
|
|
} __packed;
|
|
|
|
int roccat_common2_receive(struct usb_device *usb_dev, uint report_id,
|
|
void *data, uint size);
|
|
int roccat_common2_send(struct usb_device *usb_dev, uint report_id,
|
|
void const *data, uint size);
|
|
int roccat_common2_send_with_status(struct usb_device *usb_dev,
|
|
uint command, void const *buf, uint size);
|
|
|
|
struct roccat_common2_device {
|
|
int roccat_claimed;
|
|
int chrdev_minor;
|
|
struct mutex lock;
|
|
};
|
|
|
|
int roccat_common2_device_init_struct(struct usb_device *usb_dev,
|
|
struct roccat_common2_device *dev);
|
|
ssize_t roccat_common2_sysfs_read(struct file *fp, struct kobject *kobj,
|
|
char *buf, loff_t off, size_t count,
|
|
size_t real_size, uint command);
|
|
ssize_t roccat_common2_sysfs_write(struct file *fp, struct kobject *kobj,
|
|
void const *buf, loff_t off, size_t count,
|
|
size_t real_size, uint command);
|
|
|
|
#define ROCCAT_COMMON2_SYSFS_W(thingy, COMMAND, SIZE) \
|
|
static ssize_t roccat_common2_sysfs_write_ ## thingy(struct file *fp, \
|
|
struct kobject *kobj, struct bin_attribute *attr, char *buf, \
|
|
loff_t off, size_t count) \
|
|
{ \
|
|
return roccat_common2_sysfs_write(fp, kobj, buf, off, count, \
|
|
SIZE, COMMAND); \
|
|
}
|
|
|
|
#define ROCCAT_COMMON2_SYSFS_R(thingy, COMMAND, SIZE) \
|
|
static ssize_t roccat_common2_sysfs_read_ ## thingy(struct file *fp, \
|
|
struct kobject *kobj, struct bin_attribute *attr, char *buf, \
|
|
loff_t off, size_t count) \
|
|
{ \
|
|
return roccat_common2_sysfs_read(fp, kobj, buf, off, count, \
|
|
SIZE, COMMAND); \
|
|
}
|
|
|
|
#define ROCCAT_COMMON2_SYSFS_RW(thingy, COMMAND, SIZE) \
|
|
ROCCAT_COMMON2_SYSFS_W(thingy, COMMAND, SIZE) \
|
|
ROCCAT_COMMON2_SYSFS_R(thingy, COMMAND, SIZE)
|
|
|
|
#define ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(thingy, COMMAND, SIZE) \
|
|
ROCCAT_COMMON2_SYSFS_RW(thingy, COMMAND, SIZE); \
|
|
static struct bin_attribute bin_attr_ ## thingy = { \
|
|
.attr = { .name = #thingy, .mode = 0660 }, \
|
|
.size = SIZE, \
|
|
.read = roccat_common2_sysfs_read_ ## thingy, \
|
|
.write = roccat_common2_sysfs_write_ ## thingy \
|
|
}
|
|
|
|
#define ROCCAT_COMMON2_BIN_ATTRIBUTE_R(thingy, COMMAND, SIZE) \
|
|
ROCCAT_COMMON2_SYSFS_R(thingy, COMMAND, SIZE); \
|
|
static struct bin_attribute bin_attr_ ## thingy = { \
|
|
.attr = { .name = #thingy, .mode = 0440 }, \
|
|
.size = SIZE, \
|
|
.read = roccat_common2_sysfs_read_ ## thingy, \
|
|
}
|
|
|
|
#define ROCCAT_COMMON2_BIN_ATTRIBUTE_W(thingy, COMMAND, SIZE) \
|
|
ROCCAT_COMMON2_SYSFS_W(thingy, COMMAND, SIZE); \
|
|
static struct bin_attribute bin_attr_ ## thingy = { \
|
|
.attr = { .name = #thingy, .mode = 0220 }, \
|
|
.size = SIZE, \
|
|
.write = roccat_common2_sysfs_write_ ## thingy \
|
|
}
|
|
|
|
#endif
|