mx6sl_csi_io_init

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

mx6sl_csi_io_init

1,182 Views
rajkumarmadhani
Contributor I

Hi,

I am working on barcode module. after calling i2c_register_board_info.    mx6sl_csi_io_init is not invoked. how this function is called?

static struct fsl_mxc_camera_platform_data camera_data = {
        .mclk = 24000000,

        .io_init = mx6sl_csi_io_init,
        .pwdn = mx6sl_csi_cam_powerdown,
        .core_regulator = "VGEN2_1V5",
        .analog_regulator = "VGEN6_2V8",
};

static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {

        {

                I2C_BOARD_INFO("se4500", 0x5c),

                .platform_data = (void *)&camera_data,

        },

};


i2c_register_board_info(2, mxc_i2c2_board_info,ARRAY_SIZE(mxc_i2c2_board_info));

In the above code  after i2c register..

How static void mx6sl_csi_io_init(void) is exactly called . my doubt is weather it is called from userspace or from kernel function. if kernel how it is called.



Thank you.

Labels (1)
0 Kudos
Reply
5 Replies

897 Views
PeterChan
NXP Employee
NXP Employee

The mx6sl_csi_io_init() is always called from kernel, by your camera device driver when it is probed on the i2c bus. Taking the camera module ov5640 as an example, the mx6sl_csi_io_init() is called by ov5640_probe(). You can add a dump_stack() call in the mx6sl_csi_io_init() to find out how it is called.

0 Kudos
Reply

896 Views
rajkumarmadhani
Contributor I

Thank you PeterChan,

I got understand after went thru the driver source. thank you

I have one more doubt to understand..in my driver strucures like

static int se4500_s_config(struct v4l2_subdev* pSubdev, void* pPlatform_data)

{

        struct se4500_dev*      pSE4500 = to_se4500(pSubdev);

        printk("%s %s %d\n",__FILE__,__func__,__LINE__);

        if ( pPlatform_data == NULL )

                return(-ENODEV);

        pSE4500->pdata = pPlatform_data;

        return(se4500_dev_init(pSubdev));

}

static const struct v4l2_subdev_tuner_ops se4500_tuner_ops ={

        .s_config               = se4500_s_config,

};

static const struct v4l2_subdev_ops se4500_ops ={

        .core                   = &se4500_core_ops,

        .file                   = &se4500_subdev_file_ops,

        .video                  = &se4500_video_ops,

        .pad                    = &se4500_pad_ops,

        .tuner                  = &se4500_tuner_ops,

};

In probe   v4l2_i2c_subdev_init(&pSE4500->subdev, pClient, &se4500_ops);


How se4500_s_config function  would get called in driver.

This is not getting called in driver. could you please give some suggestion on this.

thank you

0 Kudos
Reply

897 Views
PeterChan
NXP Employee
NXP Employee

I am not an expert to the Linux video driver but I think the s_config will be called in the se4500 driver upon receiving the tuner ioctl command TUNER_SET_CONFIG. More information about the structure v4l2_subdev_tuner_ops can be found at Documentation/video4linux/v4l2-framework.txt.

0 Kudos
Reply

897 Views
rajkumarmadhani
Contributor I

When i call fswebcam the following dump is coming what could be the reason..

