linux/drivers/platform/x86/intel/hid.c

// SPDX-License-Identifier: GPL-2.0+
/*
 *  Intel HID event & 5 button array driver
 *
 *  Copyright (C) 2015 Alex Hung <[email protected]>
 *  Copyright (C) 2015 Andrew Lutomirski <[email protected]>
 */

#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/input.h>
#include <linux/input/sparse-keymap.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/string_choices.h>
#include <linux/suspend.h>
#include "../dual_accel_detect.h"

enum intel_hid_tablet_sw_mode {};

static bool enable_5_button_array;
module_param(enable_5_button_array, bool, 0444);
MODULE_PARM_DESC();

static int enable_sw_tablet_mode =;
module_param(enable_sw_tablet_mode, int, 0444);
MODULE_PARM_DESC();

/* When NOT in tablet mode, VGBS returns with the flag 0x40 */
#define TABLET_MODE_FLAG

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

static const struct acpi_device_id intel_hid_ids[] =;
MODULE_DEVICE_TABLE(acpi, intel_hid_ids);

/* In theory, these are HID usages. */
static const struct key_entry intel_hid_keymap[] =;

/* 5 button array notification value. */
static const struct key_entry intel_array_keymap[] =;

static const struct dmi_system_id button_array_table[] =;

/*
 * Some convertible use the intel-hid ACPI interface to report SW_TABLET_MODE,
 * these need to be compared via a DMI based authorization list because some
 * models have unreliable VGBS return which could cause incorrect
 * SW_TABLET_MODE report.
 */
static const struct dmi_system_id dmi_vgbs_allow_list[] =;

/*
 * Some devices, even non convertible ones, can send incorrect SW_TABLET_MODE
 * reports. Accept such reports only from devices in this list.
 */
static const struct dmi_system_id dmi_auto_add_switch[] =;

struct intel_hid_priv {};

#define HID_EVENT_FILTER_UUID

enum intel_hid_dsm_fn_codes {};

static const char *intel_hid_dsm_fn_to_method[INTEL_HID_DSM_FN_MAX] =;

static unsigned long long intel_hid_dsm_fn_mask;
static guid_t intel_dsm_guid;

static bool intel_hid_execute_method(acpi_handle handle,
				     enum intel_hid_dsm_fn_codes fn_index,
				     unsigned long long arg)
{}

static bool intel_hid_evaluate_method(acpi_handle handle,
				      enum intel_hid_dsm_fn_codes fn_index,
				      unsigned long long *result)
{}

static void intel_hid_init_dsm(acpi_handle handle)
{}

static int intel_hid_set_enable(struct device *device, bool enable)
{}

static void intel_button_array_enable(struct device *device, bool enable)
{}

static int intel_hid_pm_prepare(struct device *device)
{}

static void intel_hid_pm_complete(struct device *device)
{}

static int intel_hid_pl_suspend_handler(struct device *device)
{}

static int intel_hid_pl_resume_handler(struct device *device)
{}

static const struct dev_pm_ops intel_hid_pl_pm_ops =;

static int intel_hid_input_setup(struct platform_device *device)
{}

static int intel_button_array_input_setup(struct platform_device *device)
{}

static int intel_hid_switches_setup(struct platform_device *device)
{}

static void report_tablet_mode_state(struct platform_device *device)
{}

static bool report_tablet_mode_event(struct input_dev *input_dev, u32 event)
{}

static void notify_handler(acpi_handle handle, u32 event, void *context)
{}

static bool button_array_present(struct platform_device *device)
{}

static int intel_hid_probe(struct platform_device *device)
{}

static void intel_hid_remove(struct platform_device *device)
{}

static struct platform_driver intel_hid_pl_driver =;

/*
 * Unfortunately, some laptops provide a _HID="INT33D5" device with
 * _CID="PNP0C02".  This causes the pnpacpi scan driver to claim the
 * ACPI node, so no platform device will be created.  The pnpacpi
 * driver rejects this device in subsequent processing, so no physical
 * node is created at all.
 *
 * As a workaround until the ACPI core figures out how to handle
 * this corner case, manually ask the ACPI platform device code to
 * claim the ACPI node.
 */
static acpi_status __init
check_acpi_dev(acpi_handle handle, u32 lvl, void *context, void **rv)
{}

static int __init intel_hid_init(void)
{}
module_init();

static void __exit intel_hid_exit(void)
{}
module_exit(intel_hid_exit);