MTK camera 闪光灯Flashlight驱动调试流程

分类: MtkDev  |  作者: topicdev 相关  |  发布日期 : 2014-09-26  |  热度 : 153°
 
 

Camera Flash 驱动分析

一、Flash驱动涉及到的文件包含:

mediatek /custom/common/kernel/flashlight/src/kd_flashlightlist.c

mediatek /custom/huaqin_bsp/at808p/base/kernel/flashlight/constant_flashlight/leds_strobe.c

mediatek /platform/mt6592/hardware/mtkcam/core/featureio/drv/strobe/flashlight_drv.cpp

mediatek/platform/mt6592/hardware/mtkcam/core/featureio/pipe/aaa/flash_mgr/flash_mgr.cpp

mediatek/platform/mt6592/hardware/mtkcam/core/featureio/pipe/aaa/flash_mgr/flash_cct.cpp

mediatek/platform/mt6592/hardware/mtkcam/acdk/src/cct/if/cct_feature.cpp

二、Flash驱动代码流程分析:

i.             mediatek /custom/common/kernel/flashlight/src/kd_flashlightlist.c

主要完成设备的注册和初始化。

1.注册一个平台设备:名为"kd_camera_flashlight";

2.注册一个平台驱动,name和我们的devices name同名,这个名字主要用来和HAL层的name做匹配用;

3.对IOCTL的一个填充,供HAL调用;

4.做一个接口主要跟我们实际使用的Flash驱动对接,以kdFlashlightList罗列出来;

ii.             mediatek/custom/huaqin_bsp/at808p/base/kernel/flashlight/constant_flashlight/leds_strobe.c

1.      这个文件就是我们实际性的使用的Flash驱动文件,从

mediatek/config/huaqin92_wet_b2a_tdd/xxx/ProjectConfig.mk文件中CUSTOM_KERNEL_FLASHLIGHT配置获取具体使用的Flash驱动。

如:

CUSTOM_HAL_FLASHLIGHT= constant_flashlight

CUSTOM_KERNEL_FLASHLIGHT = constant_flashlight

2.      该文件和kd_flashlightlist.c文件的对接函数为:

323 MUINT32constantFlashlightInit(PFLASHLIGHT_FUNCTION_STRUCT *pfFunc)

3.      这个文件完成的任务是填充以下几个函数:

  1. 315FLASHLIGHT_FUNCTION_STRUCT constantFlashlightFunc=
  2. 316{
  3. 317     constant_flashlight_open,
  4. 318     constant_flashlight_release,
  5. 319     constant_flashlight_ioctl
  6. 320 };

4.      我们主要分析的是constant_flashlight_ioctl,以为这是跟HAL实际握手的接口。

iii.             mediatek/platform/mt6592/hardware/mtkcam/core/featureio/drv/strobe/flashlight_drv.cpp

这个文件完成的任务比较多,主要是一些类的实现和定义。

  1. 825 intFlashlightDrv::setFlashlightModeConf(unsigned long a_strobeMode)
  2. 897 intFlashlightDrv::setCaptureFlashlightConf(unsigned long a_strobeWidth)
  3. 952 intFlashlightDrv::setCaptureDelay(unsigned int value)
  4. 1021 intFlashlightDrv::getDuty(int* duty)
  5. 1090 intFlashlightDrv::lowPowerDetectEnd(int* isLowPower)

主要是为flash_mgr.cpp提供接口。

iv.             mediatek/platform/mt6592/hardware/mtkcam/core/featureio/pipe/aaa/flash_mgr/flash_mgr.cpp

实现闪光灯模式的设置和获取、拍照/摄像预览的开启和终止、闪光灯设备的打开和关闭等等。

  1. 1479 void FlashMgr::setTorchOnOff(int en)
  2. 2276 intFlashMgr::setFlashMode(int mode)

v.             mediatek/platform/mt6592/hardware/mtkcam/core/featureio/pipe/aaa/flash_mgr/flash_cct.cpp

调用lash_mgr.cpp中的函数来给cct_feature.cpp提供接口。

  1. 128 int FlashMgr::cctFlashEnable(int en)
  2. 129 {
  3. 130    LogInfo("cctFlashEnable(en=%d) line=%d",en,__LINE__);
  4. 131     if(en==1)
  5. 132     {
  6. 133        setFlashMode(FLASHLIGHT_FORCE_ON);
  7. 134     }
  8. 135     else
  9. 136     {
  10. 137        setFlashMode(FLASHLIGHT_FORCE_OFF);
  11. 138     }
  12. 139     return 0;
  13. 140 }

vi.             mediatek/platform/mt6592/hardware/mtkcam/acdk/src/cct/if/cct_feature.cpp

