v4l2 capture max9272 deserializer parrallel cam input

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

v4l2 capture max9272 deserializer parrallel cam input

1,702 Views
zoocanon92
Contributor I

Hi, I'm developing the parallel camera on a custom board:  

iMX6Q(TinyRex module) with max9272(deserializer) + max9271(serializer) + ISP + AR0143AT(image sensor)

The deserializer(max9272) parallel output are connected with iMX6Q. 

BSP downloaded from git://git.freescale.com/imx/fsl-arm-yocto-bsp.git , branch imx-4.1-krogoth.

The deserializer is controlled by I2C on #0 bus at 0x48.

# i2cdump -y 0 0x48
No size specified (using byte-data access)
       0  1   2  3   4   5   6   7   8   9   a   b   c   d   e   f    0123456789abcdef
00: 80 90 1f 00 87 29 02 00 00 00 00 00 00 b6 7a 00 ???.?)?......?z.
10: 00 00 00 00 0a 22 30 54 30 c8 0f 5f ff 30 0a 02 ....?"0T0??_.0??
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX

...(skip)...

f0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX

The driver for deserializer is not included in the kernel sources. 

For the deserializer, i wrote a device tree but it's not accurate.

&i2c1 {
   /* Deserializer MAX9272*/
   max9272: max9272@48 {
      status = "okay";
      compatible = "maxim,max9272";
      reg = <0x48>;
      clocks = <&clks IMX6QDL_CLK_DUMMY>;
      clock-names = "csi_mclk";
      pwn-gpios = <&gpio3 10 GPIO_ACTIVE_HIGH>;
      led-gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>;
      csi_id = <0>;
      pinctrl-names = "default";
      pinctrl-0 = <&pinctrl_ipu1_csi0>;
      mclk = <37000000>;
      mclk_source = <0>;
   };
};

I want to capture or preview video with my custom camera, but failed to open /dev/video0, /dev/video1 files. 

# v4l2-ctl --all
ERROR: v4l2 capture: slave not found!
Failed to open /dev/video0: Resource temporarily unavailable

# gst-launch-1.0 imxv4l2src device=/dev/video0 ! imxv4l2sink
ERROR: v4l2 capture: slave not found!
ERROR: v4l2 capture: slave not found!
Can't get caps from capture device, use the default setting.
Perhaps haven't capture device.
====== IMXV4L2SRC: 4.1.6 build on Sep 18 2019 17:40:41. ======
====== IMXV4L2SINK: 4.1.6 build on Sep 18 2019 17:40:41. ======
WARNING: erroneous pipeline: could not link imxv4l2src0 to imxv4l2sink0

The error message "ERROR: v4l2 capture: slave not found!"  came from mxc_v4l2_capture module, (drivers/media/platform/mxc/capture/mxc_v4l2_capture.c) 

below condition returns true so the error occurs. 

cam->sensor == NULL

cam->sensor have to have driver_data, but it seems sensor is NULL. 

Do i need a driver for the deserializer? 

If then, Please give me a link for reference.

If not, how can i capture video with deserializer parallel camera input? 

How do i create a device tree for the deserializer? There are many samples for the image sensor, but not samples for the deserializer.

Thanks, 

das kim

Labels (3)
0 Kudos
6 Replies

1,402 Views
zoocanon92
Contributor I

Any update on this problem? 

As pix.width, pix.height changes, display output also changes, but abnormal display still remains.

Result of 1280x720, pixel format YUVY :

capture(1029).jpg

0 Kudos

1,402 Views
igorpadykov
NXP Employee
NXP Employee

iMX6Q TinyRex module, also max9272, max9271 are not supported by nxp,

for additional help may be recommended to proceed with help of

Commercial Support and Engineering Services | NXP 

Best regards
igor

0 Kudos

1,402 Views
igorpadykov
NXP Employee
NXP Employee

Hi das kim

>The deserializer(max9272) parallel output are connected with iMX6Q.
>Do i need a driver for the deserializer? 

if deserializer requires some initialization, it is necessary to create driver.

Also if parallel camera data used in the case, one can try to reuse ov5642 driver

described in sect.6.1.2 Omnivision Camera attached Linux Manual.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,402 Views
zoocanon92
Contributor I

Thank you for your prompt reply. 

As you said, I created the deserializer(max9272) driver based on the max9286_mipi driver (from NXP community), then the error "ERROR: v4l2 capture: slave not found!" disappeared.

The following is part of the driver code :

static struct sensor_data max9272_data;
...

static int max9272_probe(struct i2c_client *client, const struct i2c_device_id *id)

{   ...
    max9272_data.i2c_client= client;
max9272_data.pix.pixelformat= V4L2_PIX_FMT_UYVY
max9272_data.pix.width=640;
max9272_data.pix.height=480;
    ...
}
and the following is modified device tree :
&i2c1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_i2c1>;
    status = "okay";
     /* Deserializer MAX9272*/
      max9272: max9272@48 {
        status = "okay";
        compatible = "maxim,max9272";
        reg = <0x48>;       
        clocks = <&clks201>;
        clock-names = "csi_mclk";
        mclk = <27000000>;
        mclk_source = <0>;
        csi_id = <0>;
        ipu_id = <1>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_ipu1_csi0>;       
    };
};

Then the output results were as follows : 

capture(1022).jpg

If I wave my hand in front of the lens, the green area and white area moves. That means output parallel data flow well.

Why does it happen? Any idea or suggestions will be welcome.

Thanks.
Das Kim

0 Kudos

1,402 Views
nxf47746
NXP Employee
NXP Employee

The data format is not right, one possible reason is the data bit is reversed.

You could try to reversed the data bit by software.

data[7] data[6] ..... data[0] => data[0] ... data[7]

0 Kudos

1,402 Views
zoocanon92
Contributor I

Thanks, i will try it! 

Can you tell me what I can refer to?

0 Kudos