#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 <acpi/acpi_drivers.h>
#include "../../misc/lis3lv02d/lis3lv02d.h"
Go to the source code of this file.
|
#define | pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|
#define | DRIVER_NAME "hp_accel" |
|
#define | ACPI_MDPS_CLASS "accelerometer" |
|
#define | DEFINE_CONV(name, x, y, z) |
|
#define | AXIS_DMI_MATCH(_ident, _name, _axis) |
|
#define | AXIS_DMI_MATCH2(_ident, _class1, _name1, _class2, _name2, _axis) |
|
#define | HP_ACCEL_PM NULL |
|
|
| MODULE_DEVICE_TABLE (acpi, lis3lv02d_device_ids) |
|
int | lis3lv02d_acpi_init (struct lis3lv02d *lis3) |
|
int | lis3lv02d_acpi_read (struct lis3lv02d *lis3, int reg, u8 *ret) |
|
int | lis3lv02d_acpi_write (struct lis3lv02d *lis3, int reg, u8 val) |
|
| DEFINE_CONV (normal, 1, 2, 3) |
|
| DEFINE_CONV (y_inverted, 1,-2, 3) |
|
| DEFINE_CONV (x_inverted,-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) |
|
| module_acpi_driver (lis3lv02d_driver) |
|
| MODULE_DESCRIPTION ("Glue between LIS3LV02Dx and HP ACPI BIOS and support for disk protection LED.") |
|
| MODULE_AUTHOR ("Yan Burman, Eric Piel, Pavel Machek") |
|
| MODULE_LICENSE ("GPL") |
|
#define ACPI_MDPS_CLASS "accelerometer" |
#define AXIS_DMI_MATCH |
( |
|
_ident, |
|
|
|
_name, |
|
|
|
_axis |
|
) |
| |
Value:{ \
.ident = _ident, \
.callback = lis3lv02d_dmi_matched, \
.matches = { \
}, \
.driver_data = &lis3lv02d_axis_##_axis \
}
Definition at line 174 of file hp_accel.c.
#define AXIS_DMI_MATCH2 |
( |
|
_ident, |
|
|
|
_class1, |
|
|
|
_name1, |
|
|
|
_class2, |
|
|
|
_name2, |
|
|
|
_axis |
|
) |
| |
Value:{ \
.ident = _ident, \
.callback = lis3lv02d_dmi_matched, \
.matches = { \
DMI_MATCH(DMI_##_class1, _name1), \
DMI_MATCH(DMI_##_class2, _name2), \
}, \
.driver_data = &lis3lv02d_axis_##_axis \
}
Definition at line 183 of file hp_accel.c.
#define DEFINE_CONV |
( |
|
name, |
|
|
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| |
#define DRIVER_NAME "hp_accel" |
#define pr_fmt |
( |
|
fmt | ) |
KBUILD_MODNAME ": " fmt |
DEFINE_CONV |
( |
normal |
, |
|
|
1 |
, |
|
|
2 |
, |
|
|
3 |
|
|
) |
| |
DEFINE_CONV |
( |
y_inverted |
, |
|
|
1 |
, |
|
|
- |
2, |
|
|
3 |
|
|
) |
| |
DEFINE_CONV |
( |
x_inverted |
, |
|
|
- |
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 |
|
) |
| |
lis3lv02d_acpi_init - ACPI _INI method: initialize the device. : pointer to the device struct
Returns 0 on success.
Definition at line 91 of file hp_accel.c.
lis3lv02d_acpi_read - ACPI ALRD method: read a register : pointer to the device struct : the register to read : result of the operation
Returns 0 on success.
Definition at line 109 of file hp_accel.c.
lis3lv02d_acpi_write - ACPI ALWR method: write to a register : pointer to the device struct : the register to write to : the value to write
Returns 0 on success.
Definition at line 132 of file hp_accel.c.
module_acpi_driver |
( |
lis3lv02d_driver |
| ) |
|
MODULE_AUTHOR |
( |
"Yan |
Burman, |
|
|
Eric |
Piel, |
|
|
Pavel Machek" |
|
|
) |
| |
MODULE_DESCRIPTION |
( |
"Glue between LIS3LV02Dx and HP ACPI BIOS and support for disk protection LED." |
| ) |
|
MODULE_DEVICE_TABLE |
( |
acpi |
, |
|
|
lis3lv02d_device_ids |
|
|
) |
| |