nl239f camera sensor driver development攝像頭模塊驅(qū)動(dòng)指南_第1頁(yè)
nl239f camera sensor driver development攝像頭模塊驅(qū)動(dòng)指南_第2頁(yè)
nl239f camera sensor driver development攝像頭模塊驅(qū)動(dòng)指南_第3頁(yè)
nl239f camera sensor driver development攝像頭模塊驅(qū)動(dòng)指南_第4頁(yè)
nl239f camera sensor driver development攝像頭模塊驅(qū)動(dòng)指南_第5頁(yè)
已閱讀5頁(yè),還剩105頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

mm,CameraSensorDriverDevelopmentand頭模塊驅(qū)動(dòng)December6,? ,Inc.and/oritsaffiliatedcompanies.Allrights?2014高通技 , NOPUBLICDISCLOSUREPERMITTED:Pleasereportpostingsofthisonpublicserversorwebsitesto: .公開:如在公共服務(wù)器或上發(fā)現(xiàn)本文檔,請(qǐng)報(bào)告至: Nottobeusedcopiedreproducedormodifiedinwholeorinpartnoritscontentsrevealedinanymannertootherswithouttheexpresswrittenpermission m, 高通技術(shù)明示的允許,不得使用、印 、或修改全部或部分文檔,不得 向他人透露其內(nèi)容RestrictedDistribution:Nottobedistributedtoanyonewhoisnotanemployeeofeither moritssubsidiarieswithouttheexpressapprovalof m'sConfigurationManagement.限制分發(fā): 得發(fā)布給任何非高通或高通子公司員工的人。Theuserofthisationacknowledgesandagreesthatanytextand/ortranslationhereinshallbeforreferencepurposesonlyandthatintheeventofanybetweentheEnglishtextand/orversionandthe and/orversion,theEnglishtextand/orversionshallbecontrolling.本文檔的用戶知悉并同意中文文本和/或翻譯 的,如英文文本和/或版本和中文文本和/或版本之間存在,以英文文本和/或版本為準(zhǔn)。Thiscontains andproprietaryinformationandmustbeshreddedwhendiscarded.高通明示的書面允許,不得使用、復(fù)印、全部或部分文檔,不得以向他人透露其內(nèi)容。本文檔含有高通和專有信息,丟mreservestherighttomakechangestotheproduct(sorinformationcontainedhereinwithoutnoticeNoliabilityisassumedforanydamagesarisingdirectlyorindirectlybytheiruseorapplicationTheinformationprovidedinthisisprovidedonan“asis”basis.高通保留通知即修改本文檔中提及的產(chǎn)品或信息的權(quán)利。本公司對(duì)使用或應(yīng)用本文檔所產(chǎn)misatrademark MIncorporated,registeredintheUnitedStatesandothercountries.MIncororatdtadeaksresedithperisio.therpodutadbandnaesaybetraearksorreisterdtrdearsoftheirrepetiveoners. m是高通公司在及其它國(guó)家的商標(biāo)。所有高通公司的商標(biāo)皆獲得使用。其它產(chǎn)品和品牌名稱可能為其各自所有者的商標(biāo)或商標(biāo)。ThistechnicaldatamaybesubjecttoU.S.andinternationalexport,re-export,ortransfer(“export”)laws.DiversioncontrarytoU.S.andinternationallawisstrictlyprohibited.本文檔及所含技術(shù)資料可能受和國(guó)際出口、再出口或轉(zhuǎn)移出口法律的 m,Inc.5775MorehouseDriveSanDiego,CA92121高通技術(shù),加利福尼亞州亞哥市 路5775號(hào),RevisionAAprInitialBMayUpdated.dtsifileCJul[Englishversion]AddedChapter6andSections2.3.4,and4.2.4.UpdatedSectionsandDNov[Englishversion]UpdatedtitleandSections,.2,5.1,5.2.1,5.2.2,and.AddedSections3.2.2,2.3.2,ChapterEDec[Englishversion]UpdatedforFDec[Englishversion]UpdatedSectionEnglish Pre-Bringup Guidelinesforcamerasensorselectionanddevelopment AccessingPVL Useful SensorDriver ReferencedriversforYUVandBayer Filestobemodifiedtoaddnew Sourcecodeex Kernel Userspace Using UpdatingCCIoperation AFActuator AFactuatordriverdirectory Filesto Updatingadevicetree SettingupAFactuator AddingoptionalGPIOcontrolpinfor Updatingasensordriver AddingAFactuator AddingAFalgorithmtuning LEDFlash LEDFlashdriverdirectory Filestobe Updatingadevicetree ChangingGPIOpinnumberforCCI-based AddinganLEDFlashdriver -basedflash EEPROM EEPROMdriverdirectory Filestobe Updatingadevicetree Updatingasensordriver AddingaEEPROMdriver Updatesfor Userspace Updatesfor NoCCI Reference Sensor Module Module ISP SOFIRQ VFE CAMIFerror CSID DPHY A Related Acronymsand Version 簡(jiǎn) 目 范 約 參 縮寫 2頭傳感器驅(qū) Using AF馬達(dá)驅(qū) 更新devicetree文 調(diào)節(jié)AF算 更新devicetree文 Figure9-1SOFIRQ Figure9-2VFE 表1-1參考文檔和標(biāo) EnglishThisprovidesdriverdevelopmentguidelinesforthecamerasensorandassociatedmodules,anddescribeshowtobringupthecamera.MuchoftheinformationinthisisgenerictotheLinuxcameracodeonallMSM8x26/28,MSM8926/28,MSM8974,MSM8994,MSM8909,MSM8916,MSM8x36/39,andAPQ8084Androidtforms.Chipset-specificdifferencesarecoveredintheirseparatesections.Driverdevelopmentguidelinesandbringupproceduresforothermultimediaaredescribedinseparates:MultimediaDriverDevelopmentandBringupGuide–Audio(80-NU323-MultimediaDriverDevelopmentandBringupGuide–Disy(80-NU323-MultimediaDriverDevelopmentandBringupGuide–(80-NU323-NOTE:Cameradriverdevelopmentandbringupproceduresaredescribedinanidentical,MultimediaDriverDevelopmentandBringupGuide–Camera(80-NU323-2),whichwillsupersedethisinMarch2015.ThecamerasensorframeworkincludestheconfigurationofthefollowingCameraControlInterfaceCameraCameraSensorDriverDevelopmentand Functiondeclarations,functionnames,typedeclarations,attributes,andcodesamplesappearinadifferentfont,forexample,#include.Codevariablesappearinanglebrackets,forexample,<number>.Commandstobeenteredappearinadifferentfont,e.g.,copya:*.*b:.Ifyouareviewingthis usingacolormonitor,orifyouprintthis toacolorprinter,redboldfaceindicatescodethatistobeadded,andbluestrikethroughindicatescodethatistoberecedorremoved.Forassistanceorclarificationoninformationinthis,submitacaseto ,Inc.(QTI)at/.IfyoudonothaveaccesstotheCDMATechSupportwebsite,registerforaccessorsendto Pre-BringupThischapterprovidesusefulinformationonhowtosearchexistingPVLdriverandunderstandtheimpactofnon-PVLcomponentselectionontheoverallcameraschedule.It’s thatthereadersofthisreviewthisinformationbeforeproceedingwithcamerabring-GuidelinesforcamerasensorselectionanddevelopmentTounderstandtheguidelinesforcameraselectionandthedevelopmenttime/resourceinvestmentbasedonit,seeSolution[ ForguidelinesonhowtoaccessPVL(PreferredVendorList)drivers,see mCreatepointHardwareComponentQuickStartGuide(English)(80-NC193-10)or mCreatepointHardwareComponentQuickStartGuide()(80-NC193-10SC).UsetheseguidelinestofindthelistofavailablePVLcameradriversforaspecificchipset,anddownloadoneormoreUsefulReviewimportantslistedundersection“Sensorbringup”ofSolution[ ],andstartsensorbring-up.Ifissuesareencounteredduringtheprocess,QTICustomerEngineeringcanhelpviaaSales case.Forguidanceoncorrectproblemareaidentification,seeSolution SensorDriverThischapterprovidesinformationnecessarytobringupcamerasensorhardwareontheAndroidtform.ThecodesamplesinthischapterarebasedonanMSM8916device.NOTE:Unlessspecifiedotherwise,allinformationappliestoBayerReferencedriversforYUVandBayerThissectionshowsthelistofreferencedriversforbothBayerandYUVsensorsforUserspacedriversarelocatedin$(MM_CAMERA_DIR)/mm-camera2/media-controller/YUVreferenceUserspacedriversarelocatedin$(MM_CAMERA_DIR)/mm-camera2/media-controller/FilestobemodifiedtoaddnewThissectionliststhefilesthatmustbemodifiedtowriteanewsensorThedevicetreesourcefileis<target>_camera*.dtsiinkernel/arch /,e.g.,msm8916-camera-sensor-mtp.dtsi.Customersshouldusecameraslotsasshownhere:qcom,camera@0cell-index=<0>;compatible="qcom,camera";..} mon/config/device-vendor.mk,makeentryofthenewlibrariesinthefiletoincludeinthebuild.In$(MM_CAMERA_DIR)/mm-camera2/media-NOTE:Thekernelnodesaregeneric.ThereisnoneedtochangethemiftheQTIschematicsareNOTE:Achangeinthisfilemustbemadebasedonthecustomer’shardwareTheuserspacesensordriveris<sensor>_lib.c/handAndroid.mkin$(MM_CAMERA_DIR)/mm-camera2/media-controller/modules/sensors/sensor_libs/,e.g.,imx135_lib.c/h.Inadditiontothedriverfile,Android.mkmustbemodified(refertothereferenceNOTE:Fora64-bitprocessor,usethearm64directoryinsteadofYUVThedevicetreesourcefileis<target>_camera*.dtsiinkernel/arch /,e.g.,msm8916-camera-sensor-mtp.dtsi.Customersshouldaddanewentryinthe.dtsifileasshownqcom,camera@78compatible=.. Theuserspacesensordriveris<sensor>_lib.candAndroid.mkin$(MM_CAMERA_DIR)/mm-camera2/media-controller/modules/sensors/sensor_libs/,e.g.,sp1628_lib.c.Inadditiontothedriverfile,Android.mkmustbemodified(refertothereferenceThekernelsensordriveris<sensor>.candMakefileinkernel/drivers/media/tform/msm/Also,theCONFIG_<sensor>flagmustbeaddedin<target>_defconfiglocatedin mon/config/device-vendor.mk,makeentryofthenewlibrariesinthefiletoincludeinthebuild.NOTE:Achangeinthisfilemustbemadebasedonthecustomer’shardwareNOTE:Fora64-bitprocessor,usethearm64directoryinsteadofAsshownintheaboveexample,fortheBayersensortheconceptofcameraslots(0/1/2)isintroduced,whereasintheYUVsensoranewentrymustbeadedindtsi.NOTE:BeginwithreferencefileswhenwritinganewSourcecodeexKernelThissectionprovidesinformationnecessaryforcreatingthekernelGPIOAsshownbelow,thecustomercanconfiguresensor-specificGPIOsbasedonthetargetboard.Forexnationsoneachproperty,referto sinthefollowinglocation: GPIOcanbeconfiguredoneoftwoways,basedonthesoftwarebeingUsingForthechipsetsusingpinctrlframework(e.g.,MSM8909,MSM8916,MSM8936,MSM8939,MSM8994,etc.),pinctrlnodeentriesin.dtsicanbeusedtoconfigureGPIOs,e.g.:pinctrl-names="cam_default",pinctrl-0=<&cam_sensor_mclk0_default&cam_sensor_rear_default>;pinctrl-1=<&cam_sensor_mclk0_sleep&cam_sensor_rear_sleep>;Thephandlespointingatapinconfigurationnode,listedunderpinctrl-XXentriesabovearedefinedinmsmXXXX-pinctrl.dtsi.ForMSM8916,itwouldbeat UsingGPIOForchipsetsnotusingpinctrlframework(e.g.,MSM8x26/28,MSM8926/28,MSM8974,MSM8084,etc.),GPIOnodeentriesin.dtsicanbeusedtoconfigureGPIOs,e.g.:gpios=<&msm_gpio26<&msm_gpio35<&msm_gpio34qcom,gpio-reset=qcom,gpio-standby=qcom,gpio-req-tbl-num=<01qcom,gpio-req-tbl-flags=<100>;qcom,gpio-req-tbl-label="CAMIF_MCLK",ForchipsetshavingaCCIhardwareblock,therearededicatedGPIOsfordataandclock.BecausetheseGPIOsarededicatedtotheCCImaster,thecustomermustusethesesettingsifCCIisusedforcameraI2C.Forexample,thefollowingpinctrlorGPIOcontrol-basedexamplesshowdedicatedGPIOpins29and30forCCI.Usingpinctrl-names="cci_default","cci_suspend";pinctrl-0=<&cci0_default>;pinctrl-1=Thephandlespointingatapinconfigurationnode,listedunderpinctrl-XXentriesabovearedefinedinmsmXXXX-pinctrl.dtsi.ForMSM8916,itwouldbeat UsingGPIOgpios=<&msm_gpio29<&msm_gpio30qcom,gpio-tbl-num=<0qcom,gpio-tbl-flags=<11>;qcom,gpio-tbl-label="CCI_I2C_DATA0",CCIhastwoindependentmasters(0and1,available).Inmostusescases,usingoneCCImasterisenough.However,incertaincasestwoCCImasterscanbeused.Forexample,ifthefrontandrearcamerashappentohavethesameI2Cslaveaddress,connectingeachcameratoadifferentCCImasterwithindependentphysicalGPIOpinsforCCImasterscanresolvethe ingI2Cslaveaddressproblem.qcom,cci-master=Inthe.dtsfile,foreachsensornode,thecustomercanconfigureclocksourceasclocks=<&clock_gccclock-names="cam_src_clk","cam_clk";Theorderingofthelistsinthetwopropertiesisimportant.Thenthclock-namewillcorrespondtothenthentryintheclock’sproperty.Thus,intheDTsnippetsabove,cam_src_clkwouldcorrespondtoclk_mclk0_clk_src,cam_clkwouldcorrespondtoclk_gcc_camss_mclk0_clk,etc.Thecustomerdoesnotneedtochangethis,asitisparsedintheclockNOTE:ForMSM8916,itis mendedthatsensordriversettingsbeconfiguredfor23.88MHzMCLKinput.Althoughdriverswrittenwith24MHzMCLKinputassumptiongenerallywillnothavefunctionalityissues,somemightshowbandingartifactswithlightsourcesoperatingatvariablefrequencylike50Hz.PowerPMICcam_vdig-supply=<&pm8916_s4>;cam_vana-supply=<&pm8916_l17>;cam_vio-supply=<&pm8916_l6>;cam_vaf-supply=<&pm8916_l10>;GPIOgpios=<&msm_gpio27<&msm_gpio28<&msm_gpio33<&msm_gpio114<&msm_gpio110qcom,gpio-reset=qcom,gpio-standby=qcom,gpio-vdig=qcom,gpio-vana=qcom,gpio-req-tbl-num=<0123qcom,gpio-req-tbl-flags=<10000>;qcom,gpio-req-tbl-label="CAMIF_MCLK",CAM_VANA–Supplyvoltage(CAM_VDIG–Supplyvoltage(digital)CAM_VAF–Supplyvoltage(actuatorvoltage)CAM_VIO–Input/outputvoltageI2CslaveconfigurationYUVsensorInthe.dtsiqcom,camera@78compatible="ovti,ov5645";reg=<0x780x0>;qcom,slave-id=<0x780x300aThisisan8-bitaddresswhere7MSBareI2Cslaveaddressand1LSBiswriteflagNOTE:ForBayer,seeSectionUserspaceThissectionprovidesinformationnecessaryforcreatingtheuserspaceSensorinitThesensorinitparametersincludethemodessupported(2D/3D)andtheposition(FRONT/BACK)ofthecamerainthedeviceandthemountangle.Ifthemountangleisspecifiedas360,thenthedriverwillpickupthemountanglespecifiedinthekerneldtsi.staticstructmsm_sensor_init_paramssensor_init_params=.modes_supported=.position=.sensor_mount_angle=SensoroutputThesensoroutparameterincludestheoutputformat,whichspecifieswhetherthesensorisBayerorYUV.Theconnectionmodespecifiesinterfacebetweenthesensorandreceiver(MIPIorparallel).Theoutputsizeisspecifiedintheraw_output.staticsensor_output_tsensor_output=.output_format=.connection_mode=.raw_output=BayerslaveTheSensorslaveconfigurationinformationmustprovidethefollowingstaticstructmsm_camera_sensor_slave_infosensor_slave_info=/*Cameraslotwherethiscameraismounted.camera_id=/*sensorslaveaddress.slave_addr=/*sensoraddresstype.addr_type=/*sensorid.sensor_id_info=/*sensoridregisteraddress.sensor_id_reg_addr=/*sensorid.sensor_id=/*powerup/downsetting.power_setting_array=.power_setting=.size=..Thisisan8-bitaddresswhere7MSBareI2Cslaveaddressand1LSBiswriteflagNOTE:ForYUV,seeSectionSensorchip-TheSensormodelID/chipIDregistermustbeidentifiedfromthedatasheetandenteredinthe.sensor_id_info=/*sensoridregisteraddress.sensor_id_reg_addr=/*sensorid.sensor_id=Power-up/-downSensorpowersequenceisaddedinanarrayusingthemsm_sensor_power_settingstructureineachuserspacesensordriver.staticstructmsm_sensor_power_settingpower_setting[]=..}Bothpower-upandpower-downsequencescanbeaddedinthemsm_sensor_power_setting_arraystructure.Ifapower_down_setting/size_downmemberisnotaddedasshownbelow,thepower-downsequencewillbethereverseofthepower-up.power_setting_array=.power_setting=.size=Thispower_settingwillpointtoanarraythathasinformationonGPIO/CLK/VREGtobeusedtoconfigureeachsensor.staticstructmsm_sensor_power_settingpower_setting[]={.seq_type=.seq_val=.config_val=.delay=0,//thisdelayisin{.seq_type=.seq_val=.config_val=.delay=0,//thisdelayisin..Thisstructurewillbeusedinmsm_camera_power_up()inthekerneltoconfigurethesensorforthepower-upsequence.RefertoenumsinForYUVcameradriver,msm_sensor_power_settingshouldbemadeinthekerneldriverinsteadoftheuserspacedriver.Formoredetails,refertooneofYUVreferencedriverslistedinSection3.1.Dependingonthecustomerhardwaredesign,thepowersourcecanbeprovidedbyPMICorthroughGPIOsasshownbelowinthe.dtsifile.DimensionsAdimensiontableisaddedusingthesensor_lib_out_info_tstructureasshowninthisstaticstructsensor_lib_out_info_tsensor_out_info[]={/*fullsize@24.x_output=.y_output=.line_length_pclk=.frame_length_lines=.vt_pixel_clk .op_pixel_clk .binning_factor=.max_fps=.min_fps=.mode=x_output–Activey_output–Activeline_length_pclk–Widthincludingframe_length_lines–Heightincludingvt_pixel_clk(timingclkvalue)–Virtualclockvalueusedforcalculatingshuttertime,andusedbyAECforcorrectingbandingartifactsvt_pixel_clk=line_length_pclk*frame_length_lines*frameop_pixel_clk–RepresentshowmuchdatacomesoutofthecameraoverMIPIlanestosettheVFEclockop_pixel_clk=(totaldataratefromsensor)/bits-per-Forexample,iftheMIPIDDRclockvalue(speedoftheclocklaneoftheMIPIcamerasensor)is300MHz,andthesensortransmitson4lanes,eachlanehasa600MHzdatarate.Thus,thetotaldatarateis2400MHz.For10bitsperpixelBayerdata,thistranslatestotheop_pixel_clkvalueof2400/10=240MHz.Thesevaluesmustbefilledinaccordancewiththesensorspecifications.ThesevaluescanbecalculatedbasedontheregistersettingsconfiguredforthecameraChromatixTheChromatixparametersmustbeupdatedforeachresolutionwiththeproperheader.Chromatixheadergenerationisdiscussedin[Q4].staticstructsensor_lib_chromatix_timx135_chromatix[]={.common_chromatix=.camera_preview_chromatix=IMX135_LOAD_CHROMATIX(snapshot),/*RES0.camera_snapshot_chromatix=IMX135_LOAD_CHROMATIX(snapshot),/*RES0.camcorder_chromatix=IMX135_LOAD_CHROMATIX(default_),/*RES0.liveshot_chromatix=IMX135_LOAD_CHROMATIX(liveshot),/*RES0}SensorregisterTheregisteraddressfieldsfortheexposureandoutputdimensionmustbefilledwiththepropervaluesbasedonthesensordatasheet.Exposureregisterstaticstructmsm_sensor_exp_gain_info_texp_gain_info=.coarse_int_time_addr=.global_gain_addr=.vert_offset=vert_offset–Theintegrationlinecountshouldalwaysbelessthanframe_length_linesbythismarginwhenweconfiguretothemax.NOTE:Refertothedatasheettogetthisoffset(marginforcoarseintegrationOutputregisterRegisteraddressesforsensorcutout(x_outputandy_output),frame_length_lines,andline_length_pclkmustbeconfiguredbasedontheregisterspecsinthecamerasensordatasheet.staticstructmsm_sensor_output_reg_addr_toutput_reg_addr=.x_output=.y_output=.line_length_pclk=.frame_length_lines=MIPIreceiverThesensorstreamstheimagingdataintheMIPICSI2protocol.TheQTIreceiverreceivesitviaMIPICSIPHYandCSID.CSI-PHYThisstructureshowsCSIlanestaticstructcsi_lane_params_tcsi_lane_params=.csi_lane_assign=.csi_lane_mask=.csi_if=.csid_core={0.csi_phy_sel=staticstructmsm_camera_csi2_paramsimx135_csi_params=.csid_params=t=.lut_params=.num_cid=.vc_cfg{.csiphy_params=t=t=.combo_mode=1,//Presentonrecentcsi_lane_assign–SometimescustomerhardwaremaybedesignedwithdifferentpinmapcomparedtotheMSM?chipset’sreferencepinmapforcameradatalanes,e.g.,sensordatalane0maybeconnectedtoMSMdatalane4.Thecsi_lane_assignparametercanbeconfiguredtoaddresssuchcases.Thisisa16-bitvalue,withthemeaningofeachbitfieldpresentedasfollows:MSMsidePHYlanenumber,wheresensor'sdatalane3isMSMsidePHYlanenumber,wheresensor'sdatalane2isMSMsidePHYlanenumber,wheresensor'sdatalane1isMSMsidePHYlanenumber,wheresensor'sdatalane0is Lane1isfortheclock.Customersshouldnotusethislaneformapanydatacsi_lane_mask–This8-bitfieldindicateswhichMIPIlanesarevalidandenabled.WhenasinglecameraisconnectedonthecomboPHY,thevaluewouldbeinterpretedas:Bit4Isdatalane30–1–3Isdatalane20–1–2Isdatalane10–1–1Isclocklane0–1–Note:Thisshouldalwaysbesetto0Isdatalane00–1–Forexample,value0x1Findicatesthatthecamerahas4validdatalanesandaclockWhentwocamerasareconnected(Cam0:2lanescameraconnectedtolanes2:0;Cam1:1lanecameraconnectedonlanes4:3),thevaluewouldbeinterpretedBit4Isdatalane1ofCam10–1–3IsclocklaneofCam10–1–Note:Whencameraispresent,thisshouldalwaysbesetto1.2Isdatalane1ofCam00–1–1IsclocklaneofCam00–1–Note:Whencameraispresent,thisshouldalwaysbesetto1.0Isdatalane0ofCam00–1–csi_if–Notcsid_core–AnindexoftheCSIDhardwareusedbythesensor;twosensorsoperatingconcurrentlycannotusethesamevalueforthissetting.csi_phy_sel–AnindexoftheCSI-PHYcoreusedbythesensor;shouldbeuniqueforeachsensor,unlessanexternalMIPIbridgeconnectstwosensorstothesamePHYinterfaceontheMSM.Thisvalueshouldbeconfiguredbasedonthecustomer’shardwareschematicdiagram. t–Thenumberofdatalanesonwhichthesensoroutputsdataforagivenmodeofoperation;thisvalueisdeterminedbythesensor’s umdatalanescapability(giveninthedatasheet)alongwithsensorregistersettingsconfiguredinthebo_mode–Value0indicatesthatonecameraisconnectedtothegivenPHYinterface.Value1indicatesthattwocamerasaresharingthisPHYinterface,inwhichcase:Firstcamera–ThisisconnectedtoPHYlanes2:0.ClocklaneisconnectedtoPHY1.Datalanes(upto2)canbeconnectedtoeitherofPHYlanes0orSecondcamera–ThisisconnectedtoPHYlanes4:3.ClocklaneisconnectedtoPHYlane3.DatalanecanbeconnectedtoPHYlane4. t–Thisvaluemustbeconfigured,basedonthesensor’soutputcharacteristics,toensurethesensor’sPHYtransmitterdoesnothavesyncissueswiththeMSM’sPHYMIN[Settlecount*T(Timerclock)]>MAX[Settlecount*T(Timerclock)]<T(HS-PREPARE)+T(HS_ZERO)-4*T(Timerclock)Also,thecustomercanspecifythesettingsforeachoperationmodeseparayasshowninthefollowingexample:staticstructmsm_camera_csi2_params*csi_params[]=0123456VFEclockrateOperatingfrequencyoftheclklaneofcamerasensor(akaMIPIDDRclk)andnumberofactivedatalanesdeterminetotaldatarate(throughput)fromcamerasensorforagivenmodeofoperation.DatarateperlaneisdoublethespeedofMIPIDDRclk.Forexample,camerasensoroperatingatMIPIDDRclkof200MHzand4activedatalaneswouldhavetotaldatarateof1600Mbps(200*2=400Mbpsdararateperlane).Dataratevariesbasedonresolutionofeachframe,extra/dummypixels/lines,HVblanking,MIPIpacketoverhead,bitsperpixel,dataformat,whethertherearemultipledatastreamsinterleavedwithinanddatarate/overheadcharacteristicsofeachstream,etc.Forinitialcamerabringupinagivenmodeofoperation,calculate:X=Framewidth*(Frameheight*Vblank)*bitsperpixel*framespersecond*(overheadfromMIPIprotocolandotherstreams)FindtheclosestvalueinVFEclknforthegivenMSMthatishigherthanXandusethatastheinitialvalueforVFEclk.staticstructmsm_camera_csid_vc_cfgimx135_cid_cfg[]={0,CSI_RAW10,CSI_DECODE_10BIT{1,0x35,CSI_DECODE_8BIT{2,CSI_EMBED_DATA,ThefirstentryforeachrowaboveiscalledCID(ChannelID).EachuniquecombinationofVirtualChannel(VC)andDataType(DT)shouldmaptoauniqueCIDvalue.PossibleCIDvaluesforagivenVCare:0–0,1,2,1–4,5,6,2–8,9,10,3–12,13,14,Intheimx135_cid_cfgexampleabove,allthreestreamswithdatatypesCSI_RAW10,0x35,CSI_EMBED_DATAaresentbythecamerasensorinVC0.Thus,theCIDvaluesarewithintherange0to3.RegisterThecamerasensorregistersareconfiguredforthestreamingviaI2C.Thesensorcanalsobeconfiguredforotherspecificoperationsasdescribedinthissection.InitPerformaone-timeregisterconfigatcamerastaticstructmsm_camera_i2c_reg_settinginit_reg_setting[]=..}GroupholdonTheruntimeupdatesforexposuresettingsareassignedtomanyregisters(coarseintegrationtime,framelengthlines,gain)andtheymustbechangedwithinoneframeperiodoftheimage.Theseregistersaredoublebufferedtypeandhavethe“groupedparameterhold”functiontobehavetobeupdatedatonce.Whenthe“groupedparameterhold”registerissetto1,thetransmitteddataareheldinthebufferregisters.staticstructmsm_camera_i2c_reg_settinggroupon_settings=..}GroupholdoffWhenthe“groupedparameterhold”registerissetto0,theexposureregistervaluesareupdatedasiftheyaretransmittedatthesametimeandrealizeasmoothtransitionofparameterchangesattheframeboundary.staticstructmsm_camera_i2c_reg_settinggroupoff_settings=..}ResolutionThesensorcanbeoperatedinmultiplemodes,e.g.,PreviewwithquarterresolutionandSnapshotwithfullresolution.Thedifferentresolutionscanbeconfiguredasshownbelow.staticstructmsm_camera_i2c_reg_settingres0_settings[]=..}staticstructmsm_camera_i2c_reg_settingres1_settings[]=..}ExposureFortheAECalgorithm,realgainisused.Forsensorhardwarerealgainmustbeconvertedtoregistergaininordertoconfigurethesensor.Thecustomermustimplementthefollowingfunctionsforthatpurpose,basedonthesensordatasheet.Refertotheoganddigitalgainsettingsectioninthesensordatasheet.ThisfunctioncalculatesthenextexposureconfigurationforbothexposuretimeandThisfunctionpreparesthenextexposureconfigureNOTE:RefertoreferenceStartstreamingAMIPIdatapacketisboundedbyStartofTransmission(SoT)andEndofTransmissionSoT–EoT–Inthesensordriver,thefollowingsettingsshouldbeconfiguredtomatchthisguideline.TaketheclockanddatalanesfromLP11toHSTxstate:staticstructmsm_camera_i2c_reg_arraystart_reg_array[]={0x0100,0x01StopstreamingThestopstreamingsettingsshouldputclockanddatalanesofthesensorintheLP11state.NotngthiscorrectlycancauseaninconsistencyinMIPIcamerasyncwiththeMSM.staticstructmsm_camera_i2c_reg_arraystop_reg_array[]={0x0100,0x00UsingFortheBLSPconfiguration,see[Q2].AlthoughthisisnotspecificallyforMSM8916,thesameconceptisapplicable.Forchipsetsthatdon’thaveCCIhardware,QUPisusedtoperformI2Ctransactionswithcamera.NOTE:CustomersneedingtoconfigureQUP/SPIonchipsetwithCCIhardwaremustcontactUpdatingCCIoperationFollowingI2Cspecification,CCI(forchipsetswhereitispresent)canoperatebetween100and400kHzandiscontrolledbyaparameternamedi2c_freq_modewithinthestructuremsm_camera_sensor_slave_info.RefertotheIMX135sensorsensordriverfileimx135/imx135_lib.cforanexample.staticstructmsm_camera_sensor_slave_infosensor_slave_info=../*sensori2c.i2c_freq_mode=..TheavailableI2Cfrequencymodesaredefinedinkernel/include/media/msm_cam_sensor.h:standard(100kHz),fast(400kHz),andCustommode.enumForCustommode,inthecaseofMSM8916,theCCItuningparameterssettinginformationcanbefoundinkernel/arch {qcom,hw-thighqcom,hw-tlow=qcom,hw-tsu-sto=qcom,hw-tsu-sta=qcom,hw-thd-dat=qcom,hw-thd-sta=qcom,hw-tbuf=qcom,hw-scl-stretch-en=qcom,hw-trdhld=qcom,hw-tsp=<3>;status="ok";IfacustomCCIconfigurationisusedthenthespeedofI2Cfrequencyinformationcanbecalculatedbytheformula:CCIclock=(srcclock)/(hw_thigh+BecausetheCCIclockfrequencyistypically19.2MHz,forthestandardCCIfrequencycase,itCCIclock=19.2MHz

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論