linux/drivers/platform/x86/hp/hp_accel.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  hp_accel.c - Interface between LIS3LV02DL driver and HP ACPI BIOS
 *
 *  Copyright (C) 2007-2008 Yan Burman
 *  Copyright (C) 2008 Eric Piel
 *  Copyright (C) 2008-2009 Pavel Machek
 */

#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/dmi.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/wait.h>
#include <linux/poll.h>
#include <linux/freezer.h>
#include <linux/uaccess.h>
#include <linux/leds.h>
#include <linux/atomic.h>
#include <linux/acpi.h>
#include <linux/i8042.h>
#include <linux/serio.h>
#include "../../../misc/lis3lv02d/lis3lv02d.h"

/* Delayed LEDs infrastructure ------------------------------------ */

/* Special LED class that can defer work */
struct delayed_led_classdev {};

static inline void delayed_set_status_worker(struct work_struct *work)
{}

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

/* HP-specific accelerometer driver ------------------------------------ */

/* e0 25, e0 26, e0 27, e0 28 are scan codes that the accelerometer with acpi id
 * HPQ6000 sends through the keyboard bus */
#define ACCEL_1
#define ACCEL_2
#define ACCEL_3
#define ACCEL_4

/* For automatic insertion of the module */
static const struct acpi_device_id lis3lv02d_device_ids[] =;
MODULE_DEVICE_TABLE(acpi, lis3lv02d_device_ids);

/**
 * lis3lv02d_acpi_init - initialize the device for ACPI
 * @lis3: pointer to the device struct
 *
 * Returns 0 on success.
 */
static int lis3lv02d_acpi_init(struct lis3lv02d *lis3)
{}

/**
 * lis3lv02d_acpi_read - ACPI ALRD method: read a register
 * @lis3: pointer to the device struct
 * @reg:    the register to read
 * @ret:    result of the operation
 *
 * Returns 0 on success.
 */
static int lis3lv02d_acpi_read(struct lis3lv02d *lis3, int reg, u8 *ret)
{}

/**
 * lis3lv02d_acpi_write - ACPI ALWR method: write to a register
 * @lis3: pointer to the device struct
 * @reg:    the register to write to
 * @val:    the value to write
 *
 * Returns 0 on success.
 */
static int lis3lv02d_acpi_write(struct lis3lv02d *lis3, int reg, u8 val)
{}

static int lis3lv02d_dmi_matched(const struct dmi_system_id *dmi)
{}

/* Represents, for each axis seen by userspace, the corresponding hw axis (+1).
 * If the value is negative, the opposite of the hw value is used. */
#define DEFINE_CONV(name, x, y, z)
DEFINE_CONV(normal, 1, 2, 3);
DEFINE_CONV(y_inverted, 1, -2, 3);
DEFINE_CONV(x_inverted, -1, 2, 3);
DEFINE_CONV(x_inverted_usd, -1, 2, -3);
DEFINE_CONV(z_inverted, 1, 2, -3);
DEFINE_CONV(xy_swap, 2, 1, 3);
DEFINE_CONV(xy_rotated_left, -2, 1, 3);
DEFINE_CONV(xy_rotated_left_usd, -2, 1, -3);
DEFINE_CONV(xy_swap_inverted, -2, -1, 3);
DEFINE_CONV(xy_rotated_right, 2, -1, 3);
DEFINE_CONV(xy_swap_yz_inverted, 2, -1, -3);

#define AXIS_DMI_MATCH(_ident, _name, _axis)

#define AXIS_DMI_MATCH2(_ident, _class1, _name1,	\
				_class2, _name2,	\
				_axis)
static const struct dmi_system_id lis3lv02d_dmi_ids[] =;

static void hpled_set(struct delayed_led_classdev *led_cdev, enum led_brightness value)
{}

static struct delayed_led_classdev hpled_led =;

static bool hp_accel_i8042_filter(unsigned char data, unsigned char str,
				  struct serio *port)
{}

static int lis3lv02d_probe(struct platform_device *device)
{}

static void lis3lv02d_remove(struct platform_device *device)
{}

static int __maybe_unused lis3lv02d_suspend(struct device *dev)
{}

static int __maybe_unused lis3lv02d_resume(struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(hp_accel_pm, lis3lv02d_suspend, lis3lv02d_resume);

/* For the HP MDPS aka 3D Driveguard */
static struct platform_driver lis3lv02d_driver =;
module_platform_driver();

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