I have used a board of dm365 and DVSDK 4.0.2 package on linux 2.6.32 with a soc camera of mt9m111. Some modifications have been made for board_dm365_evm.c for adding mt9m111 device info.
But when the system boots up into mt9m111_probe() in mt9m111.c, the booting is crashed for no soc_camera_device data in client->dev.platform_data which should be filled in vpfe_capture.c ( I think so ). In i2c_core.c, it is simply give the value of the board_info.platform_data that is set in board_dm365_evm.c.
Looking up the vpfe_capture.c in detailed, I find it has no code to support soc camera. do I miss some thing ?
does any body have success in using mt9m111 with dm365 ?
any help appreciated.
Hi,
What all changes have you made to the board file can you attach it.
Can you also attach the log of what crash are you getting.
Thx,
--Prabhakar Lad
hi Lad,
here is board-dm365-evm.c and booting message.
http://www.headcall.com/xx/mt9m111-error.tar.gz
I have config of mt9m111 info as
static struct v4l2_input mt9m111_inputs[] = { { .index = 0, .name = "Camera", .type = V4L2_INPUT_TYPE_CAMERA, //.std = V4L2_STD_MT9M111_STD_ALL, }};
static struct vpfe_subdev_info vpfe_sub_devs[] = { { .module_name = "mt9m111", .is_camera = 1, .grp_id = VPFE_SUBDEV_MT9M111, .num_inputs = ARRAY_SIZE(mt9m111_inputs), .inputs = mt9m111_inputs, .ccdc_if_params = { //.if_type = VPFE_RAW_BAYER, .if_type = VPFE_YCBCR_SYNC_8, .hdpol = VPFE_PINPOL_POSITIVE, .vdpol = VPFE_PINPOL_POSITIVE, }, .board_info = { I2C_BOARD_INFO("mt9m111", 0x5d), /* this is for PCLK rising edge */ .platform_data = (void *)1, }, },}
the booting process is broken in mt9m111.c
static int mt9m111_probe(struct i2c_client *client, const struct i2c_device_id *did){ struct mt9m111 *mt9m111; struct soc_camera_device *icd = client->dev.platform_data; struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); struct soc_camera_link *icl; int ret;
if (!icd) { dev_err(&client->dev, "MT9M11x: missing soc-camera data!\n"); return -EINVAL; }
/* the booting process is broken here, * for icd = ( void* ) 1 , which is from board_dm365_evm.c */ printk( "\n\n\nNext, crash +++++++for icd=%p\n\n\n", icd ); icl = to_soc_camera_link(icd); printk( "\n\n\nNo chance getting here++++++\n\n\n" );
if (!icl) { dev_err(&client->dev, "MT9M11x driver needs platform data\n"); return -EINVAL; }
.....
}
If I remove all codes related to icd & icl in the funcs of mt9m111_probe( ), mt9m111_video_probe( ) the booting is OK. but I get all zero in captured image.
Hi Yang,
The modifications looks ok. Which Kernel version are you using?
Does mt9m111 sensor has a i2c switch as mt9p031 has PCA9543A, have look at it.
And also the tvp514x and the mt9m111 sensor has same i2c address because of which only of it
can be registered and this is handled by module parameter vpfe_capture.interface if set to 1
sensor gets registered and if set to 0 tvp514x/tvp7002 get registered. And also looking at this function
you need to dm365evm_setup_video_input() you need to add entry for your subdev.
I am referring to 2.6.37 kernel here.
Did you add the driver code for mt9m111 there is already a driver
for mt9m111 in opensource why are you changing it ?
I have not used PCA9543A to control mt9m111, so I have remove all related codes.In the bootargs, I set interface=1 and dm365evm_setup_video_input() is also properly set, otherwise mt9m111 driver should not be selected.
I have not changed mt9m111.c except printing the error message in the broken place.
the problem is here, in mt9m111.c
the icd should point to a struct soc_camera_device as it was assigned at the beginning ,
struct soc_camera_device *icd = client->dev.platform_data;
when I remove all codes about icd & icl, that's OK for i2c checking and finally registered successful.
does the 2.6.37 change some for mt9m111 ? I will try it. is it included in DVSDK 4.0.3 ?or other place ?
Can you post what changes have you done in dm365evm_setup_video_input() function.
Yes I can find the mt9m111 source in 2.6.37 kernel, No idea about the DVSDK.
Probably yes some has changes it.
Are you also using 2.6.37 Kernel?
you shouldn't use .platformdata=(void*)1; instead you should pass a real value to it. something like this:
struct soc_camera_link mt9m111_link={.bus_id=0,.flags=0,...}.platformdata=&mt9m111_link;
can you post a sample
mt9m111_link structure , am integrating mt9m112 to ginger bread ,
Kind regards,
Dibin