hid: rkvr: add suspend and resume notifier for nanoc
[firefly-linux-kernel-4.4.55.git] / drivers / hid / hid-rkvr.h
1 /*
2  * Copyright (c) 2016 ROCKCHIP, Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the Free
6  * Software Foundation; either version 2 of the License, or (at your option)
7  * any later version.
8  */
9 #ifndef __HID_RKVR_H
10 #define __HID_RKVR_H
11
12 #define HIDRKVRHANDSHAKE(len)   _IOC(_IOC_WRITE, 'H', 0x1A, len)
13
14 #define HID_REPORT_ID_RKVR      3
15 #define RKVR_ID_IDLE    1
16 #define RKVR_ID_SYNC    2
17 #define RKVR_ID_CAPS    3
18
19 #define HID_REPORT_ID_R 4
20 #define HID_REPORT_ID_W 5
21 #define HID_REPORT_ID_CRYP      6
22
23 #define HID_REGR_REPORT (4 - 1)
24 #define HID_REGW_REPORT (5 - 1)
25 #define HID_MISC_REPORT (6 - 1)
26
27 #define HID_SYNCW_REPORT        (7 - 1)
28 #define HID_SYNCR_REPORT        (8 - 1)
29
30 enum tracker_message_type {
31         TrackerMessage_None              = 0,
32         TrackerMessage_Sensors           = 1,
33         TrackerMessage_Unknown           = 0x100,
34         TrackerMessage_SizeError         = 0x101,
35 };
36
37 #define DEBUG_SYS 1
38
39 #define DYNAMIC_LOAD_MPU6500 0
40
41 int rkvr_sensor_register_callback(int (*callback)(char *, size_t, void *), void *priv);
42
43 struct rkvr_iio_hw_device {
44         struct device *dev;
45         const char *name;
46         int is_open;
47         struct list_head l;
48         int (*open)(struct rkvr_iio_hw_device *hdev);
49         void (*close)(struct rkvr_iio_hw_device *hdev);
50         int (*power)(struct rkvr_iio_hw_device *hdev, int level);
51         int (*idle)(struct rkvr_iio_hw_device *hdev, int report, int idle, int reqtype);
52         int (*read)(struct rkvr_iio_hw_device *hdev, int reg, unsigned char *data, int len);
53         int (*write)(struct rkvr_iio_hw_device *hdev, int reg, unsigned char data);
54 };
55
56 #endif