root@freescale ~$ ./fswebcam -r 640x480 --save 11.jpeg -d /dev/video1
Unable to handle kernel NULL pointer dereference at virtual address 00000030
--- Opening /dev/video1...
pgd = 9fa18000
[0mTrying source module v4l2...
[00000030] *pgd=9fa77831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT
Modules linked in: se4500_barcode csi_v4l2_capture fsl_csi
CPU: 0    Not tainted  (3.0.35-2666-gbdde708 #66)
PC is at v4l2_int_ioctl_1+0x4/0x64
LR is at csi_v4l_open+0x118/0x164 [csi_v4l2_capture]
pc : [<802dbaac>]    lr : [<7f00520c>]    psr: 60000013
sp : 9f8ffdb0  ip : 9f891024  fp : 000240a8
r10: 9feeff00  r9 : 9fa93c00  r8 : 9f953600
r7 : 9f891008  r6 : 9f953658  r5 : 9f8fe000  r4 : 9f891000
r3 : 9f89102c  r2 : 9f8ffdc4  r1 : 000003ec  r0 : 00000000
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c53c7d  Table: 9fa18059  DAC: 00000015
Process fswebcam (pid: 2093, stack limit = 0x9f8fe2e8)
Stack: (0x9f8ffdb0 to 0x9f900000)
fda0:                                     9f89102c 9f891000 9f8fe000 7f00520c
fdc0: 8bba8ce0 00000000 8bba8ce0 800c4d68 9fa93c00 802136f4 7f008388 800e15e0
fde0: 05100001 00000000 9fff2000 800e1610 05100001 9f953600 7f0050f4 9f953658
fe00: 9feeff00 00000000 00000000 802cf3bc 802cf2e8 9f8fe000 9fa7d068 9feeff00
fe20: 9fa93c00 800e1d80 9f8fe000 00000000 9feeff00 9e24a500 9ffec960 9fa7d068
fe40: 800e1c74 00000000 00000000 800dccd4 9f8ffef8 00000802 9fa7d068 00000026
fe60: 00000000 00000000 00000000 800eaf38 9e049500 8056b6e0 000240a8 9ffce200
fe80: 0000002f 9fa7d068 9f8ffef8 9f8fff78 9f892000 9f8fe000 9f8ffeb4 9f8fe000
fea0: 00000000 800eb4cc 9f8ffec4 80046e58 00000261 9ffec960 9e24a500 9fe60400
fec0: 9fe61400 00000000 9fea7b00 00000001 9f8fff78 9f892000 ffffff9c ffffff9c
fee0: 9f8fe000 00000000 000240a8 800eb890 00000041 00015988 9ffec960 9e24a500
ff00: d9d3cdf0 00000006 9f892005 00000000 9e036200 9fa7d068 00000101 00000004
ff20: 00000000 00000000 80246a5c 00000000 00000000 00000000 9f88e9c0 9f88e9c8
ff40: 00000000 9f8fe000 000240a8 00000803 00000000 00000000 00024288 9f892000
ff60: 00000802 00000003 00000001 800ddc20 00000000 00000000 00000802 00000000
ff80: 00000026 00000100 00000014 00000000 7eda6bcc 00024288 00000005 8003ae84
ffa0: 00000000 8003ad00 00000000 7eda6bcc 000240e8 00000802 ffffffff 000240e8
ffc0: 00000000 7eda6bcc 00024288 00000005 000240e8 0000000c 7eda6bcc 000240a8
ffe0: ffffffbb 7eda6b18 000159c4 2af1a6dc 60000010 000240e8 00000000 00000000
[<802dbaac>] (v4l2_int_ioctl_1+0x4/0x64) from [<7f00520c>] (csi_v4l_open+0x118/0x164 [csi_v4l2_capture])
[<7f00520c>] (csi_v4l_open+0x118/0x164 [csi_v4l2_capture]) from [<802cf3bc>] (v4l2_open+0xd4/0x100)
[<802cf3bc>] (v4l2_open+0xd4/0x100) from [<800e1d80>] (chrdev_open+0x10c/0x1ec)
[<800e1d80>] (chrdev_open+0x10c/0x1ec) from [<800dccd4>] (__dentry_open.isra.19+0x158/0x29c)
[<800dccd4>] (__dentry_open.isra.19+0x158/0x29c) from [<800eaf38>] (do_last.isra.52+0x308/0x684)
[<800eaf38>] (do_last.isra.52+0x308/0x684) from [<800eb4cc>] (path_openat+0xb8/0x3a0)
[<800eb4cc>] (path_openat+0xb8/0x3a0) from [<800eb890>] (do_filp_open+0x2c/0x80)
[<800eb890>] (do_filp_open+0x2c/0x80) from [<800ddc20>] (do_sys_open+0xdc/0x174)
[<800ddc20>] (do_sys_open+0xdc/0x174) from [<8003ad00>] (ret_fast_syscall+0x0/0x30)
Code: e30f0dfd e34f0fff e12fff1e e92d4038 (e590c030)
---[ end trace 7d9813817a43054b ]---
Segmentation fault

0 Kudos
Reply

897 Views
PeterChan
NXP Employee
NXP Employee

Probably your se4500 camera module does not initialize properly and segmentation fault when v4l2_int_ioctl() / vidioc_int_g_ifparm() is called. Please take a close look to the structure "cam->sensor" in csi_v4l_open(). "vidioc_int_g_ifparm" is defined in include/media/v4l2-int-device.h.

0 Kudos
Reply