V4L, iMX6 and TVP5150

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

V4L, iMX6 and TVP5150

2,723 Views
Maddis
Contributor IV

We have custom hw based iMX6 SabreSD with addition that it has TVP5150 connected to CSI0. Now, we've used TVP5150 before on our iMX53 based hw so we are not completely stranger with it.

The problem here is, that I'm using Yocto to build the image and the kernel is way newer than what is being used in our iMX53 based hw and instead of the old style board-init it uses device tree and I think that's where the problems lie. Kernel I'm using is imx_3.10.17_1.0.0_ga (Yocto Dizzy - branch). For some reason localversion is set to -1.0.2_ga.

I've compiled V4L and TVP5150 as a module and when starting the unit this is what I get regarding to V4L and TVP5150.

[    3.523498] tvp5150 0-005d: chip found @ 0xba (21a0000.i2c)

[    3.529086] tvp5150 0-005d: tvp5150am1 detected.

[    3.563568] In MVC:camera_init

[    3.568703] In MVC: init_camera_struct

[    3.578705]    Video device registered: Mxc Camera #0

[    3.947765] In MVC: mxc_v4l_open

[    3.952495]    device name is Mxc Camera

[    3.956442] ERROR: v4l2 capture: slave not found!

And this is where I'm stuck. I'm assuming that this is device tree problem, but not totally sure.

Here are the device tree parts I think are related to this issue and what I've changed.

in customer.dtsi

v4l2_cap_0 {

     compatible = "fsl,imx6q-v4l2-capture";

     ipu_id = <0>;

     csi_id = <0>;

     mclk_source = <0>;

     status = "okay";

};

&i2c1 {

     pinctrl-names = "default";

     pinctrl-0 = <&pinctrl_i2c1_2>;

     status = "okay";

  

     tvp5151_decoder: tvp5150@5d {

          compatible = "ti,tvp5150";

          reg = <0x5d>;

          pinctrl-names = "default";

          pinctrl-0 = <&pinctrl_ipu1_1>;

          clocks = <&clks 201>;

          clock-names = "csi_mclk";

          ipu_id = <0>;

          csi_id = <0>;

          mclk = <24000000>;

          mclk_source = <0>;

          //pwn-gpios = <&gpio1 8 1>;   /* active low: GPIO_8 */

          //rst-gpios = <&gpio1 7 1>;   /* active low: GPIO_7 */

          };

};

I'm guessing that the link between v4l-capture and tvp5150 is missing, but I'm not sure how it should be done.

Anyone else worked with this on new kernel with device tree?

Labels (4)
0 Kudos
5 Replies

1,081 Views
ilyakosharov
Contributor II

Hi!

Yes... did you find solution?

0 Kudos

1,081 Views
Maddis
Contributor IV

Oh, haven't been awhile so missed this.

Yes, I found the solution.

If I remember right the problem was in HW config since not everything was in device tree. And there might have been something else but don't remember that know.

What I do remember is the settings in file:

arch/arm/mach-imx/mach-imx6q.c

Since we have different machine defined than imx6q-sabreauto it never went there. 


@@ -220,7 +220,8 @@
gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
if (!IS_ERR(gpr)) {
if (of_machine_is_compatible("fsl,imx6q-sabresd") ||
- of_machine_is_compatible("fsl,imx6q-sabreauto"))
+ of_machine_is_compatible("fsl,imx6q-sabreauto") ||
+ of_machine_is_compatible("fsl,imx6q"))

And then it seems that I was missing this definition from device tree too:


v4l2_out {
compatible = "fsl,mxc_v4l2_output";
status = "okay";
};

0 Kudos

1,081 Views
john_smith
Contributor II

Hi!

Did you find any solution for this problem?

0 Kudos

1,081 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Maddie,

     It seems that CSI port is still being occupied by default camera in BSP, so you should delete the default camera from linux device tree, then add TVP5150 to device tree.

try it , please !

Regards,

weidong

0 Kudos

1,081 Views
Maddis
Contributor IV

Hi,

Thanks for the answer. I think the main problem here is that I don't know how to add the TVP5150 to device tree the way that it'd register as capture device for IPU. I have added it to device tree so it'll appear as I2C device and that part works. I also couldn't find the default camera from the device tree.

I'll put my device tree files here in case you have time to go through them and see what's the problem.

0 Kudos