• «
  • 1
  • 2
  • 3
  • »
  • Pages: 1/3     Go
主题 : s5pv210摄像头驱动问题 复制链接 | 浏览器收藏 | 打印
级别: 侠客
UID: 16060
精华: 0
发帖: 87
金钱: 435 两
威望: 87 点
综合积分: 174 分
注册时间: 2010-03-13
最后登录: 2018-02-08
楼主  发表于: 2012-07-27 17:38

 s5pv210摄像头驱动问题

版主好,我最近在调试摄像头驱动!基本格式按照s5k4ba的驱动进行修改,硬件直接采用tiny210板子camera接口摄像头200W像素。
但是调试一直有如下错误:
s3c-fimc-0 : fimc_configure_subdev: v4l2 subdev board registering failed
s3c-fimc-0 : fimc_cropcap_capture: No capture device.
s3c-fimc-0 : fimc_s_fmt_vid_capture: No capture device.
如果用板子自带的ov9650则没有问题,跟踪发现在fimc_capture.c中的fimc_configure_subdev函数调用v4l2_i2c_new_subdev_board出错,
进入v4l2_i2c_new_subdev_board函数继续跟踪在该函数中
struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
                struct i2c_adapter *adapter, const char *module_name,
                struct i2c_board_info *info, const unsigned short *probe_addrs)
{
        struct v4l2_subdev *sd = NULL;
        struct i2c_client *client;

        BUG_ON(!v4l2_dev);

        if (module_name)
                request_module(module_name);

        /* Create the i2c client */
        if (info->addr == 0 && probe_addrs)
                client = i2c_new_probed_device(adapter, info, probe_addrs);
        else
                client = i2c_new_device(adapter, info);

        /* Note: by loading the module first we are certain that c->driver
           will be set if the driver was found. If the module was not loaded
           first, then the i2c core tries to delay-load the module for us,
           and then c->driver is still NULL until the module is finally
           loaded. This delay-load mechanism doesn't work if other drivers
           want to use the i2c device, so explicitly loading the module
           is the best alternative. */
        if (client == NULL || client->driver == NULL)
                goto error;
该处出错,经过判断发现 client->driver == NULL为真,从而造成该函数执行失败!
    请教版主这个可能是什么问题造成client->driver为NULL呢?
级别: 侠客
UID: 16060
精华: 0
发帖: 87
金钱: 435 两
威望: 87 点
综合积分: 174 分
注册时间: 2010-03-13
最后登录: 2018-02-08
1楼  发表于: 2012-07-30 10:44
版主 多指点呀!
级别: 侠客
UID: 16060
精华: 0
发帖: 87
金钱: 435 两
威望: 87 点
综合积分: 174 分
注册时间: 2010-03-13
最后登录: 2018-02-08
2楼  发表于: 2012-07-31 16:07
友善的技术支持,你们能不能回复一下呀?
^很多问题的背后都是简单的原因......
级别: 荣誉会员
UID: 34780
精华: 0
发帖: 1219
金钱: 6230 两
威望: 1246 点
综合积分: 2438 分
注册时间: 2010-12-21
最后登录: 2017-09-18
3楼  发表于: 2012-07-31 17:56
用ov9650没有问题说明硬件接口和kernel里摄像头驱动公共部分的代码是正常的
因此,个人认为应该是你的修改存在问题导致,看你提供的信息也没办法判断,建议你将你的修改详细的说明
级别: 侠客
UID: 16060
精华: 0
发帖: 87
金钱: 435 两
威望: 87 点
综合积分: 174 分
注册时间: 2010-03-13
最后登录: 2018-02-08
4楼  发表于: 2012-08-03 09:40
我的修改内容如下:
级别: 侠客
UID: 16060
精华: 0
发帖: 87
金钱: 435 两
威望: 87 点
综合积分: 174 分
注册时间: 2010-03-13
最后登录: 2018-02-08
5楼  发表于: 2012-08-03 09:46
不好意思,前几天不在,现在把我修改的内容贴出来,辛苦版主了,另外硬件上跟友善的板子是一样的

修改mach-mini210.c
填入内容:
#ifdef CONFIG_VIDEO_GT2015
#include <media/GT2015_platform.h>
#define CAM_ITU_CH_A
#endif
...............

static void set_cam2015_main_power(int onoff)
{
        printk("Set cam back state:%s\n",onoff?("on"):("off"));
        return ;
}
...............
#ifdef CONFIG_VIDEO_GT2015
static struct GT2015_platform_data GT2015_plat = {
        .default_width = 1280,
        .default_height = 1024,
        .pixelformat = V4L2_PIX_FMT_YUYV,
        .freq = 40000000,
        .is_mipi = 0,
};
static struct i2c_board_info GT2015_i2c_info = {
        I2C_BOARD_INFO("GT2015", 0x60>>1),
        .platform_data = &GT2015_plat,
};
static struct s3c_platform_camera GT2015 = {
        .id             = CAMERA_PAR_A,