调用flash_cct.cpp中的函数,并以IOCTL的形式进行封装,供更上一层次调用。具体的没有在继续跟下去,有兴趣的话,可以再往上分析分析。

  1. MINT32 CctImp::aaaCCTFeatureControl
  2. 361    case ACDK_CCT_OP_FLASH_ENABLE:
  3. 362        err = FlashMgr::getInstance()->cctFlashEnable(1); //YosenFlash
  4. 363        break;
  5. 364    case ACDK_CCT_OP_FLASH_DISABLE:
  6. 365        err = FlashMgr::getInstance()->cctFlashEnable(0); //YosenFlash

原文:http://www.aiuxian.com/article/p-1646401.html

MTK camera 闪光灯Flashlight驱动调试流程的更多相关文章

  1. LCD之mipi DSI接口驱动调试流程【转】

    转自:http://blog.csdn.net/liwei16611/article/details/68146912 1.LCD MIPI DSI协议 MIPI-DSI是一种应用于显示技术的串行接口 ...

  2. Mtk Camera

    MTK6577+Android之Camera驱动 http://blog.csdn.net/loongembedded/article/details/41695205 MTK Camera 开机启动 ...

  3. MTK Camera驱动移植

    对于MTK Camera驱动移植一般分为四部分: 1.硬件IO口配置: 2.Camera驱动移植: 3.上电时序. 4.改动i2c控制器: 硬件电路: 1.GPIO配置 打开 mediatek\dct ...

  4. 基于GPL329xx linux平台电容屏gsl1680的驱动调试分析

    因客户有用到了gsl1680 7寸电容屏,所以拿了一块过来,便在329xx的平台上面开始调试了. 大概浏览了一下所提供的资料,只有介绍模组的资料跟一份中文版的datasheet,datasheet只是 ...

  5. 【转】android 电容屏(三):驱动调试之驱动程序分析篇

    关键词:android  电容屏 tp 工作队列 中断 坐点计算  电容屏主要参数平台信息:内核:linux2.6/linux3.0系统:android/android4.0  平台:S5PV310( ...

  6. mtk camera 移植步骤

    mtk camera 移植步骤: 1, Kernel层驱动代码文件添加 /mediatek/custom/doov92_wet_tdd/kernel/imgsensor/下添加imx179_mipi_ ...

  7. 驱动调试(三)oops确定函数PC

    目录 驱动调试(三)oops确定函数PC 什么是oops 流程简述 代码仓库 模块例子分析 找到PC值 判断是否属于模块 查看符号表 找到模块 反汇编模块 内核例子分析 找到PC值 判断是否属于模块 ...

  8. debian下使用dynamic printk分析usb转串口驱动执行流程

    看了一篇文章<debug by printing>,文中提到了多种通过printk来调试驱动的方法,其中最有用的就是"Dynamic debugging". “Dyna ...

  9. linux驱动开发流程

    嵌入式linux驱动开发流程嵌入式系统中,操作系统是通过各种驱动程序来驾驭硬件设备的.设备驱动程序是操作系统内核和硬件设备之间的接口,它为应用程序屏蔽了硬件的细节,这样在应用程序看来,硬件设备只是一个 ...

随机推荐

  1. CSS——宠物demo

    注意:ul中自带padding值,需要清除. <!DOCTYPE html> <html lang="en"> <head> <meta ...

  2. HashTable, HashSet, HashMap的区别

    HashTable, HashSet, HashMap的区别     hash是一种很常见也很重要的数据结构,是用hash函数根据键值(key)计算出存储地址,以便直接访问.由完美hash函数(即键值 ...

  3. GNSS数据下载网站

    Bernese 数据表文件下载 rinex文件下载 ftp://nfs.kasi.re.kr DCB.ION文件ftp://ftp.unibe.ch/AIUB/CODE/ 下载5.0更新文件 ftp: ...

  4. (转)postgis常用函数介绍(二)

    http://blog.csdn.net/gisshixisheng/article/details/47903151 概述: 书接上文,本文继续讲解Postgres中常用的空间函数的使用. 常用函数 ...

  5. 安卓设置AttributeSet

    XmlPullParser parser = getResources().getXml(R.layout.textview);    AttributeSet attributes = Xml.as ...

  6. spring IOC bean间关系

    1.0 继承关系 实体 package com.java.test5; import java.util.*; /** * @author nidegui * @create 2019-06-22 1 ...

  7. 删数据ORA-02292主键约束问题

    通常在删除某个表A的时候,会出现这个错误.原因是另一个表B的某个字段引用了A表的某个字段作为约束(这个的另一个说法是外键). 假如引用的字段叫field,当B.field = A.field , 而你 ...

  8. react 子组件给父组件传值

    import React from 'react'import '../page1/header.css'import { Table } from 'antd'import Child from ' ...

  9. vim使用配置-python

    安装vundle git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim 添加配置文件 vim ~/.v ...

  10. 24.通过ngram分词机制实现index-time搜索推荐

    一.ngram和index-time搜索推荐原理     1.什么是ngram     假设有一个单词:quick,在5种长度下的ngram情况如下: ngram length=1,q u i c k ...