当前位置:   article > 正文

展锐平台的camera sensor驱动代码设计解析(3)_camera sensor identify

camera sensor identify

展锐平台的camera sensor驱动代码设计解析(1)
展锐平台的camera sensor驱动代码设计解析(2)
展锐平台的camera sensor驱动代码设计解析(3)

Camera驱动的基本配置及文件路径说明

  1. 驱动的配置在路径:\device\sprd\platform\board\camera\sensor_config.xml
  2. 驱动代码的路径在:\vendor\sprd\modules\libcamera\sensor\sensor_drv\classic下,里面有各个sensor厂商的驱动,比如Galaxycore,Superpix,Samsung等。

驱动.c文件的配置解析

在打开camera调用库的时候会调用到如下函数

void *sensor_ic_open_lib(void)
{
   
	return &g_ov8856_mipi_raw_info;
}
  • 1
  • 2
  • 3
  • 4
  • 5

对于.c中的函数接口,里面的所有函数都是如下结构体函数指针对应的函数接口

/*==============================================================================
 * Description:
 * all ioctl functoins
 * you can add functions reference SENSOR_IOCTL_FUNC_TAB_T from sensor_drv_u.h
 *
 * add ioctl functions like this:
 * .power = ov8856_power_on,
 *============================================================================*/
static struct sensor_ic_ops s_ov8856_ops_tab = {
   
    .create_handle = ov8856_drv_handle_create,
    .delete_handle = ov8856_drv_handle_delete,
    /*get privage data*/
    .get_data = ov8856_drv_get_private_data,
    /*common interface*/
	.power = ov8856_drv_power_on,
	.identify = ov8856_drv_identify,
	.ex_write_exp = ov8856_drv_write_exposure,
	.write_gain_value = ov8856_drv_write_gain_value,
	
#if defined(CONFIG_DUAL_MODULE)
	.read_aec_info = ov8856_drv_read_aec_info,
#endif

    .ext_ops = {
   
        [SENSOR_IOCTL_BEFORE_SNAPSHOT].ops = ov8856_drv_before_snapshot,
        [SENSOR_IOCTL_STREAM_ON].ops = ov8856_drv_stream_on,
        [SENSOR_IOCTL_STREAM_OFF].ops = ov8856_drv_stream_off,
        /* expand interface,if you want to add your sub cmd ,
         *  you can add it in enum {@SENSOR_IOCTL_VAL_TYPE}
         */
        [SENSOR_IOCTL_ACCESS_VAL].ops = ov8856_drv_access_val,
		[SENSOR_IOCTL_CONTRAST].ops = ov8856_drv_set_saturation,
    }
};
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36

ov8856_drv_handle_create

static cmr_int ov8856_drv_handle_create(struct sensor_ic_drv_init_para *init_param, cmr_handle* sns_ic_drv_handle) 
{
   
    cmr_int ret = SENSOR_SUCCESS;
    struct sensor_ic_drv_cxt * sns_drv_cxt = NULL;
    void *pri_data = NULL;

    ret = sensor_ic_drv_create(
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/酷酷是懒虫/article/detail/1005136
推荐阅读
相关标签
  

闽ICP备14008679号