1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright 2013-2016 Freescale Semiconductor Inc.
4  * Copyright 2016-2018 NXP
5  */
6 
7 #ifndef _FSL_DPRTC_CMD_H
8 #define _FSL_DPRTC_CMD_H
9 
10 /* Command versioning */
11 #define DPRTC_CMD_BASE_VERSION		1
12 #define DPRTC_CMD_ID_OFFSET		4
13 
14 #define DPRTC_CMD(id)	(((id) << DPRTC_CMD_ID_OFFSET) | DPRTC_CMD_BASE_VERSION)
15 
16 /* Command IDs */
17 #define DPRTC_CMDID_CLOSE			DPRTC_CMD(0x800)
18 #define DPRTC_CMDID_OPEN			DPRTC_CMD(0x810)
19 
20 #define DPRTC_CMDID_SET_FREQ_COMPENSATION	DPRTC_CMD(0x1d1)
21 #define DPRTC_CMDID_GET_FREQ_COMPENSATION	DPRTC_CMD(0x1d2)
22 #define DPRTC_CMDID_GET_TIME			DPRTC_CMD(0x1d3)
23 #define DPRTC_CMDID_SET_TIME			DPRTC_CMD(0x1d4)
24 
25 #pragma pack(push, 1)
26 struct dprtc_cmd_open {
27 	__le32 dprtc_id;
28 };
29 
30 struct dprtc_get_freq_compensation {
31 	__le32 freq_compensation;
32 };
33 
34 struct dprtc_time {
35 	__le64 time;
36 };
37 
38 #pragma pack(pop)
39 
40 #endif /* _FSL_DPRTC_CMD_H */
41