1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 #ifndef __TAG_GLOBAL_H_INCLUDED__
17 #define __TAG_GLOBAL_H_INCLUDED__
18 
19 /* offsets for encoding/decoding the tag into an uint32_t */
20 
21 #define TAG_CAP	1
22 #define TAG_EXP	2
23 
24 #define TAG_NUM_CAPTURES_SIGN_SHIFT	 6
25 #define TAG_OFFSET_SIGN_SHIFT		 7
26 #define TAG_NUM_CAPTURES_SHIFT		 8
27 #define TAG_OFFSET_SHIFT		16
28 #define TAG_SKIP_SHIFT			24
29 
30 #define TAG_EXP_ID_SHIFT		 8
31 
32 /* Data structure containing the tagging information which is used in
33  * continuous mode to specify which frames should be captured.
34  * num_captures		The number of RAW frames to be processed to
35  *                      YUV. Setting this to -1 will make continuous
36  *                      capture run until it is stopped.
37  * skip			Skip N frames in between captures. This can be
38  *                      used to select a slower capture frame rate than
39  *                      the sensor output frame rate.
40  * offset		Start the RAW-to-YUV processing at RAW buffer
41  *                      with this offset. This allows the user to
42  *                      process RAW frames that were captured in the
43  *                      past or future.
44  * exp_id		Exposure id of the RAW frame to tag.
45  *
46  * NOTE: Either exp_id = 0 or all other fields are 0
47  *	 (so yeah, this could be a union)
48  */
49 
50 struct sh_css_tag_descr {
51 	int num_captures;
52 	unsigned int skip;
53 	int offset;
54 	unsigned int exp_id;
55 };
56 
57 #endif /* __TAG_GLOBAL_H_INCLUDED__ */
58