How to add tvp5150 to board file mach-mini210.c?

Pratik
Hello,

At last I managed to compile tvp5150 driver as module for ANDROID kernel
and can run it :).
My lsmod shows module.

Now I have to add this as a camera interface in mach-mini210.c,

static struct i2c_board_info  tvp5150_i2c_info = {
  I2C_BOARD_INFO("tvp5150", 0xb8>>1),
  .platform_data = &tvp5150_plat,
};

static struct tvp5150_platform_data tvp5150_plat = {
  .default_width = 640,
  .default_height = 480,
  .pixelformat = V4L2_PIX_FMT_YUYV,
  .freq = 14318180,/*On board I have seen 14.31818MHz*/
  .is_mipi = 0,
};

static struct s3c_platform_camera tvp5150 = {
  .id    = CAMERA_PAR_B,
  .type    = CAM_TYPE_ITU,
  .fmt    = ITU_656_YCBCR422_8BIT,
  .order422  = CAM_ORDER422_8BIT_YCBYCR,
  .i2c_busnum  = 1,
  .info    = &tvp5150_i2c_info,
  .pixelformat  = V4L2_PIX_FMT_YUYV,
  .srclk_name  = "mout_mpll",
  .clk_name  = "sclk_cam1",
  .clk_rate  = 14318180,
  .line_length  = 720,
  .width    = 720,
  .height    = 480,
  .window    = {
    .left  = 0,
    .top  = 0,
    .width  = 720,
    .height  = 480,
  },

  /* Polarity */
  .inv_pclk  = 0,
  .inv_vsync  = 1,
  .inv_href  = 0,
  .inv_hsync  = 0,
  .initialized  = 0,
  
};

These things I found on a korean website,
I have added these functions and compiled kernel and inserted module in
kernel, driver was detected properly

[  268.259731] bus: 'i2c': add driver tvp5150

and then I open camera application, It opened but with blank screen.

here is that log:
[  346.031543] device: '1-005c': device_add
[  346.031590] bus: 'i2c': add device 1-005c
[  346.031626] PM: Adding info for i2c:1-005c
[  346.031708] bus: 'i2c': driver_probe_device: matched device 1-005c with
driver tvp5150
[  346.031724] bus: 'i2c': really_probe: probing driver tvp5150 with device
1-005c
[  346.031752] tvp5150 1-005c: chip found @ 0xb8 (s3c2410-i2c)
[  346.031804] driver: '1-005c': driver_bound: bound to device 'tvp5150'
[  346.031815] bus: 'i2c': really_probe: bound device 1-005c to driver
tvp5150



So I come to know that camera is initialized but not properly,

looking for help... 
I hope anybody might have worked with tvp5150 with other friendlyarm
platforms.


Thanks

Pratik
Hi

After some search I found that I have to make some changes 

static struct tvp5150_platform_data tvp5150_plat = {
  .default_width = 720,
  .default_height = 480,
  .pixelformat = V4L2_PIX_FMT_YUYV,
  .freq = 40000000,
  .is_mipi = 0,
};

where I think .freq is frequency of i2c clock, and TVP5150 works on 400Khz.
in code I found following value 

int freq;  /* MCLK in KHz */ 

so little confused with what value shall I use for .freq
400 or 40000000?

Marcio
Hello,

Did you solve your problem?

I'm working with a tvp5150 driver and I'm having some problemns too.

Best regards,