hdaps: Add ID fields to the hdaps joystick-emulation input device Minor ABI break: the input dev name changes from "hdaps" to a more meaningful "ThinkPad HDAPS joystick emulation", following Documentation/input/input-programming.txt. The bus/vendor/product/version have been coordinated with the maintainer of thinkpad_acpi (the other user of this bus/vendor namespace). Signed-off-by: Shem Multinymous --- drivers/hwmon/hdaps.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c index ad92c0a..423f348 100644 --- a/drivers/hwmon/hdaps.c +++ b/drivers/hwmon/hdaps.c @@ -35,6 +35,7 @@ #include #include #include +#include /* Embedded controller accelerometer read command and its result: */ static const struct thinkpad_ec_row ec_accel_args = @@ -62,9 +63,14 @@ static const struct thinkpad_ec_row ec_accel_args = #define HDAPS_INPUT_FLAT 4 #define KMACT_REMEMBER_PERIOD (HZ/10) /* keyboard/mouse persistance */ +/* Input IDs */ +#define HDAPS_INPUT_VENDOR PCI_VENDOR_ID_IBM +#define HDAPS_INPUT_PRODUCT 0x5054 /* "TP", shared with thinkpad_acpi */ +#define HDAPS_INPUT_JS_VERSION 0x6801 /* Joystick emulation input device */ + static struct timer_list hdaps_timer; static struct platform_device *pdev; -static struct input_dev *hdaps_idev; +static struct input_dev *hdaps_idev; /* joystick-like device with fuzz */ static unsigned int hdaps_invert; static int needs_calibration; @@ -744,8 +750,13 @@ static int __init hdaps_init(void) /* calibration for the input device (deferred to avoid delay) */ needs_calibration = 1; - /* initialize the input class */ - hdaps_idev->name = "hdaps"; + /* initialize the joystick-like fuzzed input device */ + hdaps_idev->name = "ThinkPad HDAPS joystick emulation"; + hdaps_idev->phys = "hdaps/input0"; + hdaps_idev->id.bustype = BUS_HOST; + hdaps_idev->id.vendor = HDAPS_INPUT_VENDOR; + hdaps_idev->id.product = HDAPS_INPUT_PRODUCT; + hdaps_idev->id.version = HDAPS_INPUT_JS_VERSION; hdaps_idev->dev.parent = &pdev->dev; hdaps_idev->evbit[0] = BIT(EV_ABS); input_set_abs_params(hdaps_idev, ABS_X, -- 1.5.2.4