        .type           = CAM_TYPE_ITU,
        .fmt            = ITU_601_YCBCR422_8BIT,
        .order422       = CAM_ORDER422_8BIT_YCBYCR,
        .i2c_busnum     = 0,
        .info           = &GT2015_i2c_info,
        .pixelformat    = V4L2_PIX_FMT_YUYV,
        .srclk_name     = "mout_mpll",
        .clk_name       = "sclk_cam1",
        .clk_rate       = 24000000,             /* 24MHz */
        .line_length    = 1920,              /* 640*480 */
        /* default resol for preview kind of thing */
        .width          = 1280,
        .height         = 1024,
        .window         = {
                .left   = 0,
                .top    = 0,
                .width  = 1280,
                .height = 1024,
        },
        /* Polarity */
        .inv_pclk       = 1,
        .inv_vsync      = 1,
        .inv_href       = 0,
        .inv_hsync      = 0,
        .initialized    = 0,
        .cam_power=set_cam2015_main_power
};
#endif

...........
static struct s3c_platform_fimc fimc_plat_lsi = {
............
#ifdef  CONFIG_VIDEO_GT2015//add by zzmy
                &GT2015,
#endif
...........
}


struct GT2015_platform_data {
        unsigned int default_width;
        unsigned int default_height;
        unsigned int pixelformat;
        int freq;       /* MCLK in KHz */

        /* This SoC supports Parallel & CSI-2 */
        int is_mipi;
};
^很多问题的背后都是简单的原因......
级别: 荣誉会员
UID: 34780
精华: 0
发帖: 1219
金钱: 6230 两
威望: 1246 点
综合积分: 2438 分
注册时间: 2010-12-21
最后登录: 2017-09-18
6楼  发表于: 2012-08-03 10:15
初步看了一下,这一部分似乎是没有问题的
建议你先把
     &GT2015,  
注释掉
然后把
     &GT2015_i2c_info,
加到I2C里面,看看你的GT2015 I2C driver能不能正确的probe
级别: 侠客
UID: 16060
精华: 0
发帖: 87
金钱: 435 两
威望: 87 点
综合积分: 174 分
注册时间: 2010-03-13
最后登录: 2018-02-08
7楼  发表于: 2012-08-03 10:35
谢谢版主,我试试看!
级别: 侠客
UID: 16060
精华: 0
发帖: 87
金钱: 435 两
威望: 87 点
综合积分: 174 分
注册时间: 2010-03-13
最后登录: 2018-02-08
8楼  发表于: 2012-08-03 11:02
按照版主的建议我修改了代码了,测试发现I2c driver可以注册成功,然后用qtopia测试程序测试出现如下错误
s3c-fimc-0 : fimc_streamoff_capture: No capture info.奇怪,为什么用之前的方法不能注册I2c设备呢?
请版主多指点!
^很多问题的背后都是简单的原因......
级别: 荣誉会员
UID: 34780
精华: 0
发帖: 1219
金钱: 6230 两
威望: 1246 点
综合积分: 2438 分
注册时间: 2010-12-21
最后登录: 2017-09-18
9楼  发表于: 2012-08-03 12:28
我说的这种方法主要是为了验证I2C部分是不是正常,是不是能正确的读/写寄存器
如果正常,那么再改回原来的,用qtopia测试程序,看看i2c driver的probe函数有没有调用

另外,我不是版主
  • «
  • 1
  • 2
  • 3
  • »
  • Pages: 1/3     Go