2 * Copyright (c) 2016 ROCKCHIP, Inc.
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)
12 #define HIDRKVRHANDSHAKE(len) _IOC(_IOC_WRITE, 'H', 0x1A, len)
14 #define HID_REPORT_ID_RKVR 3
15 #define RKVR_ID_IDLE 1
16 #define RKVR_ID_SYNC 2
18 #define HID_REPORT_ID_R 4
19 #define HID_REPORT_ID_W 5
20 #define HID_REPORT_ID_CRYP 6
22 #define HID_REGR_REPORT (4 - 1)
23 #define HID_REGW_REPORT (5 - 1)
25 #define HID_SYNCW_REPORT (7 - 1)
26 #define HID_SYNCR_REPORT (8 - 1)
28 enum tracker_message_type {
29 TrackerMessage_None = 0,
30 TrackerMessage_Sensors = 1,
31 TrackerMessage_Unknown = 0x100,
32 TrackerMessage_SizeError = 0x101,
37 #define DYNAMIC_LOAD_MPU6500 0
39 int rkvr_sensor_register_callback(int (*callback)(char *, size_t, void *), void *priv);
41 struct rkvr_iio_hw_device {
46 int (*open)(struct rkvr_iio_hw_device *hdev);
47 void (*close)(struct rkvr_iio_hw_device *hdev);
48 int (*power)(struct rkvr_iio_hw_device *hdev, int level);
49 int (*idle)(struct rkvr_iio_hw_device *hdev, int report, int idle, int reqtype);
50 int (*read)(struct rkvr_iio_hw_device *hdev, int reg, unsigned char *data, int len);
51 int (*write)(struct rkvr_iio_hw_device *hdev, int reg, unsigned char data);