Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
include
linux
hid-sensor-hub.h
Go to the documentation of this file.
1
/*
2
* HID Sensors Driver
3
* Copyright (c) 2012, Intel Corporation.
4
*
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms and conditions of the GNU General Public License,
7
* version 2, as published by the Free Software Foundation.
8
*
9
* This program is distributed in the hope it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along with
15
* this program; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17
*
18
*/
19
#ifndef _HID_SENSORS_HUB_H
20
#define _HID_SENSORS_HUB_H
21
22
#include <linux/hid.h>
23
#include <
linux/hid-sensor-ids.h
>
24
35
struct
hid_sensor_hub_attribute_info
{
36
u32
usage_id
;
37
u32
attrib_id
;
38
s32
report_id
;
39
s32
index
;
40
s32
units
;
41
s32
unit_expo
;
42
s32
size
;
43
};
44
51
struct
hid_sensor_hub_device
{
52
struct
hid_device
*
hdev
;
53
u32
vendor_id
;
54
u32
product_id
;
55
};
56
66
struct
hid_sensor_hub_callbacks
{
67
struct
platform_device
*
pdev
;
68
int
(*
suspend
)(
struct
hid_sensor_hub_device
*hsdev,
void
*
priv
);
69
int
(*
resume
)(
struct
hid_sensor_hub_device
*hsdev,
void
*
priv
);
70
int
(*
capture_sample
)(
struct
hid_sensor_hub_device
*hsdev,
71
u32
usage_id,
size_t
raw_len,
char
*raw_data,
72
void
*
priv
);
73
int
(*
send_event
)(
struct
hid_sensor_hub_device
*hsdev,
u32
usage_id,
74
void
*
priv
);
75
};
76
77
/* Registration functions */
78
89
int
sensor_hub_register_callback
(
struct
hid_sensor_hub_device
*hsdev,
90
u32
usage_id,
91
struct
hid_sensor_hub_callbacks
*usage_callback);
92
101
int
sensor_hub_remove_callback
(
struct
hid_sensor_hub_device
*hsdev,
102
u32
usage_id);
103
104
105
/* Hid sensor hub core interfaces */
106
118
int
sensor_hub_input_get_attribute_info
(
struct
hid_sensor_hub_device
*hsdev,
119
u8
type
,
120
u32
usage_id,
u32
attr_usage_id,
121
struct
hid_sensor_hub_attribute_info
*
info
);
122
134
int
sensor_hub_input_attr_get_raw_value
(
struct
hid_sensor_hub_device
*hsdev,
135
u32
usage_id,
136
u32
attr_usage_id,
u32
report_id);
146
int
sensor_hub_set_feature
(
struct
hid_sensor_hub_device
*hsdev,
u32
report_id,
147
u32
field_index,
s32
value
);
148
158
int
sensor_hub_get_feature
(
struct
hid_sensor_hub_device
*hsdev,
u32
report_id,
159
u32
field_index,
s32
*
value
);
160
#endif
Generated on Thu Jan 10 2013 14:51:29 for Linux Kernel by
1.8.2