Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
hid-sensor-hub.h File Reference
#include <linux/hid.h>
#include <linux/hid-sensor-ids.h>

Go to the source code of this file.

Data Structures

struct  hid_sensor_hub_attribute_info
 
struct  hid_sensor_hub_device
 
struct  hid_sensor_hub_callbacks
 

Functions

int sensor_hub_register_callback (struct hid_sensor_hub_device *hsdev, u32 usage_id, struct hid_sensor_hub_callbacks *usage_callback)
 
int sensor_hub_remove_callback (struct hid_sensor_hub_device *hsdev, u32 usage_id)
 
int sensor_hub_input_get_attribute_info (struct hid_sensor_hub_device *hsdev, u8 type, u32 usage_id, u32 attr_usage_id, struct hid_sensor_hub_attribute_info *info)
 
int sensor_hub_input_attr_get_raw_value (struct hid_sensor_hub_device *hsdev, u32 usage_id, u32 attr_usage_id, u32 report_id)
 
int sensor_hub_set_feature (struct hid_sensor_hub_device *hsdev, u32 report_id, u32 field_index, s32 value)
 
int sensor_hub_get_feature (struct hid_sensor_hub_device *hsdev, u32 report_id, u32 field_index, s32 *value)
 

Function Documentation

int sensor_hub_get_feature ( struct hid_sensor_hub_device hsdev,
u32  report_id,
u32  field_index,
s32 value 
)

sensor_hub_get_feature() - Feature get request : Report id to look for : Field index inside a report : Place holder for return value

Used to get a field in feature report. For example this can get polling interval, sensitivity, activate/deactivate state.

Definition at line 234 of file hid-sensor-hub.c.

int sensor_hub_input_attr_get_raw_value ( struct hid_sensor_hub_device hsdev,
u32  usage_id,
u32  attr_usage_id,
u32  report_id 
)

sensor_hub_input_attr_get_raw_value() - Synchronous read request : Attribute usage id of parent physical device as per spec : Attribute usage id as per spec : Report id to look for

Issues a synchronous read request for an input attribute. Returns data upto 32 bits. Since client can get events, so this call should not be used for data paths, this will impact performance.

Definition at line 259 of file hid-sensor-hub.c.

int sensor_hub_input_get_attribute_info ( struct hid_sensor_hub_device hsdev,
u8  type,
u32  usage_id,
u32  attr_usage_id,
struct hid_sensor_hub_attribute_info info 
)

sensor_hub_input_get_attribute_info() - Get an attribute information : Hub device instance. : Type of this attribute, input/output/feature : Attribute usage id of parent physical device as per spec : Attribute usage id as per spec : return information about attribute after parsing report

Parses report and returns the attribute information such as report id, field index, units and exponet etc.

Definition at line 308 of file hid-sensor-hub.c.

int sensor_hub_register_callback ( struct hid_sensor_hub_device hsdev,
u32  usage_id,
struct hid_sensor_hub_callbacks usage_callback 
)

sensor_hub_register_callback() - Register client callbacks : Hub device instance. : Usage id of the client (E.g. 0x200076 for Gyro). : Callback function storage

Used to register callbacks by client processing drivers. Sensor hub core driver will call these callbacks to offload processing of data streams and notifications.

Definition at line 163 of file hid-sensor-hub.c.

int sensor_hub_remove_callback ( struct hid_sensor_hub_device hsdev,
u32  usage_id 
)

sensor_hub_remove_callback() - Remove client callbacks : Hub device instance. : Usage id of the client (E.g. 0x200076 for Gyro).

If there is a callback registred, this call will remove that callbacks, so that it will stop data and event notifications.

Definition at line 191 of file hid-sensor-hub.c.

int sensor_hub_set_feature ( struct hid_sensor_hub_device hsdev,
u32  report_id,
u32  field_index,
s32  value 
)

sensor_hub_set_feature() - Feature set request : Report id to look for : Field index inside a report : Value to set

Used to set a field in feature report. For example this can set polling interval, sensitivity, activate/deactivate state.

Definition at line 210 of file hid-sensor-hub.c.