Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hid-sensor-attributes.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_ATTRIBUTES_H
20 #define _HID_SENSORS_ATTRIBUTES_H
21 
22 /* Common hid sensor iio structure */
26  unsigned usage_id;
27  bool data_ready;
32 };
33 
34 /*Convert from hid unit expo to regular exponent*/
35 static inline int hid_sensor_convert_exponent(int unit_expo)
36 {
37  if (unit_expo < 0x08)
38  return unit_expo;
39  else if (unit_expo <= 0x0f)
40  return -(0x0f-unit_expo+1);
41  else
42  return 0;
43 }
44 
46  u32 usage_id,
47  struct hid_sensor_iio_common *st);
49  int val1, int val2);
51  int *val1, int *val2);
53  int val1, int val2);
55  int *val1, int *val2);
56 
57 #endif