You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov:
"Items of note:
- evdev users can now limit or mask the kind of events they will
receive. This will allow applications such as power manager or
network manager to only be woken when user presses special keys
such as KEY_POWER or KEY_WIFI and not be bothered with ordinary
key presses coming from keyboard
- support for FocalTech FT6236 touchscreen controller
- support for ROHM BU21023/24 touchscreen controller
- edt-ft5x06 touchscreen driver got a face lift and can now be used
with FT5506
- support for Google Fiber TV Box remote controls
- improvements in xpad driver (with more to come)
- several parport-based drivers have been switched to the new device
model
- other miscellaneous driver improvements"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (70 commits)
HID: hid-gfrm: avoid warning for input_configured API change
HID: hid-input: allow input_configured callback return errors
Input: evdev - fix bug in checking duplicate clock change request
Input: add userio module
Input: evdev - add event-mask API
Input: snvs_pwrkey - remove duplicated semicolon
HID: hid-gfrm: Google Fiber TV Box remote controls
Input: e3x0-button - update Kconfig description
Input: tegra-kbc - drop use of IRQF_NO_SUSPEND flag
Input: tegra-kbc - enable support for the standard "wakeup-source" property
Input: xen - check return value of xenbus_printf
Input: hp_sdc_rtc - fix y2038 problem in proc_show
Input: nomadik-ske-keypad - fix a trivial typo
Input: xpad - fix clash of presence handling with LED setting
Input: edt-ft5x06 - work around FT5506 firmware bug
Input: edt-ft5x06 - add support for FT5506
Input: edt-ft5x06 - add support for different max support points
Input: edt-ft5x06 - use max support points to determine how much to read
Input: rotary-encoder - add support for quarter-period mode
Input: rotary-encoder - use of_property_read_bool
...
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
* Dialog DA9062/63 OnKey Module
|
||||
|
||||
This module is part of the DA9062/DA9063. For more details about entire
|
||||
chips see Documentation/devicetree/bindings/mfd/da9062.txt and
|
||||
Documentation/devicetree/bindings/mfd/da9063.txt
|
||||
|
||||
This module provides KEY_POWER, KEY_SLEEP and events.
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible: should be one of:
|
||||
dlg,da9062-onkey
|
||||
dlg,da9063-onkey
|
||||
|
||||
Optional properties:
|
||||
|
||||
- dlg,disable-key-power : Disable power-down using a long key-press. If this
|
||||
entry exists the OnKey driver will remove support for the KEY_POWER key
|
||||
press. If this entry does not exist then by default the key-press
|
||||
triggered power down is enabled and the OnKey will support both KEY_POWER
|
||||
and KEY_SLEEP.
|
||||
|
||||
Example:
|
||||
|
||||
pmic0: da9062@58 {
|
||||
|
||||
onkey {
|
||||
compatible = "dlg,da9063-onkey";
|
||||
dlg,disable-key-power;
|
||||
};
|
||||
|
||||
};
|
||||
@@ -13,11 +13,18 @@ Subnode properties:
|
||||
|
||||
- gpios: OF device-tree gpio specification.
|
||||
- label: Descriptive name of the key.
|
||||
- linux,code: Keycode to emit.
|
||||
- linux,code: Key / Axis code to emit.
|
||||
|
||||
Optional subnode-properties:
|
||||
- linux,input-type: Specify event type this button/key generates.
|
||||
If not specified defaults to <1> == EV_KEY.
|
||||
- linux,input-value: If linux,input-type is EV_ABS or EV_REL then this
|
||||
value is sent for events this button generates when pressed.
|
||||
EV_ABS/EV_REL axis will generate an event with a value of 0 when
|
||||
all buttons with linux,input-type == type and linux,code == axis
|
||||
are released. This value is interpreted as a signed 32 bit value,
|
||||
e.g. to make a button generate a value of -1 use:
|
||||
linux,input-value = <0xffffffff>; /* -1 */
|
||||
- debounce-interval: Debouncing interval time in milliseconds.
|
||||
If not specified defaults to 5.
|
||||
- wakeup-source: Boolean, button can wake-up the system.
|
||||
|
||||
@@ -14,7 +14,17 @@ Optional properties:
|
||||
device, hence no steps need to be passed.
|
||||
- rotary-encoder,rollover: Automatic rollove when the rotary value becomes
|
||||
greater than the specified steps or smaller than 0. For absolute axis only.
|
||||
- rotary-encoder,steps-per-period: Number of steps (stable states) per period.
|
||||
The values have the following meaning:
|
||||
1: Full-period mode (default)
|
||||
2: Half-period mode
|
||||
4: Quarter-period mode
|
||||
- wakeup-source: Boolean, rotary encoder can wake up the system.
|
||||
|
||||
Deprecated properties:
|
||||
- rotary-encoder,half-period: Makes the driver work on half-period mode.
|
||||
This property is deprecated. Instead, a 'steps-per-period ' value should
|
||||
be used, such as "rotary-encoder,steps-per-period = <2>".
|
||||
|
||||
See Documentation/input/rotary-encoder.txt for more information.
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ There are 3 variants of the chip for various touch panel sizes
|
||||
FT5206GE1 2.8" .. 3.8"
|
||||
FT5306DE4 4.3" .. 7"
|
||||
FT5406EE8 7" .. 8.9"
|
||||
FT5506EEG 7" .. 8.9"
|
||||
|
||||
The software interface is identical for all those chips, so that
|
||||
currently there is no need for the driver to distinguish between the
|
||||
@@ -17,6 +18,7 @@ Required properties:
|
||||
- compatible: "edt,edt-ft5206"
|
||||
or: "edt,edt-ft5306"
|
||||
or: "edt,edt-ft5406"
|
||||
or: "edt,edt-ft5506"
|
||||
|
||||
- reg: I2C slave address of the chip (0x38)
|
||||
- interrupt-parent: a phandle pointing to the interrupt controller
|
||||
@@ -49,7 +51,7 @@ Example:
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&edt_ft5x06_pins>;
|
||||
interrupt-parent = <&gpio2>;
|
||||
interrupts = <5 0>;
|
||||
reset-gpios = <&gpio2 6 1>;
|
||||
wake-gpios = <&gpio4 9 0>;
|
||||
interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
|
||||
reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
|
||||
wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
* FocalTech FT6236 I2C touchscreen controller
|
||||
|
||||
Required properties:
|
||||
- compatible : "focaltech,ft6236"
|
||||
- reg : I2C slave address of the chip (0x38)
|
||||
- interrupt-parent : a phandle pointing to the interrupt controller
|
||||
serving the interrupt for this chip
|
||||
- interrupts : interrupt specification for the touch controller
|
||||
interrupt
|
||||
- reset-gpios : GPIO specification for the RSTN input
|
||||
- touchscreen-size-x : horizontal resolution of touchscreen (in pixels)
|
||||
- touchscreen-size-y : vertical resolution of touchscreen (in pixels)
|
||||
|
||||
Optional properties:
|
||||
- touchscreen-fuzz-x : horizontal noise value of the absolute input
|
||||
device (in pixels)
|
||||
- touchscreen-fuzz-y : vertical noise value of the absolute input
|
||||
device (in pixels)
|
||||
- touchscreen-inverted-x : X axis is inverted (boolean)
|
||||
- touchscreen-inverted-y : Y axis is inverted (boolean)
|
||||
- touchscreen-swapped-x-y: X and Y axis are swapped (boolean)
|
||||
Swapping is done after inverting the axis
|
||||
|
||||
Example:
|
||||
|
||||
ft6x06@38 {
|
||||
compatible = "focaltech,ft6236";
|
||||
reg = <0x38>;
|
||||
interrupt-parent = <&gpio>;
|
||||
interrupts = <23 2>;
|
||||
touchscreen-size-x = <320>;
|
||||
touchscreen-size-y = <480>;
|
||||
touchscreen-inverted-x;
|
||||
touchscreen-swapped-x-y;
|
||||
};
|
||||
@@ -82,6 +82,7 @@ everspin Everspin Technologies, Inc.
|
||||
excito Excito
|
||||
fcs Fairchild Semiconductor
|
||||
firefly Firefly
|
||||
focaltech FocalTech Systems Co.,Ltd
|
||||
fsl Freescale Semiconductor
|
||||
GEFanuc GE Fanuc Intelligent Platforms Embedded Systems, Inc.
|
||||
gef GE Fanuc Intelligent Platforms Embedded Systems, Inc.
|
||||
|
||||
@@ -9,8 +9,9 @@ peripherals with two wires. The outputs are phase-shifted by 90 degrees
|
||||
and by triggering on falling and rising edges, the turn direction can
|
||||
be determined.
|
||||
|
||||
Some encoders have both outputs low in stable states, whereas others also have
|
||||
a stable state with both outputs high (half-period mode).
|
||||
Some encoders have both outputs low in stable states, others also have
|
||||
a stable state with both outputs high (half-period mode) and some have
|
||||
a stable state in all steps (quarter-period mode).
|
||||
|
||||
The phase diagram of these two outputs look like this:
|
||||
|
||||
@@ -32,6 +33,9 @@ The phase diagram of these two outputs look like this:
|
||||
|<-->|
|
||||
one step (half-period mode)
|
||||
|
||||
|<>|
|
||||
one step (quarter-period mode)
|
||||
|
||||
For more information, please see
|
||||
https://en.wikipedia.org/wiki/Rotary_encoder
|
||||
|
||||
@@ -109,6 +113,7 @@ static struct rotary_encoder_platform_data my_rotary_encoder_info = {
|
||||
.inverted_a = 0,
|
||||
.inverted_b = 0,
|
||||
.half_period = false,
|
||||
.wakeup_source = false,
|
||||
};
|
||||
|
||||
static struct platform_device rotary_encoder_device = {
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
The userio Protocol
|
||||
(c) 2015 Stephen Chandler Paul <thatslyude@gmail.com>
|
||||
Sponsored by Red Hat
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
1. Introduction
|
||||
~~~~~~~~~~~~~~~
|
||||
This module is intended to try to make the lives of input driver developers
|
||||
easier by allowing them to test various serio devices (mainly the various
|
||||
touchpads found on laptops) without having to have the physical device in front
|
||||
of them. userio accomplishes this by allowing any privileged userspace program
|
||||
to directly interact with the kernel's serio driver and control a virtual serio
|
||||
port from there.
|
||||
|
||||
2. Usage overview
|
||||
~~~~~~~~~~~~~~~~~
|
||||
In order to interact with the userio kernel module, one simply opens the
|
||||
/dev/userio character device in their applications. Commands are sent to the
|
||||
kernel module by writing to the device, and any data received from the serio
|
||||
driver is read as-is from the /dev/userio device. All of the structures and
|
||||
macros you need to interact with the device are defined in <linux/userio.h> and
|
||||
<linux/serio.h>.
|
||||
|
||||
3. Command Structure
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
The struct used for sending commands to /dev/userio is as follows:
|
||||
|
||||
struct userio_cmd {
|
||||
__u8 type;
|
||||
__u8 data;
|
||||
};
|
||||
|
||||
"type" describes the type of command that is being sent. This can be any one
|
||||
of the USERIO_CMD macros defined in <linux/userio.h>. "data" is the argument
|
||||
that goes along with the command. In the event that the command doesn't have an
|
||||
argument, this field can be left untouched and will be ignored by the kernel.
|
||||
Each command should be sent by writing the struct directly to the character
|
||||
device. In the event that the command you send is invalid, an error will be
|
||||
returned by the character device and a more descriptive error will be printed
|
||||
to the kernel log. Only one command can be sent at a time, any additional data
|
||||
written to the character device after the initial command will be ignored.
|
||||
To close the virtual serio port, just close /dev/userio.
|
||||
|
||||
4. Commands
|
||||
~~~~~~~~~~~
|
||||
|
||||
4.1 USERIO_CMD_REGISTER
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Registers the port with the serio driver and begins transmitting data back and
|
||||
forth. Registration can only be performed once a port type is set with
|
||||
USERIO_CMD_SET_PORT_TYPE. Has no argument.
|
||||
|
||||
4.2 USERIO_CMD_SET_PORT_TYPE
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Sets the type of port we're emulating, where "data" is the port type being
|
||||
set. Can be any of the macros from <linux/serio.h>. For example: SERIO_8042
|
||||
would set the port type to be a normal PS/2 port.
|
||||
|
||||
4.3 USERIO_CMD_SEND_INTERRUPT
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Sends an interrupt through the virtual serio port to the serio driver, where
|
||||
"data" is the interrupt data being sent.
|
||||
|
||||
5. Userspace tools
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
The userio userspace tools are able to record PS/2 devices using some of the
|
||||
debugging information from i8042, and play back the devices on /dev/userio. The
|
||||
latest version of these tools can be found at:
|
||||
|
||||
https://github.com/Lyude/ps2emu
|
||||
@@ -11306,6 +11306,12 @@ S: Maintained
|
||||
F: drivers/media/v4l2-core/videobuf2-*
|
||||
F: include/media/videobuf2-*
|
||||
|
||||
VIRTUAL SERIO DEVICE DRIVER
|
||||
M: Stephen Chandler Paul <thatslyude@gmail.com>
|
||||
S: Maintained
|
||||
F: drivers/input/serio/userio.c
|
||||
F: include/uapi/linux/userio.h
|
||||
|
||||
VIRTIO CONSOLE DRIVER
|
||||
M: Amit Shah <amit.shah@redhat.com>
|
||||
L: virtualization@lists.linux-foundation.org
|
||||
|
||||
@@ -502,7 +502,7 @@
|
||||
|
||||
reg = <0x38>;
|
||||
interrupt-parent = <&gpio0>;
|
||||
interrupts = <31 0>;
|
||||
interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
|
||||
|
||||
reset-gpios = <&gpio1 28 GPIO_ACTIVE_LOW>;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
/dts-v1/;
|
||||
#include "imx28.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
|
||||
/ {
|
||||
model = "Ka-Ro electronics TX28 module";
|
||||
@@ -324,7 +325,7 @@
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&tx28_edt_ft5x06_pins>;
|
||||
interrupt-parent = <&gpio2>;
|
||||
interrupts = <5 0>;
|
||||
interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
|
||||
reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
|
||||
wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
/dts-v1/;
|
||||
#include "imx53-tx53.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/pwm/pwm.h>
|
||||
|
||||
/ {
|
||||
@@ -216,7 +217,7 @@
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_edt_ft5x06_1>;
|
||||
interrupt-parent = <&gpio6>;
|
||||
interrupts = <15 0>;
|
||||
interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
|
||||
reset-gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
|
||||
wake-gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/pwm/pwm.h>
|
||||
|
||||
/ {
|
||||
@@ -272,7 +273,7 @@
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_edt_ft5x06>;
|
||||
interrupt-parent = <&gpio6>;
|
||||
interrupts = <15 0>;
|
||||
interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
|
||||
reset-gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
|
||||
wake-gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
|
||||
linux,wakeup;
|
||||
|
||||
@@ -257,6 +257,12 @@ config HID_GEMBIRD
|
||||
---help---
|
||||
Support for Gembird JPD-DualForce 2.
|
||||
|
||||
config HID_GFRM
|
||||
tristate "Google Fiber TV Box remote control support"
|
||||
depends on HID
|
||||
---help---
|
||||
Support for Google Fiber TV Box remote controls
|
||||
|
||||
config HID_HOLTEK
|
||||
tristate "Holtek HID devices"
|
||||
depends on USB_HID
|
||||
|
||||
@@ -37,6 +37,7 @@ obj-$(CONFIG_HID_ELECOM) += hid-elecom.o
|
||||
obj-$(CONFIG_HID_ELO) += hid-elo.o
|
||||
obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o
|
||||
obj-$(CONFIG_HID_GEMBIRD) += hid-gembird.o
|
||||
obj-$(CONFIG_HID_GFRM) += hid-gfrm.o
|
||||
obj-$(CONFIG_HID_GT683R) += hid-gt683r.o
|
||||
obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
|
||||
obj-$(CONFIG_HID_HOLTEK) += hid-holtek-kbd.o
|
||||
|
||||
@@ -256,7 +256,7 @@ out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void appleir_input_configured(struct hid_device *hid,
|
||||
static int appleir_input_configured(struct hid_device *hid,
|
||||
struct hid_input *hidinput)
|
||||
{
|
||||
struct input_dev *input_dev = hidinput->input;
|
||||
@@ -275,6 +275,8 @@ static void appleir_input_configured(struct hid_device *hid,
|
||||
for (i = 0; i < ARRAY_SIZE(appleir_key_table); i++)
|
||||
set_bit(appleir->keymap[i], input_dev->keybit);
|
||||
clear_bit(KEY_RESERVED, input_dev->keybit);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int appleir_input_mapping(struct hid_device *hid,
|
||||
|
||||
@@ -37,7 +37,7 @@ static bool use_fw_quirk = true;
|
||||
module_param(use_fw_quirk, bool, S_IRUGO);
|
||||
MODULE_PARM_DESC(use_fw_quirk, "Do periodic pokes for broken M firmwares (default = true)");
|
||||
|
||||
static void elo_input_configured(struct hid_device *hdev,
|
||||
static int elo_input_configured(struct hid_device *hdev,
|
||||
struct hid_input *hidinput)
|
||||
{
|
||||
struct input_dev *input = hidinput->input;
|
||||
@@ -45,6 +45,8 @@ static void elo_input_configured(struct hid_device *hdev,
|
||||
set_bit(BTN_TOUCH, input->keybit);
|
||||
set_bit(ABS_PRESSURE, input->absbit);
|
||||
input_set_abs_params(input, ABS_PRESSURE, 0, 256, 0, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void elo_process_data(struct input_dev *input, const u8 *data, int size)
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* HID driver for Google Fiber TV Box remote controls
|
||||
*
|
||||
* Copyright (c) 2014-2015 Google Inc.
|
||||
*
|
||||
* Author: Petri Gynther <pgynther@google.com>
|
||||
*
|
||||
* 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/device.h>
|
||||
#include <linux/hid.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include "hid-ids.h"
|
||||
|
||||
#define GFRM100 1 /* Google Fiber GFRM100 (Bluetooth classic) */
|
||||
#define GFRM200 2 /* Google Fiber GFRM200 (Bluetooth LE) */
|
||||
|
||||
#define GFRM100_SEARCH_KEY_REPORT_ID 0xF7
|
||||
#define GFRM100_SEARCH_KEY_DOWN 0x0
|
||||
#define GFRM100_SEARCH_KEY_AUDIO_DATA 0x1
|
||||
#define GFRM100_SEARCH_KEY_UP 0x2
|
||||
|
||||
static u8 search_key_dn[3] = {0x40, 0x21, 0x02};
|
||||
static u8 search_key_up[3] = {0x40, 0x00, 0x00};
|
||||
|
||||
static int gfrm_input_mapping(struct hid_device *hdev, struct hid_input *hi,
|
||||
struct hid_field *field, struct hid_usage *usage,
|
||||
unsigned long **bit, int *max)
|
||||
{
|
||||
unsigned long hdev_type = (unsigned long) hid_get_drvdata(hdev);
|
||||
|
||||
if (hdev_type == GFRM100) {
|
||||
if (usage->hid == (HID_UP_CONSUMER | 0x4)) {
|
||||
/* Consumer.0004 -> KEY_INFO */
|
||||
hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_INFO);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (usage->hid == (HID_UP_CONSUMER | 0x41)) {
|
||||
/* Consumer.0041 -> KEY_OK */
|
||||
hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_OK);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gfrm_raw_event(struct hid_device *hdev, struct hid_report *report,
|
||||
u8 *data, int size)
|
||||
{
|
||||
unsigned long hdev_type = (unsigned long) hid_get_drvdata(hdev);
|
||||
int ret = 0;
|
||||
|
||||
if (hdev_type != GFRM100)
|
||||
return 0;
|
||||
|
||||
if (size < 2 || data[0] != GFRM100_SEARCH_KEY_REPORT_ID)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Convert GFRM100 Search key reports into Consumer.0221 (Key.Search)
|
||||
* reports. Ignore audio data.
|
||||
*/
|
||||
switch (data[1]) {
|
||||
case GFRM100_SEARCH_KEY_DOWN:
|
||||
ret = hid_report_raw_event(hdev, HID_INPUT_REPORT, search_key_dn,
|
||||
sizeof(search_key_dn), 1);
|
||||
break;
|
||||
|
||||
case GFRM100_SEARCH_KEY_AUDIO_DATA:
|
||||
break;
|
||||
|
||||
case GFRM100_SEARCH_KEY_UP:
|
||||
ret = hid_report_raw_event(hdev, HID_INPUT_REPORT, search_key_up,
|
||||
sizeof(search_key_up), 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (ret < 0) ? ret : -1;
|
||||
}
|
||||
|
||||
static int gfrm_input_configured(struct hid_device *hid, struct hid_input *hidinput)
|
||||
{
|
||||
/*
|
||||
* Enable software autorepeat with:
|
||||
* - repeat delay: 400 msec
|
||||
* - repeat period: 100 msec
|
||||
*/
|
||||
input_enable_softrepeat(hidinput->input, 400, 100);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gfrm_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
{
|
||||
int ret;
|
||||
|
||||
hid_set_drvdata(hdev, (void *) id->driver_data);
|
||||
|
||||
ret = hid_parse(hdev);
|
||||
if (ret)
|
||||
goto done;
|
||||
|
||||
if (id->driver_data == GFRM100) {
|
||||
/*
|
||||
* GFRM100 HID Report Descriptor does not describe the Search
|
||||
* key reports. Thus, we need to add it manually here, so that
|
||||
* those reports reach gfrm_raw_event() from hid_input_report().
|
||||
*/
|
||||
if (!hid_register_report(hdev, HID_INPUT_REPORT,
|
||||
GFRM100_SEARCH_KEY_REPORT_ID)) {
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
|
||||
done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void gfrm_remove(struct hid_device *hdev)
|
||||
{
|
||||
hid_hw_stop(hdev);
|
||||
hid_set_drvdata(hdev, NULL);
|
||||
}
|
||||
|
||||
static const struct hid_device_id gfrm_devices[] = {
|
||||
{ HID_BLUETOOTH_DEVICE(0x58, 0x2000),
|
||||
.driver_data = GFRM100 },
|
||||
{ HID_BLUETOOTH_DEVICE(0x471, 0x2210),
|
||||
.driver_data = GFRM200 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(hid, gfrm_devices);
|
||||
|
||||
static struct hid_driver gfrm_driver = {
|
||||
.name = "gfrm",
|
||||
.id_table = gfrm_devices,
|
||||
.probe = gfrm_probe,
|
||||
.remove = gfrm_remove,
|
||||
.input_mapping = gfrm_input_mapping,
|
||||
.raw_event = gfrm_raw_event,
|
||||
.input_configured = gfrm_input_configured,
|
||||
};
|
||||
|
||||
module_hid_driver(gfrm_driver);
|
||||
|
||||
MODULE_AUTHOR("Petri Gynther <pgynther@google.com>");
|
||||
MODULE_DESCRIPTION("Google Fiber TV Box remote control driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
@@ -1510,8 +1510,9 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
|
||||
* UGCI) cram a lot of unrelated inputs into the
|
||||
* same interface. */
|
||||
hidinput->report = report;
|
||||
if (drv->input_configured)
|
||||
drv->input_configured(hid, hidinput);
|
||||
if (drv->input_configured &&
|
||||
drv->input_configured(hid, hidinput))
|
||||
goto out_cleanup;
|
||||
if (input_register_device(hidinput->input))
|
||||
goto out_cleanup;
|
||||
hidinput = NULL;
|
||||
@@ -1532,8 +1533,9 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
|
||||
}
|
||||
|
||||
if (hidinput) {
|
||||
if (drv->input_configured)
|
||||
drv->input_configured(hid, hidinput);
|
||||
if (drv->input_configured &&
|
||||
drv->input_configured(hid, hidinput))
|
||||
goto out_cleanup;
|
||||
if (input_register_device(hidinput->input))
|
||||
goto out_cleanup;
|
||||
}
|
||||
|
||||
@@ -848,7 +848,7 @@ static void lenovo_remove(struct hid_device *hdev)
|
||||
hid_hw_stop(hdev);
|
||||
}
|
||||
|
||||
static void lenovo_input_configured(struct hid_device *hdev,
|
||||
static int lenovo_input_configured(struct hid_device *hdev,
|
||||
struct hid_input *hi)
|
||||
{
|
||||
switch (hdev->product) {
|
||||
@@ -863,6 +863,8 @@ static void lenovo_input_configured(struct hid_device *hdev,
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user