HID: pidff: Move all hid-pidff definitions to a dedicated header
[ Upstream commit 0d24d4b1da96df9fc5ff36966f40f980ef864d46 ] Do not clutter hid includes with stuff not needed outside of the kernel. Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8f0b2d791e
commit
61e4de1728
@@ -13,6 +13,7 @@
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/input-event-codes.h>
|
#include <linux/input-event-codes.h>
|
||||||
#include "hid-ids.h"
|
#include "hid-ids.h"
|
||||||
|
#include "usbhid/hid-pidff.h"
|
||||||
|
|
||||||
#define JOY_RANGE (BTN_DEAD - BTN_JOYSTICK + 1)
|
#define JOY_RANGE (BTN_DEAD - BTN_JOYSTICK + 1)
|
||||||
|
|
||||||
@@ -89,7 +90,7 @@ static int universal_pidff_probe(struct hid_device *hdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if HID_PID support is enabled */
|
/* Check if HID_PID support is enabled */
|
||||||
int (*init_function)(struct hid_device *, __u32);
|
int (*init_function)(struct hid_device *, u32);
|
||||||
init_function = hid_pidff_init_with_quirks;
|
init_function = hid_pidff_init_with_quirks;
|
||||||
|
|
||||||
if (!init_function) {
|
if (!init_function) {
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include <linux/hid-debug.h>
|
#include <linux/hid-debug.h>
|
||||||
#include <linux/hidraw.h>
|
#include <linux/hidraw.h>
|
||||||
#include "usbhid.h"
|
#include "usbhid.h"
|
||||||
|
#include "hid-pidff.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Version Information
|
* Version Information
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
|
#include "hid-pidff.h"
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/usb.h>
|
#include <linux/usb.h>
|
||||||
@@ -1383,7 +1384,7 @@ static int pidff_check_autocenter(struct pidff_device *pidff,
|
|||||||
* Check if the device is PID and initialize it
|
* Check if the device is PID and initialize it
|
||||||
* Set initial quirks
|
* Set initial quirks
|
||||||
*/
|
*/
|
||||||
int hid_pidff_init_with_quirks(struct hid_device *hid, __u32 initial_quirks)
|
int hid_pidff_init_with_quirks(struct hid_device *hid, u32 initial_quirks)
|
||||||
{
|
{
|
||||||
struct pidff_device *pidff;
|
struct pidff_device *pidff;
|
||||||
struct hid_input *hidinput = list_entry(hid->inputs.next,
|
struct hid_input *hidinput = list_entry(hid->inputs.next,
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||||
|
#ifndef __HID_PIDFF_H
|
||||||
|
#define __HID_PIDFF_H
|
||||||
|
|
||||||
|
#include <linux/hid.h>
|
||||||
|
|
||||||
|
/* HID PIDFF quirks */
|
||||||
|
|
||||||
|
/* Delay field (0xA7) missing. Skip it during set effect report upload */
|
||||||
|
#define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0)
|
||||||
|
|
||||||
|
/* Missing Paramter block offset (0x23). Skip it during SET_CONDITION
|
||||||
|
report upload */
|
||||||
|
#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1)
|
||||||
|
|
||||||
|
/* Initialise device control field even if logical_minimum != 1 */
|
||||||
|
#define HID_PIDFF_QUIRK_PERMISSIVE_CONTROL BIT(2)
|
||||||
|
|
||||||
|
/* Use fixed 0x4000 direction during SET_EFFECT report upload */
|
||||||
|
#define HID_PIDFF_QUIRK_FIX_WHEEL_DIRECTION BIT(3)
|
||||||
|
|
||||||
|
/* Force all periodic effects to be uploaded as SINE */
|
||||||
|
#define HID_PIDFF_QUIRK_PERIODIC_SINE_ONLY BIT(4)
|
||||||
|
|
||||||
|
#ifdef CONFIG_HID_PID
|
||||||
|
int hid_pidff_init(struct hid_device *hid);
|
||||||
|
int hid_pidff_init_with_quirks(struct hid_device *hid, u32 initial_quirks);
|
||||||
|
#else
|
||||||
|
#define hid_pidff_init NULL
|
||||||
|
#define hid_pidff_init_with_quirks NULL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1221,21 +1221,6 @@ unsigned long hid_lookup_quirk(const struct hid_device *hdev);
|
|||||||
int hid_quirks_init(char **quirks_param, __u16 bus, int count);
|
int hid_quirks_init(char **quirks_param, __u16 bus, int count);
|
||||||
void hid_quirks_exit(__u16 bus);
|
void hid_quirks_exit(__u16 bus);
|
||||||
|
|
||||||
#ifdef CONFIG_HID_PID
|
|
||||||
int hid_pidff_init(struct hid_device *hid);
|
|
||||||
int hid_pidff_init_with_quirks(struct hid_device *hid, __u32 initial_quirks);
|
|
||||||
#else
|
|
||||||
#define hid_pidff_init NULL
|
|
||||||
#define hid_pidff_init_with_quirks NULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* HID PIDFF quirks */
|
|
||||||
#define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0)
|
|
||||||
#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1)
|
|
||||||
#define HID_PIDFF_QUIRK_PERMISSIVE_CONTROL BIT(2)
|
|
||||||
#define HID_PIDFF_QUIRK_FIX_WHEEL_DIRECTION BIT(3)
|
|
||||||
#define HID_PIDFF_QUIRK_PERIODIC_SINE_ONLY BIT(4)
|
|
||||||
|
|
||||||
#define dbg_hid(fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__)
|
#define dbg_hid(fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__)
|
||||||
|
|
||||||
#define hid_err(hid, fmt, ...) \
|
#define hid_err(hid, fmt, ...) \
|
||||||
|
|||||||
Reference in New Issue
Block a user