linux/drivers/hid/hid-asus.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  HID driver for Asus notebook built-in keyboard.
 *  Fixes small logical maximum to match usage maximum.
 *
 *  Currently supported devices are:
 *    EeeBook X205TA
 *    VivoBook E200HA
 *
 *  Copyright (c) 2016 Yusuke Fujimaki <[email protected]>
 *
 *  This module based on hid-ortek by
 *  Copyright (c) 2010 Johnathon Harris <[email protected]>
 *  Copyright (c) 2011 Jiri Kosina
 *
 *  This module has been updated to add support for Asus i2c touchpad.
 *
 *  Copyright (c) 2016 Brendan McGrath <[email protected]>
 *  Copyright (c) 2016 Victor Vlasenko <[email protected]>
 *  Copyright (c) 2016 Frederik Wenigwieser <[email protected]>
 */

/*
 */

#include <linux/dmi.h>
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/platform_data/x86/asus-wmi.h>
#include <linux/input/mt.h>
#include <linux/usb.h> /* For to_usb_interface for T100 touchpad intf check */
#include <linux/power_supply.h>
#include <linux/leds.h>

#include "hid-ids.h"

MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_DESCRIPTION();

#define T100_TPAD_INTF
#define MEDION_E1239T_TPAD_INTF

#define E1239T_TP_TOGGLE_REPORT_ID
#define T100CHI_MOUSE_REPORT_ID
#define FEATURE_REPORT_ID
#define INPUT_REPORT_ID
#define FEATURE_KBD_REPORT_ID
#define FEATURE_KBD_REPORT_SIZE
#define FEATURE_KBD_LED_REPORT_ID1
#define FEATURE_KBD_LED_REPORT_ID2

#define SUPPORT_KBD_BACKLIGHT

#define MAX_TOUCH_MAJOR
#define MAX_PRESSURE

#define BTN_LEFT_MASK
#define CONTACT_TOOL_TYPE_MASK
#define CONTACT_X_MSB_MASK
#define CONTACT_Y_MSB_MASK
#define CONTACT_TOUCH_MAJOR_MASK
#define CONTACT_PRESSURE_MASK

#define BATTERY_REPORT_ID
#define BATTERY_REPORT_SIZE
#define BATTERY_LEVEL_MAX
#define BATTERY_STAT_DISCONNECT
#define BATTERY_STAT_CHARGING
#define BATTERY_STAT_FULL

#define QUIRK_FIX_NOTEBOOK_REPORT
#define QUIRK_NO_INIT_REPORTS
#define QUIRK_SKIP_INPUT_MAPPING
#define QUIRK_IS_MULTITOUCH
#define QUIRK_NO_CONSUMER_USAGES
#define QUIRK_USE_KBD_BACKLIGHT
#define QUIRK_T100_KEYBOARD
#define QUIRK_T100CHI
#define QUIRK_G752_KEYBOARD
#define QUIRK_T90CHI
#define QUIRK_MEDION_E1239T
#define QUIRK_ROG_NKEY_KEYBOARD
#define QUIRK_ROG_CLAYMORE_II_KEYBOARD

#define I2C_KEYBOARD_QUIRKS
#define I2C_TOUCHPAD_QUIRKS

#define TRKID_SGN

struct asus_kbd_leds {};

struct asus_touchpad_info {};

struct asus_drvdata {};

static int asus_report_battery(struct asus_drvdata *, u8 *, int);

static const struct asus_touchpad_info asus_i2c_tp =;

static const struct asus_touchpad_info asus_t100ta_tp =;

static const struct asus_touchpad_info asus_t100ha_tp =;

static const struct asus_touchpad_info asus_t200ta_tp =;

static const struct asus_touchpad_info asus_t100chi_tp =;

static const struct asus_touchpad_info medion_e1239t_tp =;

static void asus_report_contact_down(struct asus_drvdata *drvdat,
		int toolType, u8 *data)
{}

/* Required for Synaptics Palm Detection */
static void asus_report_tool_width(struct asus_drvdata *drvdat)
{}

static int asus_report_input(struct asus_drvdata *drvdat, u8 *data, int size)
{}

static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size)
{}

static int asus_event(struct hid_device *hdev, struct hid_field *field,
		      struct hid_usage *usage, __s32 value)
{}

static int asus_raw_event(struct hid_device *hdev,
		struct hid_report *report, u8 *data, int size)
{}

static int asus_kbd_set_report(struct hid_device *hdev, const u8 *buf, size_t buf_size)
{}

static int asus_kbd_init(struct hid_device *hdev, u8 report_id)
{}

static int asus_kbd_get_functions(struct hid_device *hdev,
				  unsigned char *kbd_func,
				  u8 report_id)
{}

static void asus_schedule_work(struct asus_kbd_leds *led)
{}

static void asus_kbd_backlight_set(struct led_classdev *led_cdev,
				   enum led_brightness brightness)
{}

static enum led_brightness asus_kbd_backlight_get(struct led_classdev *led_cdev)
{}

static void asus_kbd_backlight_work(struct work_struct *work)
{}

/* WMI-based keyboard backlight LED control (via asus-wmi driver) takes
 * precedence. We only activate HID-based backlight control when the
 * WMI control is not available.
 */
static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev)
{}

static int asus_kbd_register_leds(struct hid_device *hdev)
{}

/*
 * [0]       REPORT_ID (same value defined in report descriptor)
 * [1]	     rest battery level. range [0..255]
 * [2]..[7]  Bluetooth hardware address (MAC address)
 * [8]       charging status
 *            = 0 : AC offline / discharging
 *            = 1 : AC online  / charging
 *            = 2 : AC online  / fully charged
 */
static int asus_parse_battery(struct asus_drvdata *drvdata, u8 *data, int size)
{}

static int asus_report_battery(struct asus_drvdata *drvdata, u8 *data, int size)
{}

static int asus_battery_query(struct asus_drvdata *drvdata)
{}

static enum power_supply_property asus_battery_props[] =;

#define QUERY_MIN_INTERVAL

static int asus_battery_get_property(struct power_supply *psy,
				enum power_supply_property psp,
				union power_supply_propval *val)
{}

static int asus_battery_probe(struct hid_device *hdev)
{}

static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi)
{}

#define asus_map_key_clear(c)
static int asus_input_mapping(struct hid_device *hdev,
		struct hid_input *hi, struct hid_field *field,
		struct hid_usage *usage, unsigned long **bit,
		int *max)
{}

static int asus_start_multitouch(struct hid_device *hdev)
{}

static int __maybe_unused asus_resume(struct hid_device *hdev) {}

static int __maybe_unused asus_reset_resume(struct hid_device *hdev)
{}

static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
{}

static void asus_remove(struct hid_device *hdev)
{}

static const __u8 asus_g752_fixed_rdesc[] =;

static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
		unsigned int *rsize)
{}

static const struct hid_device_id asus_devices[] =;
MODULE_DEVICE_TABLE(hid, asus_devices);

static struct hid_driver asus_driver =;
module_hid_driver();

MODULE_LICENSE();