hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/media/i2c/smiapp/smiapp.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * drivers/media/i2c/smiapp/smiapp.h
34 *
....@@ -5,15 +6,6 @@
56 *
67 * Copyright (C) 2010--2012 Nokia Corporation
78 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License
11
- * version 2 as published by the Free Software Foundation.
12
- *
13
- * This program is distributed in the hope that it will be useful, but
14
- * WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
- * General Public License for more details.
179 */
1810
1911 #ifndef __SMIAPP_PRIV_H_
....@@ -22,7 +14,6 @@
2214 #include <linux/mutex.h>
2315 #include <media/v4l2-ctrls.h>
2416 #include <media/v4l2-subdev.h>
25
-#include <media/i2c/smiapp.h>
2617
2718 #include "smiapp-pll.h"
2819 #include "smiapp-reg.h"
....@@ -49,6 +40,49 @@
4940 + (clk) / 1000 - 1) / ((clk) / 1000))
5041
5142 #define SMIAPP_COLOUR_COMPONENTS 4
43
+
44
+#define SMIAPP_NAME "smiapp"
45
+
46
+#define SMIAPP_DFL_I2C_ADDR (0x20 >> 1) /* Default I2C Address */
47
+#define SMIAPP_ALT_I2C_ADDR (0x6e >> 1) /* Alternate I2C Address */
48
+
49
+/*
50
+ * Sometimes due to board layout considerations the camera module can be
51
+ * mounted rotated. The typical rotation used is 180 degrees which can be
52
+ * corrected by giving a default H-FLIP and V-FLIP in the sensor readout.
53
+ * FIXME: rotation also changes the bayer pattern.
54
+ */
55
+enum smiapp_module_board_orient {
56
+ SMIAPP_MODULE_BOARD_ORIENT_0 = 0,
57
+ SMIAPP_MODULE_BOARD_ORIENT_180,
58
+};
59
+
60
+struct smiapp_flash_strobe_parms {
61
+ u8 mode;
62
+ u32 strobe_width_high_us;
63
+ u16 strobe_delay;
64
+ u16 stobe_start_point;
65
+ u8 trigger;
66
+};
67
+
68
+struct smiapp_hwconfig {
69
+ /*
70
+ * Change the cci address if i2c_addr_alt is set.
71
+ * Both default and alternate cci addr need to be present
72
+ */
73
+ unsigned short i2c_addr_dfl; /* Default i2c addr */
74
+ unsigned short i2c_addr_alt; /* Alternate i2c addr */
75
+
76
+ uint32_t ext_clk; /* sensor external clk */
77
+
78
+ unsigned int lanes; /* Number of CSI-2 lanes */
79
+ uint32_t csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */
80
+ uint64_t *op_sys_clock;
81
+
82
+ enum smiapp_module_board_orient module_board_orient;
83
+
84
+ struct smiapp_flash_strobe_parms *strobe_setup;
85
+};
5286
5387 #include "smiapp-limits.h"
5488
....@@ -206,7 +240,6 @@
206240
207241 u8 hvflip_inv_mask; /* H/VFLIP inversion due to sensor orientation */
208242 u8 frame_skip;
209
- bool active; /* is the sensor powered on? */
210243 u16 embedded_start; /* embedded data start line */
211244 u16 embedded_end;
212245 u16 image_start; /* image data start line */
....@@ -215,9 +248,6 @@
215248 bool streaming;
216249 bool dev_init_done;
217250 u8 compressed_min_bpp;
218
-
219
- u8 *nvm; /* nvm memory buffer */
220
- unsigned int nvm_size; /* bytes */
221251
222252 struct smiapp_module_info minfo;
223253