aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hid-sensor-hub.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hid-sensor-hub.h')
-rw-r--r--include/linux/hid-sensor-hub.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
index 32ba45158d39..b914ca3f57ba 100644
--- a/include/linux/hid-sensor-hub.h
+++ b/include/linux/hid-sensor-hub.h
@@ -21,6 +21,8 @@
21 21
22#include <linux/hid.h> 22#include <linux/hid.h>
23#include <linux/hid-sensor-ids.h> 23#include <linux/hid-sensor-ids.h>
24#include <linux/iio/iio.h>
25#include <linux/iio/trigger.h>
24 26
25/** 27/**
26 * struct hid_sensor_hub_attribute_info - Attribute info 28 * struct hid_sensor_hub_attribute_info - Attribute info
@@ -40,6 +42,8 @@ struct hid_sensor_hub_attribute_info {
40 s32 units; 42 s32 units;
41 s32 unit_expo; 43 s32 unit_expo;
42 s32 size; 44 s32 size;
45 s32 logical_minimum;
46 s32 logical_maximum;
43}; 47};
44 48
45/** 49/**
@@ -47,11 +51,13 @@ struct hid_sensor_hub_attribute_info {
47 * @hdev: Stores the hid instance. 51 * @hdev: Stores the hid instance.
48 * @vendor_id: Vendor id of hub device. 52 * @vendor_id: Vendor id of hub device.
49 * @product_id: Product id of hub device. 53 * @product_id: Product id of hub device.
54 * @ref_cnt: Number of MFD clients have opened this device
50 */ 55 */
51struct hid_sensor_hub_device { 56struct hid_sensor_hub_device {
52 struct hid_device *hdev; 57 struct hid_device *hdev;
53 u32 vendor_id; 58 u32 vendor_id;
54 u32 product_id; 59 u32 product_id;
60 int ref_cnt;
55}; 61};
56 62
57/** 63/**
@@ -74,6 +80,22 @@ struct hid_sensor_hub_callbacks {
74 void *priv); 80 void *priv);
75}; 81};
76 82
83/**
84* sensor_hub_device_open() - Open hub device
85* @hsdev: Hub device instance.
86*
87* Used to open hid device for sensor hub.
88*/
89int sensor_hub_device_open(struct hid_sensor_hub_device *hsdev);
90
91/**
92* sensor_hub_device_clode() - Close hub device
93* @hsdev: Hub device instance.
94*
95* Used to clode hid device for sensor hub.
96*/
97void sensor_hub_device_close(struct hid_sensor_hub_device *hsdev);
98
77/* Registration functions */ 99/* Registration functions */
78 100
79/** 101/**
@@ -166,6 +188,7 @@ struct hid_sensor_common {
166 struct platform_device *pdev; 188 struct platform_device *pdev;
167 unsigned usage_id; 189 unsigned usage_id;
168 bool data_ready; 190 bool data_ready;
191 struct iio_trigger *trigger;
169 struct hid_sensor_hub_attribute_info poll; 192 struct hid_sensor_hub_attribute_info poll;
170 struct hid_sensor_hub_attribute_info report_state; 193 struct hid_sensor_hub_attribute_info report_state;
171 struct hid_sensor_hub_attribute_info power_state; 194 struct hid_sensor_hub_attribute_info power_state;