Merge tag 'v5.15.57' into rpi-5.15.y
[platform/kernel/linux-rpi.git] / drivers / media / i2c / irs1125.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * A V4L2 driver for Infineon IRS1125 TOF cameras.
4  * Copyright (C) 2018, pieye GmbH
5  *
6  * Based on V4L2 OmniVision OV5647 Image Sensor driver
7  * Copyright (C) 2016 Ramiro Oliveira <roliveir@synopsys.com>
8  *
9  * DT / fwnode changes, and GPIO control taken from ov5640.c
10  * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved.
11  * Copyright (C) 2014-2017 Mentor Graphics Inc.
12  *
13  */
14
15 #ifndef IRS1125_H
16 #define IRS1125_H
17
18 #include <linux/v4l2-controls.h>
19 #include <linux/types.h>
20
21 #define IRS1125_NUM_SEQ_ENTRIES 20
22 #define IRS1125_NUM_MOD_PLLS 4
23
24 #define IRS1125_CID_CUSTOM_BASE                 (V4L2_CID_USER_BASE | 0xf000)
25 #define IRS1125_CID_CONTINUOUS_TRIG             (IRS1125_CID_CUSTOM_BASE + 1)
26 #define IRS1125_CID_TRIGGER                     (IRS1125_CID_CUSTOM_BASE + 2)
27 #define IRS1125_CID_RECONFIG                    (IRS1125_CID_CUSTOM_BASE + 3)
28 #define IRS1125_CID_ILLU_ON                     (IRS1125_CID_CUSTOM_BASE + 4)
29 #define IRS1125_CID_NUM_SEQS                    (IRS1125_CID_CUSTOM_BASE + 5)
30 #define IRS1125_CID_MOD_PLL                     (IRS1125_CID_CUSTOM_BASE + 6)
31 #define IRS1125_CID_SEQ_CONFIG                  (IRS1125_CID_CUSTOM_BASE + 7)
32 #define IRS1125_CID_IDENT0                      (IRS1125_CID_CUSTOM_BASE + 8)
33 #define IRS1125_CID_IDENT1                      (IRS1125_CID_CUSTOM_BASE + 9)
34 #define IRS1125_CID_IDENT2                      (IRS1125_CID_CUSTOM_BASE + 10)
35 #define IRS1125_CID_SAFE_RECONFIG_S0_EXPO       (IRS1125_CID_CUSTOM_BASE + 11)
36 #define IRS1125_CID_SAFE_RECONFIG_S0_FRAME      (IRS1125_CID_CUSTOM_BASE + 12)
37 #define IRS1125_CID_SAFE_RECONFIG_S1_EXPO       (IRS1125_CID_CUSTOM_BASE + 13)
38 #define IRS1125_CID_SAFE_RECONFIG_S1_FRAME      (IRS1125_CID_CUSTOM_BASE + 14)
39 #define IRS1125_CID_SAFE_RECONFIG_S2_EXPO       (IRS1125_CID_CUSTOM_BASE + 15)
40 #define IRS1125_CID_SAFE_RECONFIG_S2_FRAME      (IRS1125_CID_CUSTOM_BASE + 16)
41 #define IRS1125_CID_SAFE_RECONFIG_S3_EXPO       (IRS1125_CID_CUSTOM_BASE + 17)
42 #define IRS1125_CID_SAFE_RECONFIG_S3_FRAME      (IRS1125_CID_CUSTOM_BASE + 18)
43 #define IRS1125_CID_SAFE_RECONFIG_S4_EXPO       (IRS1125_CID_CUSTOM_BASE + 19)
44 #define IRS1125_CID_SAFE_RECONFIG_S4_FRAME      (IRS1125_CID_CUSTOM_BASE + 20)
45 #define IRS1125_CID_SAFE_RECONFIG_S5_EXPO       (IRS1125_CID_CUSTOM_BASE + 21)
46 #define IRS1125_CID_SAFE_RECONFIG_S5_FRAME      (IRS1125_CID_CUSTOM_BASE + 22)
47 #define IRS1125_CID_SAFE_RECONFIG_S6_EXPO       (IRS1125_CID_CUSTOM_BASE + 23)
48 #define IRS1125_CID_SAFE_RECONFIG_S6_FRAME      (IRS1125_CID_CUSTOM_BASE + 24)
49 #define IRS1125_CID_SAFE_RECONFIG_S7_EXPO       (IRS1125_CID_CUSTOM_BASE + 25)
50 #define IRS1125_CID_SAFE_RECONFIG_S7_FRAME      (IRS1125_CID_CUSTOM_BASE + 26)
51 #define IRS1125_CID_SAFE_RECONFIG_S8_EXPO       (IRS1125_CID_CUSTOM_BASE + 27)
52 #define IRS1125_CID_SAFE_RECONFIG_S8_FRAME      (IRS1125_CID_CUSTOM_BASE + 28)
53 #define IRS1125_CID_SAFE_RECONFIG_S9_EXPO       (IRS1125_CID_CUSTOM_BASE + 29)
54 #define IRS1125_CID_SAFE_RECONFIG_S9_FRAME      (IRS1125_CID_CUSTOM_BASE + 30)
55 #define IRS1125_CID_SAFE_RECONFIG_S10_EXPO      (IRS1125_CID_CUSTOM_BASE + 31)
56 #define IRS1125_CID_SAFE_RECONFIG_S10_FRAME     (IRS1125_CID_CUSTOM_BASE + 32)
57 #define IRS1125_CID_SAFE_RECONFIG_S11_EXPO      (IRS1125_CID_CUSTOM_BASE + 33)
58 #define IRS1125_CID_SAFE_RECONFIG_S11_FRAME     (IRS1125_CID_CUSTOM_BASE + 34)
59 #define IRS1125_CID_SAFE_RECONFIG_S12_EXPO      (IRS1125_CID_CUSTOM_BASE + 35)
60 #define IRS1125_CID_SAFE_RECONFIG_S12_FRAME     (IRS1125_CID_CUSTOM_BASE + 36)
61 #define IRS1125_CID_SAFE_RECONFIG_S13_EXPO      (IRS1125_CID_CUSTOM_BASE + 37)
62 #define IRS1125_CID_SAFE_RECONFIG_S13_FRAME     (IRS1125_CID_CUSTOM_BASE + 38)
63 #define IRS1125_CID_SAFE_RECONFIG_S14_EXPO      (IRS1125_CID_CUSTOM_BASE + 39)
64 #define IRS1125_CID_SAFE_RECONFIG_S14_FRAME     (IRS1125_CID_CUSTOM_BASE + 40)
65 #define IRS1125_CID_SAFE_RECONFIG_S15_EXPO      (IRS1125_CID_CUSTOM_BASE + 41)
66 #define IRS1125_CID_SAFE_RECONFIG_S15_FRAME     (IRS1125_CID_CUSTOM_BASE + 42)
67 #define IRS1125_CID_SAFE_RECONFIG_S16_EXPO      (IRS1125_CID_CUSTOM_BASE + 43)
68 #define IRS1125_CID_SAFE_RECONFIG_S16_FRAME     (IRS1125_CID_CUSTOM_BASE + 44)
69 #define IRS1125_CID_SAFE_RECONFIG_S17_EXPO      (IRS1125_CID_CUSTOM_BASE + 45)
70 #define IRS1125_CID_SAFE_RECONFIG_S17_FRAME     (IRS1125_CID_CUSTOM_BASE + 46)
71 #define IRS1125_CID_SAFE_RECONFIG_S18_EXPO      (IRS1125_CID_CUSTOM_BASE + 47)
72 #define IRS1125_CID_SAFE_RECONFIG_S18_FRAME     (IRS1125_CID_CUSTOM_BASE + 48)
73 #define IRS1125_CID_SAFE_RECONFIG_S19_EXPO      (IRS1125_CID_CUSTOM_BASE + 49)
74 #define IRS1125_CID_SAFE_RECONFIG_S19_FRAME     (IRS1125_CID_CUSTOM_BASE + 50)
75
76 struct irs1125_seq_cfg {
77         __u16 exposure;
78         __u16 framerate;
79         __u16 ps;
80         __u16 pll;
81 };
82
83 struct irs1125_mod_pll {
84         __u16 pllcfg1;
85         __u16 pllcfg2;
86         __u16 pllcfg3;
87         __u16 pllcfg4;
88         __u16 pllcfg5;
89         __u16 pllcfg6;
90         __u16 pllcfg7;
91         __u16 pllcfg8;
92 };
93
94 #endif /* IRS1125 */
95