文件警告本僅向三星電子株式會(huì)社人員提供其內(nèi)容含有商業(yè)保護(hù)_第1頁(yè)
文件警告本僅向三星電子株式會(huì)社人員提供其內(nèi)容含有商業(yè)保護(hù)_第2頁(yè)
文件警告本僅向三星電子株式會(huì)社人員提供其內(nèi)容含有商業(yè)保護(hù)_第3頁(yè)
文件警告本僅向三星電子株式會(huì)社人員提供其內(nèi)容含有商業(yè)保護(hù)_第4頁(yè)
文件警告本僅向三星電子株式會(huì)社人員提供其內(nèi)容含有商業(yè)保護(hù)_第5頁(yè)
已閱讀5頁(yè),還剩40頁(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)介

ImportantSamsungElectronicsCo.Ltd.(“Samsung”)reservestherighttomakechangestotheinformationinthispublicationatanytimewithoutImportantSamsungElectronicsCo.Ltd.(“Samsung”)reservestherighttomakechangestotheinformationinthispublicationatanytimewithoutpriornotice.Allinformationprovidedisforreferencepurposeonly.Samsungassumesnoresponsibilityforpossibleerrorsoromissions,orforanyconsequencesresultingfromtheuseoftheinformationcontainedherein.anyinformationprovidedinthispublication.CustomershallindemnifyandholdSamsunganditsofficers,employees,subsidiaries,affiliates,anddistributorsharmlessagainstallclaims,costs,damages,expenses,andreasonableattorneyfeesarisingoutof,eitherdirectlyorindirectly,anyclaim(includingbutnotlimitedtopersonalinjuryordeath)thatmaybeassociatedwithsuchunintended,unauthorizedand/orillegaluse.Thispublicationonitsowndoesnotconveyanylicense,eitherexpressorimplied,relatingtoanySamsungand/orthird-partyproducts,undertheintellectualpropertyrightsofSamsungand/oranythirdparties.WARNINGNopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmittedinanyformorbyanymeans,electricormechanical,byphotocopying,recording,orotherwise,withoutthepriorwrittenconsentofSamsung.Thispublicationisintendedforusebydesignatedrecipientsonly.Thispublicationcontainsconfidentialinformation(includingtradesecrets)ofSamsungprotectedbyCompetitionLaw,TradeSecretsProtectionActandotherrelatedlaws,andthereforemaynotbe,inpartorinwhole,directlyorindirectlypublicized,distributed,photocopiedorSamsungmakesnowarranty,representation,orguaranteeregardingthesuitabilityofitsproductsforanyparticularpurpose,nordoesSamsungassumeanyliabilityarisingoutoftheapplicationoruseofanyproductorcircuitandspecificallydisclaimsanyandallliability,includingwithoutlimitationanyconsequentialorincidentaldamages.used(includinginapostingontheInternetCustomersareresponsiblefortheirownproductsSAMSUNGunspecifiedaccessispossible)byanyunauthorizedapplications."Typical"parameterscananddovaryparty.Samsungreservesitsrighttotakeanyandmeasuresbothinequityandlawavailabletoitandclaim"Typicals"mustbevalidatedforeachcustomerdamagesagainstanypartythatmisappropriatesbythectm'stptJeff_cuiattrt/riilifration.Samsungproductsarenotdesigned,intended,orauthorizedforuseinapplicationsintendedtosupportorsustainlife,orforanyotherapplicationinwhichthefailureoftheSamsung警 本文件僅向經(jīng)韓國(guó)三星電子株式會(huì)社授權(quán)的人員提供productcouldreasonablybeexpectedtocreateasituationwherepersonalinjuryordeathmayoccur.CustomersacknowledgeandagreethattheyaresolelyresponsibletomeetallotherlegalandregulatoryrequirementsregardingtheirapplicationsusingSamsungproductsnotwithstandingCopyright?2011SamsungElectronicsCo.,SamsungElectronicsCo.,San#24Nongseo-Dong,Giheung-GuContactUs:HomePage:Allbrandnames,Allbrandnames,trademarksandregisteredtrademarksbelongtotheirrespectiveExynos,Exynos4212,FlexOneNAND,andOneNANDaretrademarksofSamsungARM,Jazelle,TrustZone,andThumbareregisteredtrademarksofARMLimited.Cortex,ETM,ETB,Coresight,ISA,andNeonaretrademarksofARMLimited.JavaisatrademarkofSunMicrosystems,SDisaregisteredtrademarkofToshibaMMCandeMMCaretrademarksofMultiMediaCardAssociation.JTAGisaregisteredtrademarkofJTAGTechnologies,Inc.SynopsysisaregisteredtrademarkofSynopsys,Inc.I2SisatrademarkofPhillipsElectronics.I2CisatrademarkofPhillipsSemiconductorMIPIandSlimbusareregisteredtrademarksoftheMobileIndustryProcessorInterface(MIPI)AllothertrademarksusedinthispublicationarethepropertyoftheirrespectiveSAMSUNGsi-plaza/Jeff_cuiatChipHandlingPrecautionagainstElectrostaticWhenhandlingsemiconductordevices,ChipHandlingPrecautionagainstElectrostaticWhenhandlingsemiconductordevices,besurethattheenvironmentisprotectedagainststaticOperatorsshouldwearanti-staticclothinganduseearthAllobjectsthatcomeindirectcontactwithdevicesshouldbemadeofmaterialsthatdonotproducestaticelectricitythatwouldcausedamage.EquipmentandworktablemustbeIonizerisrecommendedtoremoveelectronBesuretousesemiconductorproductsintheenvironmentthatmaynotbeexposedtodustordirtSemiconductordevicesaresensitivetoenvironmenttemperatureandhumidity.Hightemperatureorhumiditymaydeterioratesemiconductordevice’scharacteristics.Thereforeavoidstorageoruseinsuchconditions.kSUNGCareshoudrtt/ycvilkrccrdevice.DonotexposesemiconductordevicetochemicalbecausereactiontochemicalmaycausedeteriorationofdeviceLightIncaseofnon-EMC(EpoxyMoldingCompound)package,donotexposesemiconductorICtostronglight.Itmaycausedevice’smalfunction.(But,somespecialproductswhichutilizethelightorhavesecurityfunctionareexceptedfromthisguide)Semiconductordevicescanbeinfluencedbyradioactive,cosmicrayorX-ray.Radioactive,cosmicandX-raymaycausesofterrorduringdeviceoperation.Thereforesemiconductordevicesmustbeshieldedunderenvironmentthatmaybeexposedtoradioactive,cosmicrayorX-ray.Notethatsemiconductordevice’scharacteristicsmaybeaffectedbystrongelectromagneticwaveormagneticfieldduringoperationunderinsufficientPCBcircuitdesignforEMS.SAMSUNGsi-plaza/Jeff_cuiSAMSUNGsi-plaza/Jeff_cuiatRevisionNov.25,SOCCSETableof OperationTableof Operation H/W TC4Audio Audio I2SMultiAudio DeviceConnectionsofTC4Audio ConnectionofExynosand I2CInterface I2SInterface S/W Audio AudioHardware AudioDevice SAMSUNG4 4.1Kernel si-plaza/f_at15:49,2012.0KernelSetupand 4.1.2I2S 4.2Android DRIVER AudioDeviceDriverof Platform CPU Platform CODEC AudioHardwareInterfaceof PathsofAudio ControlforInternalPathsof Step1:GPIOMappingforI2CBustoControlthe Step2:CODECDeviceIDConfigurationforI2C Step3:GPIOMappingforI2SBustoHandleAudio Step4:PlatformDeviceStructureConfigurationforI2SBus Step5:ConfigurationforI2SBusOperation Step5-1:ConfigurationforI2SBusMaster Step5-2:ConfigurationforI2SBusSlave Step6:ConfigurationforCODEC 6.76.7Step7:ConfigurationfortheInternalPathsof SAMSUNGsi-plaza/Jeff_cuiatListofFigureListofFigureFigureFigureFigureFigureFigureFigureFigureFigureFigureFigureFigureFigureFigureFigureFigureTC4Audio AudioDataFlowof I2SMultiAudioInterfaceBlock ClockandDataFlowinI2Sfor I2CConnectionofCODECSideSchematic I2CConnectionofExynosSideSchematic I2SConnectionofCODECSideSchematic I2SConnectionofExynosSideSchematic AndroidAudioSystemS/W I2SDriver KernelAudioSystemS/WBlock TwoClockSourcesforCODEC BLCandBFSontheAudioSerialFormatof ExampleDiagramofI2SClockPathsand TypicalUsageofI2SBusMaster Figure KernelConfigurationforI2SBusMaster SAMSUNGFigure TypicalUsageofI2SBusSlave Figure KernelConfigurationforI2SBusSlave Figure AudioSystemS/WBlock tfdW4.ListofListofTableTableTableTableTableTableTableTableTableTable SupportedAudio ListofPinstobeUsedtoConnectExynosand AudioSystemDriverFile ListofPinstobeUsedby ListofPinstobeUsedby I2SRelated I2SClockRelated RootClockTable AudioHardwareInterfaceFilesforCODECPath SAMSUNGsi-plaza/Jeff_cuiatListofListofExampleExampleExampleExampleExampleExampleExampleExampleExampleExampleExampleExampleExampleExampleExampleExampleTC4KernelSetupand DefaultConfigurationforAndroidAudio GENERICAUDIO GPIOConfigurationforI2CChannel SlaveDeviceIDConfigurationfor GPIOConfigurationforI2SChannel PlatformDeviceDeclarationforI2SChannel ClockValueCalculation RFSandRCLKConfigurationSource CODECOperationClockDefinitionandUsageforI2SBusSlave BasicDMAParameter SAMSUNGsi-plaza/Jeff_cuiatExample ListofRegisterRWAccessTypeRegisterValueSAMSUNGResetVleoListofRegisterRWAccessTypeRegisterValueSAMSUNGResetVleona/Jeff_cuiat Somebitsofcontrolregistersaredrivenbyhardwareorwriteoperationonly.Asaresulttheindicatedresetvalueandthereadvalueafterresetmightbedifferent.0Clearstheregister1SetstheregisterxDon'tcarexXUndefinedmultiple?Undefined,butdependsonthedeviceorpinDeviceThevaluedependsonthePinThevaluedependsonthepinRReadTheapplicationhaspermissiontoreadtheRegisterfield.Writestoread-onlyfieldshavenoeffect.WWriteTheapplicationhaspermissiontowriteintheRegisterRead&TheapplicationhaspermissiontoreadandwritesintheRegisterfield.Theapplicationsetsthisfieldbywriting1’b1andclearsitbywriting1’b0.ListofSAMSUNGsi-plaza/Jeff_cuiatInternalListofSAMSUNGsi-plaza/Jeff_cuiatInternalGeneralLPLowPowerAdvancedLinuxSoundDeviceSamsungTC4AudioSystem_DriverDeveloper's11.1ThisdocumentdescribeshowtoapplytheSamsungTC4AudioSystem_DriverDeveloper's11.1ThisdocumentdescribeshowtoapplytheaudiodriverofAndroid2.3BSPbasedontheTC4referenceboardandisintendedforthedeveloperswhohaveexperienceddevelopmentofLinuxkernelandAndroid.1.2DocumentThemainpurposeofthisdocumentistoguideontheapplicationofTC4audiosystemTherefore,itneedstounderstandtheaudio-relatedhardwareandsoftwareontheLinuxkerneldriverandAndroidplatformofTC4.ThisdocumentdescribessomehardwareIPslikeAudioSubsystemandI2S,softwareaudio-relatedlayersofAndroidandaudiodriverofLinuxkernelforTC4.UNGBlocksforaudioofExynos:audiosubsystem,I2S,PrtilfT4board:oiSoftwareAndroid:audioflingerandLinuxkernel:ALSAandaudiodeviceConfigurationforTC4Android2.3DefaultaudioconfigurationforLinuxkernelandDriverAudiodriver:Machine,CPU,PlatformandCODECdriversinLinuxHAL:AudioHardwareInterfaceinSamsungTC4AudioSystem_DriverDeveloper's1.3OperationTable TableSamsungTC4AudioSystem_DriverDeveloper's1.3OperationTable TableSAMSUNGsi-plaza/Jeff_cuiatMainStereoStereoMainMonoMonoHeadPhoneTC4ReferenceBoardforLinuxKernel2.6.35,Android2.3.4BootU-Boot:SamsungTC4AudioSystem_DriverDeveloper's2H/WSamsungTC4AudioSystem_DriverDeveloper's2H/W2.1TC4AudioTheaudiointerfaceofExynossupportsI2S,AC97,PCMandSPDIF.ItallowstheaudiosystemtotransferdatabetweenDRAMandaudioHWusingeachDMAchannel.TheaudiosystemofTC4usesI2SinterfacewithWM8994audiocodecandI2CtocontrolthecodecasshownFigureFigureTC4AudioSAMSUNGsi-plaza/Jeff_cuiatSamsungTC4AudioSystem_DriverDeveloper's2.2SamsungTC4AudioSystem_DriverDeveloper's2.2AudioTheaudiosubsystem(AudioSS)isaspecialsubsystemthatsupportsaudioplaybackbasedonlowpowerconsumption.ItconsistsofaSamsungReconfigurableProcessor(SRP),I2S,andsoon.TC4usesonlyI2SinsteadSRPintheaudioTheaudiodataflowofTC4usingaudiosubsystemisshowninFigureSAMSUNGFigure AudioDataFlowofsi-plaza/Jeff_cuiatSamsungTC4AudioSystem_DriverDeveloper's2.3I2SSamsungTC4AudioSystem_DriverDeveloper's2.3I2SMultiAudioInter-ICSound(I2S)isoneofthedigitalaudiointerfaces.TheI2Sbushandlesaudiodataandtheothersignals,namely,sub-codingandcontrol,aretransferredseparately.ItispossibletotransmitdatabetweentwoI2Sbus.Tominimizethenumberofpinsrequiredandtokeepwiringsimple,basically,a3-lineserialbusisused.Thisconsistsofalinefortwotime-multiplexeddatachannels,awordselectlineandaclockline.I2Sinterfacetransmitsorreceivessounddatafrom/toexternalstereoaudiocodec.Totransmitandreceivedata,32bits64FIFOsforeachchannelareincludedandDMAtransfermodetotransmitandreceivesamplescanbesupported.I2S-specificclockcanbesuppliedfrominternalsystemclockcontrollerthroughIISclockdividerordirectclocksource.FigureI2SMultiAudioInterfaceBlockI2SSDCLKOandI2SSDCLKIareclocklinesforoperatingtheCODEC.TheyaremuxedatGPIOblock,andthereisonlyoneexternalpin,XI2S0CDCLK.I2Sinterfaceconsistsofregisterbank,FIFOs,shiftregisters,clockcontrol,DMAfinitestatemachine,andchannelcontrolblockasshowninFigure3.NotethateachFIFOhas32-bitwidthand64depthstructure,whichcontainsleft/rightchanneldata.Thus,FIFOaccessanddatatransferarehandledwithleft/rightpairunit.SAMSUNGsi-plaza/Jeff_cuiatSamsungTC4AudioSystem_DriverDeveloper'sSamsungTC4AudioSystem_DriverDeveloper'sTC4supportsstereoaudiooutputandmonoinputasshowninTable2.And,TC4'sdefaultoperationmodeisExynos-I2SmastermodethatI2SbusinterfacetransmitsI2SLRCLKandI2SSCLKtoI2SaudioCODEC.Figure4showstheflowofclockandaudiodatainI2SforTC4.FigureClockandDataFlowinI2SforSAMSUNGsi-plaza/Jeff_cuiatSamsungTC4AudioSystem_DriverDeveloper'sDeviceConnectionsofTC4AudioConnectionofExynosandI2CinterfaceisusedtohandletheaudioCODEC,andI2SSamsungTC4AudioSystem_DriverDeveloper'sDeviceConnectionsofTC4AudioConnectionofExynosandI2CinterfaceisusedtohandletheaudioCODEC,andI2SinterfaceisusedtotransferdatabetweenExynosandTC4usesI2Cchannel4andI2Schannel0ofExynostoconnecttoaudioTable ListofPinstobeUsedtoConnectExynosand2.4.2I2CInterfaceSAMSUNGTC4usesI2Cchannel4ofExynostohandletheaudioCODEC,Thus,twolines,SDAandSCL,ofI2Cchannel4areconnectedtoSDAandSCLKofCODECsi-plaza/Jeff_cuiatFigureI2CConnectionofCODECSideSchematicExynosFigureI2CConnectionofExynosSideSchematicSerialdataSerialclockSerialbitclocklineforClocklineforCODECClocklineforleft/rightdataDatalinetotransferdatafromCODECforaudioDatalinetotransferdatatoCODECforaudioSamsungTC4AudioSystem_DriverDeveloper's2.4.3I2SInterfaceTC4usesI2Schannel0,I2SMultiAudioSamsungTC4AudioSystem_DriverDeveloper's2.4.3I2SInterfaceTC4usesI2Schannel0,I2SMultiAudioInterface,ofExynostohandleaudiodataandtheothersignals,namely,sub-codingandcontrol,aretransferredseparatelyfrom/totheaudioCODEC,WM8994.I2Schannel0ofExynossupportsupto5.1channelsound,butTC4supports2channel,stereo,sound.So,onlyonelineisneededfordataAudiosystemofTC4usesfivelinesofI2SMultiAudiointerface:SCLK,LRCLK,CDCLK,SDIandTC4'sbasicmodeisExynos-I2SmastermodethatI2SbusinterfacetransmitsI2SLRCLKandI2SSCLKtoI2SaudioCODEC.Inaddition,theCDCLKlineisusedtotransmittheclockforCODECoperationtoI2SaudioCODECFigureI2SConnectionofCODECSideSchematicExynosFigureI2SConnectionofExynosSideSchematicSAMSUNGsi-plaza/Jeff_cuiatSamsungTC4AudioSystem_DriverDeveloper's3S/WSamsungTC4AudioSystem_DriverDeveloper's3S/WThesoftwarestructureforaudiosystemofAndroidsystemisshowninFigureFigureAndroidAudioSystemS/WSAMSUNGsi-plaza/Jeff_cuiatSamsungTC4AudioSystem_DriverDeveloper's3.1AudioSamsungTC4AudioSystem_DriverDeveloper's3.1AudioAudioflingerisonecomponentofaudiosystemofAndroid,andaccessestheaudiodriverofkernelspacethroughtheaudiohardwareinterfacenamely,audioHAL.MixesthemultipleaudioTransferthefinalPCMdatatotheaudiohardware3.2AudioHardwareAudiohardwareinterfaceisanabstractionlayerwhichhelpstheaudioflingertoaccessALSAItsupportsconfigurationforaudiohardwareoperationsuchasaudioformat,numberofchannel,samplerateandbuffersize.3.3AudioDeviceAudiodevicedriverhandlesthephysicaldeviceslikeaudiosubsystemandI2SfortransmitthePCMdataSAMSUNGALSAdriverandaudioInaddition,audiodevicedriverconsistsoffourparts:theMachine,CPU,PlatformandCODECsi-plaza/Jeff_cuiatSamsungTC4AudioSystem_DriverDeveloper's44.1SamsungTC4AudioSystem_DriverDeveloper's44.1KernelThischapterdescribestheconfigurationofLinuxkernelforTC4audio4.1.1KernelSetupand"makeTC4_android_defconfig"enablesthekernelsetupforTC4Android,anduse"makemenuconfig"fordetailedconfiguration.ExampleTC4KernelSetupandSAMSUNGsi-plaza/Jeff_cuiatandroid-kernel-samsung-dev$makemenuconfigSamsungTC4AudioSystem_DriverDeveloper's4.1.2I2SSamsungTC4AudioSystem_DriverDeveloper's4.1.2I2SThischapterdescribesthekernelconfigurationforI2SofTC4audiosystem.InitialscreenofkernelconfigurationisshowninFigure10:si-plaza/Fgfcnit-gSelect"DeviceDriversSoundcardsupportAdvancedLinuxSoundArchitectureALSAforSoCaudiosupportSoCI2SAudiosupportforWM8994onSMDK".FigureI2SDriverSAMSUNGSamsungTC4AudioSystem_DriverDeveloper's4.2AndroidThisSamsungTC4AudioSystem_DriverDeveloper's4.2AndroidThischapterdescribestheconfigurationofAndroidplatformforTC4audiosystem.TheconfigurationfileisBoardConfig.mkindevice/sec/smdkc210directory.ChecktheaudioconfigurationsattheBoardConfig.mkfilesandthedefaultconfigurationisshowninExampleExampleTouseaudiosystemofTC4,"BOARD_USES_GENERIC_AUDIO"variablehastobe"false"asshowninExampleExampleGENERICAUDIOSAMSUNGsi-plaza/Jeff_cuiatBOARD_USES_GENERIC_AUDIO:=BOARD_USES_GENERIC_AUDIO:=BOARD_USES_ALSA_AUDIO:=falseBUILD_WITH_ALSA_UTILS:=falseBOARD_USES_CIRCULAR_BUF_AUDIO:=falseSamsungTC4AudioSystem_DriverDeveloper's5ThischapterdescribeshowtoapplytheaudiosystemofAndroid2.3SamsungTC4AudioSystem_DriverDeveloper's5ThischapterdescribeshowtoapplytheaudiosystemofAndroid2.3BSPbasedontheTC4reference5.1AudioDeviceDriverofAudiodevicedriverhandlesthephysicaldeviceslikeaudiosubsystemandI2SfortransmitthePCMdatabetweenALSAdriverandaudioCODEC.Audiodevicedriverconsistsoffourparts:theMachine,CPU,PlatformandCODECFigureKernelAudioSystemS/WBlockTheaudiosystemsoftwareblockisseparatedasshowninFigure12.Anapplicationrequesttodosomethingwiththeaudiosystem,itinterfaceswiththeaudiohardwareinterfacetocontrolALSAstacknamely,ALSAdriverlibrary.WhenaudiodatacomesfromALSAinterface,ASoCdriverwillcontroleachspecificdriver(Machine,CPUandPlatformdriver)withgeneralALSAstack.Andthen,eachdriverscontrolitshardware.Table4isthefiledeploymentofaudiosystemTableAudioSystemDriverFilePlatformMachineCPUPlatformCODECSAMSUNGsi-plaza/Jeff_cuiatSamsungTC4AudioSystem_DriverDeveloper's5.1.1PlatformI2CTableListofPinstobeUsedbySamsungTC4AudioSystem_DriverDeveloper's5.1.1PlatformI2CTableListofPinstobeUsedbyDevice:I2CchannelFile:setup-i2c4.cDescribestheGPIOconfigurationforI2Cchannelsetup-i2cX(X:channelnumber).cfileshouldbeconfiguredincaseoftheotherchannelofI2CisSourceExampleGPIOConfigurationforI2CChannelFile:mach-si-plaza/Jeffcuiat549,2012082oDescribestheslavedeviceIDforWM8994toallowbitrationofmultipleslavesonsameoThedeviceIDofWM8994is34h,anditisshownonthedatasheetofIftheCODECisdifferentfromWM8994,thisfileshouldbeconfiguredwiththecorrectdeviceIDofSourceExampleSlaveDeviceIDConfigurationforIfamasterofI2Cinitiatesastartcondition,itshouldsendaslaveaddresstonotifytheslavedevice.Onebyteofaddressfieldconsistsofa7-bitaddressanda1-bittransferdirectionindicatorthatshowswriteorread.Thus,wemustmakethedeviceIDofCODEC7-bitsforinsertingthedirectionindicatorthroughshifting1bittorightforremovingtheLSBofCODECdeviceID.Ex)0x34>>1#ifdef/*I2C4staticstructi2c_board_infoi2c_devs4[]initdata=#ifdefined(CONFIG_SND_SOC_WM8994)||{I2C_BOARD_INFO("wm8994",.platform_data=voids3c_i2c4_cfg_gpio(structplatform_device{s3c_gpio_cfgpin(S5PV310_GPB(0),S3C_GPIO_SFN(3));s3c_gpio_cfgpin(S5PV310_GPB(1),S3C_GPIO_SFN(3)); s3c_gpio_setpull(S5PV310_GPB(1),SamsungTC4AudioSystem_DriverDeveloper'sI2STableListofPinstobeUsedbyDevice:SamsungTC4AudioSystem_DriverDeveloper'sI2STableListofPinstobeUsedbyDevice:I2SchannelFile:dev-audio.cooDescribestheplatformdeviceandGPIOconfigurationforI2SchannelThissectiondescribesonly"case-1"(whichisthemeaningofchannel0),so"caseX(X:channelnumber)"statementshouldbeconfiguredincaseofotherchannelofI2Sisused.And,itneedstodeclares5pv310_device_iisX(X:channelnumber)platform_devicestructurenewlywithcorrectresourcestructureandregisteritatthesmdkc210_devicesarrayinmach-smdkc210.cfile.SourceoExampleGPIOConfigurationforI2SChannelExamplePlatformDeviceDeclarationforI2SChannelstructplatform_devices5pv310_device_iis0=.name="s3c64xx-iis-.id=-.num_resources=.resource=.dev=.platform_data=cnsstaee {/*configureGPIOfori2sportswitch(pdev->id).plaza/Jeff_cuiatcase-s3c_gpio_cfgpin(S5PV310_GPZ(0),S3C_GPIO_SFN(2));s3c_gpio_cfgpin(S5PV310_GPZ(1),S3C_GPIO_SFN(2));s3c_gpio_cfgpin(S5PV310_GPZ(2),S3C_GPIO_SFN(2));s3c_gpio_cfgpin(S5PV310_GPZ(3),S3C_GPIO_SFN(2));s3c_gpio_cfgpin(S5PV310_GPZ(4),...}return}SamsungTC4AudioSystem_DriverDeveloper's5.1.2MachineThemachinedriverindicatesakindofinterfacewhichlinksI2SbetweenCODECandExynos,andalsolinkstheplatformDAI(DigitalAudioInterface)whichisusingDMA.Inaddition,italsohassomefunctionstodecidetheclockfrequencyrelatedSamsungTC4AudioSystem_DriverDeveloper's5.1.2MachineThemachinedriverindicatesakindofinterfacewhichlinksI2SbetweenCODECandExynos,andalsolinkstheplatformDAI(DigitalAudioInterface)whichisusingDMA.Inaddition,italsohassomefunctionstodecidetheclockfrequencyrelatedtoI2SbusinterfaceandtoconfiguretheoperationmodesuchasI2SbusmasterorslaveTherearephysically-selectabletwoclocksourcesforCODECoperationonTC4:XI2SCDCLK0andXCLKOUT.IfI2Sbusmastermodeisenabledinkernelconfiguration,themachinedriverusesXI2SCDCLK0asCODECoperationclock,whereasXCLKOUTisusedbymachinedriverwhenI2Sbusslavemodeisenabled.FigureTwoClockSourcesforCODECSAMSUNGBothofXI2SCDCLK0andXCLKOUTcanbeusedatTheNORMALpowermodeofIncaseofTC4,thesourceclockofXI2SCDCLK0isaPLLofExynos,andtheclockofXI2SCDCLK0isgeneratedwhenthepowermodeofExynosisSLEEPbecausePLLsofExynosareturnedoffatSLEEPsi-plaza/Jeff_cuiat15:49,2012.08.2Ontheotherhand,themachinedriverusesXTIassouisgeneratedthoughthepowermodeofExynosisSLEEP.rceclockofXCLKOUT,thustheclockofTherefore,XCLKOUTisusefulforthecaseswhichneedCODECoperationatallpowermodesofExynossuchasascenariowhichsupportvoicecallwithMODEMandaudioplayatSLEEPpowermode.Inaddition,externaloscillatorcanbeusedforCODECoperationinsteadofXCLKOUT.SamsungTC4AudioSystem_DriverDeveloper'sTheFundamentalsofMachineDriverforI2SAmainfunctionoftheMachinedriveristodecidetheclockfrequencyforeachoperationmodeofI2Sbusinterface.Thus,itneedstodescribethebasicI2S-relatedclockspriortodealwithoperationmodes.WhenI2Sbusinterfacecontrolleroperatesasmaster,I2SbusinterfacecontrollergeneratesI2SLRCLKandI2SSCLKthatistherootclockisdividedusingRFSandBFSvalue.Todecidethesamplingfrequency(I2SLRCLK),BLC,BFS,andRFSareselectedfirstly.Optionally,I2SbusinterfacecontrollerclocksouttherootclockasI2SCDCLKforCODECoperationifthesourceofrootclockisnotI2SEXTCDCLK.InSamsungTC4AudioSystem_DriverDeveloper'sTheFundamentalsofMachineDriverforI2SAmainfunctionoftheMachinedriveristodecidetheclockfrequencyforeachoperationmodeofI2Sbusinterface.Thus,itneedstodescribethebasicI2S-relatedclockspriortodealwithoperationmodes.WhenI2Sbusinterfacecontrolleroperatesasmaster,I2SbusinterfacecontrollergeneratesI2SLRCLKandI2SSCLKthatistherootclockisdividedusingRFSandBFSvalue.Todecidethesamplingfrequency(I2SLRCLK),BLC,BFS,andRFSareselectedfirstly.Optionally,I2SbusinterfacecontrollerclocksouttherootclockasI2SCDCLKforCODECoperationifthesourceofrootclockisnotI2SEXTCDCLK.Incaseoftheslavemode,thevaluesofBLC,BFSandRFSaresetassimilartomaster(CODEC).BecauseI2Sbusinterfacecontrollerneedsthesevaluesforcorrectoperation.SomeclocksrelatedtoI2SareshowninTableTableI2SRelatedSomevaluesrelatedtoI2SclockareshowninTableSAMSUNGTable I2SClockRelatedTable9showsrelationshipbetweenRCLK,LRCLKandRFS.RCLKisaclockdividedbyI2Spre-scaler(PSR)fromRCLKSRC.TableRootClockTableNOTE:RootClockFrequency=LRCLKx256384512768Availablelegth1208/16/24-BitsforacycleofBLCx2incaseofstereo,2RCLKdividingvalueforSerialbitclockforbusAkindofsignalforLeft/Rightdataalignment,sameasthesamplingCODECclockusedforoperatingtheRootclockusedtogeneratetheSCLK,LRCLKandSamsungTC4AudioSystem_DriverDeveloper'sBLCSamsungTC4AudioSystem_DriverDeveloper'sBLCandBFSontheaudioserialformatofI2SareshowninFigureFigureBLCandBFSontheAudioSerialFormatofSAMSUNGsi-plaza/Jeff_cuiatSamsungTC4AudioSystem_DriverDeveloper'sAnexampleonhowtoSamsungTC4AudioSystem_DriverDeveloper'sAnexampleonhowtocalculateeachclockvalueisshowninExample8foracaseofforprocessingaudioPCMdatahave44.1kHzsamplingrateand24-bitspersample.Forthiscase,thewordlength(BLC)is24-bitandLRCLKmakestransitionevery24cycleofSCLK,thenBFSis48fs.ExampleInaddition,adiagramisshowninFigure15forI2SclockpathsandvaluesbasedonExample8incaseofSAMSUNGbusmasterFigureExampleDiagramofI2SClockPathsandsi-plaza/Jeff_cuiatSamplingfrequency:44.1Bitspersample:24-EachclockvalueLRCLK=Samplingfrequency=44.1SCLK=BFSxLRCLK=48x44.1k=2.1168BLC=Bitspersample=24-BFS>=BLCx2(stereo)=24x2=48RCLK,CDCLK=RFSxLRCLK=384x44.1k=16.9344RFS=BFSxinteger=48x8=384fs(OneoftheavailableRFSvalues)Theinteger8meansadividingvalueofRCLKforSCLK.(SCLK=RCLK/integer=16.9344M/8=2.1168M)RCLKSRC=EPLLFout=RCLKx4(Pre-scalervalue)=16.9344Mx4=67.7376SamsungTC4AudioSystem_DriverDeveloper'sI2SBusMasterFigure16isatypicalusageSamsungTC4AudioSystem_DriverDeveloper'sI2SBusMasterFigure16isatypicalusageofI2SbusmastermodeandsameasFigureTypicalUsageofI2SBusMasterSAMSUNGDirectory:File:DescribesthefunctionsforI2SbusmastermodewhichmeansSCLKandLRCLKareosi-plaza/Jeff_cuiatfromExynostoTherearefunctionstoconfiguretheEPLLclockfrequencyastheRCLKSRCofI2SandtocalculatethevaluesofRFS,BFSandpre-scalerbasedonthesamplerateandPCMdataformatwhicharegivenfromtheupperlayer.Itdoesnotneedtomodifythisfileexceptingthecasethatsourceofroot-clockisnotEPLLbecausealloftheclocksforI2SarecalculatedautomaticallybasedonEPLLinthisfile.SourcecodeonclockThesourcecodepartonBFSvalueconfigurationisshowninExampleThesourcecodepartonRFSandRCLKconfigurationisshowninExample10.ThesourcecodepartonRCLKSRCconfigurationisshowninExample11.oooExamplestaticintsmdk_wm8994_aif1_hw_params(structsnd_pcm_substreamstructsnd_pcm_hw_params{...switch{caseSNDRV_PCM_FORMAT_U24:caseSNDRV_PCM_FORMAT_S24:bfs=bit_per_sample=24;caseSamsungTC4AudioSystem_DriverDeveloper'sSamsungTC4AudioSystem_DriverDeveloper'sExamplestaticintsmdk_wm8994_aif1_hw_params(structsnd_pcm_substreamstructsnd_pcm_hw_params{0:SUNGswitch(params_rate(params))Scasecasecae2000:laza/Jeff_cuiatcasecasecasecaseif(bfs==rfs=rfs=case64000:casecasecaseif(bfs==rfs=rfs=return-casebfs=bit_per_sample=16;return-}...ret=snd_soc_dai_set_clkdiv(cpu_dai,S3C_I2SV2_DIV_BCLK,bfs);if(ret<0)return...}SamsungTC4AudioSystem_DriverDeveloper'sSamsungTC4AudioSystem_DriverDeveloper'sExampleRCLKSRC(EPLL)ConfigurationSourcestaticintsmdk_wm8994_aif1_hw_params(structsnd_pcm_substreamstructsnd_pcm_hw_params{...switch{casecase UNGcase psr=8;e19200casecasecasecasepsr=4;casecasecasecasepsr=2;casecasepsr=1;printk("Notyetsupported!\n");return-EINVAL;}printk("IISAudio:%uBitsStereo%uHz\n",bit_per_sample,}rclk=params_rate(params)*...ret=snd_soc_dai_set_clkdiv(cpu_dai,S3C_I2SV2_DIV_RCLK,rfs);if(ret<0)return...}SamsungTC4AudioSystem_DriverDeveloper'sTheSamsungTC4AudioSystem_DriverDeveloper'sTheRCLKSRCisalsousedasthesourceclockofKernelDefaultmodeofTC4isI2SbusmasterInthemenuconfig,Select"DeviceDriversSoundcardsupportAdvancedLinuxSoundArchitectureALSAforSoCaudiosupportSoCI2SAudiosupportforWM8994onSMDK".Figure KernelConfigurationforI2SBusMastersi-plaza/Jeff_cuiatSAMSUNGset_epll_rate(rclk*...ret=snd_soc_dai_set_clkdiv(cpu_dai,S3C_I2SV2_DIV_PRESCALER,psr-1);if(ret<0)return...}SamsungTC4AudioSystem_DriverDeveloper'sI2SBusSlaveFigure18isaSamsungTC4AudioSystem_DriverDeveloper'sI2SBusSlaveFigure18

溫馨提示

  • 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ù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 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)論