Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
hp_accel.c File Reference
#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.

Data Structures

struct  delayed_led_classdev
 

Macros

#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
 

Functions

 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")
 

Macro Definition Documentation

#define ACPI_MDPS_CLASS   "accelerometer"

Definition at line 43 of file hp_accel.c.

#define AXIS_DMI_MATCH (   _ident,
  _name,
  _axis 
)
Value:
{ \
.ident = _ident, \
.callback = lis3lv02d_dmi_matched, \
.matches = { \
DMI_MATCH(DMI_PRODUCT_NAME, _name) \
}, \
.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,
 
)
Value:
static union axis_conversion lis3lv02d_axis_##name = \
{ .as_array = { x, y, z } }

Definition at line 160 of file hp_accel.c.

#define DRIVER_NAME   "hp_accel"

Definition at line 42 of file hp_accel.c.

#define HP_ACCEL_PM   NULL

Definition at line 371 of file hp_accel.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 23 of file hp_accel.c.

Function Documentation

DEFINE_CONV ( normal  ,
,
,
 
)
DEFINE_CONV ( y_inverted  ,
,
2,
 
)
DEFINE_CONV ( x_inverted  ,
1,
,
 
)
DEFINE_CONV ( z_inverted  ,
,
,
3 
)
DEFINE_CONV ( xy_swap  ,
,
,
 
)
DEFINE_CONV ( xy_rotated_left  ,
2,
,
 
)
DEFINE_CONV ( xy_rotated_left_usd  ,
2,
,
3 
)
DEFINE_CONV ( xy_swap_inverted  ,
2,
1,
 
)
DEFINE_CONV ( xy_rotated_right  ,
,
1,
 
)
DEFINE_CONV ( xy_swap_yz_inverted  ,
,
1,
3 
)
int lis3lv02d_acpi_init ( struct lis3lv02d lis3)

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.

int lis3lv02d_acpi_read ( struct lis3lv02d lis3,
int  reg,
u8 ret 
)

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.

int lis3lv02d_acpi_write ( struct lis3lv02d lis3,
int  reg,
u8  val 
)

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   
)
MODULE_LICENSE ( "GPL"  )