MLK-16692-1: csi: Identify which camera really connect to interface
authorGuoniu.Zhou <guoniu.zhou@nxp.com>
Tue, 31 Oct 2017 01:57:25 +0000 (09:57 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
There maybe 0-4 cameras can connected to interface at
the same time. Add this ioctl to identify which camera
really connect to the interface.

Reviewed-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 785fbbd10c8a484b7f70488234c3a03e9aee9992)

drivers/media/platform/imx8/max9286.c

index 5610436..c45077d 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/regulator/consumer.h>
 #include <media/v4l2-subdev.h>
 
+#include "max9286.h"
+
 #define MAX9271_MAX_SENSOR_NUM 4
 #define CAMERA_USES_15HZ
 
 static unsigned int g_max9286_width = 1280;
 static unsigned int g_max9286_height = 800;
 
-#define MIPI_CSI2_SENS_VC0_PAD_SOURCE  0
-#define MIPI_CSI2_SENS_VC1_PAD_SOURCE  1
-#define MIPI_CSI2_SENS_VC2_PAD_SOURCE  2
-#define MIPI_CSI2_SENS_VC3_PAD_SOURCE  3
-#define MIPI_CSI2_SENS_VCX_PADS_NUM            4
-
-/*!
- * Maintains the information on the current state of the sesor.
- */
-struct imxdpu_videomode {
-       char name[64];          /* may not be needed */
-
-       uint32_t pixelclock;    /* Hz */
-
-       /* htotal (pixels) = hlen + hfp + hsync + hbp */
-       uint32_t hlen;
-       uint32_t hfp;
-       uint32_t hbp;
-       uint32_t hsync;
-
-       /* field0 - vtotal (lines) = vlen + vfp + vsync + vbp */
-       uint32_t vlen;
-       uint32_t vfp;
-       uint32_t vbp;
-       uint32_t vsync;
-
-       /* field1  */
-       uint32_t vlen1;
-       uint32_t vfp1;
-       uint32_t vbp1;
-       uint32_t vsync1;
-
-       uint32_t flags;
-
-       uint32_t format;
-       uint32_t dest_format; /*buffer format for capture*/
-
-       int16_t clip_top;
-       int16_t clip_left;
-       uint16_t clip_width;
-       uint16_t clip_height;
-
-};
-struct sensor_data {
-       struct v4l2_subdev      subdev;
-       struct media_pad pads[MIPI_CSI2_SENS_VCX_PADS_NUM];
-       struct i2c_client *i2c_client;
-       struct v4l2_mbus_framefmt format;
-       struct v4l2_captureparm streamcap;
-       char running;
-
-       /* control settings */
-       int brightness;
-       int hue;
-       int contrast;
-       int saturation;
-       int red;
-       int green;
-       int blue;
-       int ae_mode;
-
-       u32 mclk;
-       u8 mclk_source;
-       struct clk *sensor_clk;
-       int v_channel;
-       bool is_mipi;
-       struct imxdpu_videomode cap_mode;
-
-       unsigned int sensor_num;       /* sensor num connect max9271 */
-       unsigned char sensor_is_there; /* Bit 0~3 for 4 cameras, 0b1= is there; 0b0 = is not there */
-};
-
 #ifdef CONFIG_SENSOR_OV10635
 #define OV10635_REG_PID                0x300A
 #define OV10635_REG_VER                0x300B