linux音頻alsa-uda134x驅(qū)動(dòng)分析之七(機(jī)器驅(qū)動(dòng))_第1頁(yè)
linux音頻alsa-uda134x驅(qū)動(dòng)分析之七(機(jī)器驅(qū)動(dòng))_第2頁(yè)
linux音頻alsa-uda134x驅(qū)動(dòng)分析之七(機(jī)器驅(qū)動(dòng))_第3頁(yè)
linux音頻alsa-uda134x驅(qū)動(dòng)分析之七(機(jī)器驅(qū)動(dòng))_第4頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

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

文檔簡(jiǎn)介

1、linux音頻alsa-uda134x驅(qū)動(dòng)分析之七(機(jī)器驅(qū)動(dòng))ASoC Machine DriverASoC機(jī)器驅(qū)動(dòng)=The ASoC machine (or board) driver is the code that glues together the platformand codec drivers.ASoC機(jī)器或板級(jí)驅(qū)動(dòng)是把平臺(tái)和解碼器驅(qū)動(dòng)粘合在一起的代碼。The machine driver can contain codec and platform specific code. It registersthe audio subsystem with the kernel a

2、s a platform device and is represented bythe following struct:-機(jī)器驅(qū)動(dòng)可以包含解碼器和平臺(tái)相關(guān)代碼。它把音頻子系統(tǒng)注冊(cè)為內(nèi)核中的一個(gè)平臺(tái)設(shè)備,并由下面的結(jié)構(gòu)體表示:/* SoC machine */struct snd_soc_card char *name; int (*probe)(struct platform_device *pdev); int (*remove)(struct platform_device *pdev); /* the pre and post PM functions are used to do

3、any PM work before and * after the codec and DAIs do any PM work. */ int (*suspend_pre)(struct platform_device *pdev, pm_message_t state); int (*suspend_post)(struct platform_device *pdev, pm_message_t state); int (*resume_pre)(struct platform_device *pdev); int (*resume_post)(struct platform_device

4、 *pdev); /* machine stream operations */ struct snd_soc_ops *ops; /* CPU <-> Codec DAI links */ struct snd_soc_dai_link *dai_link; int num_links;probe()/remove()探測(cè)和移除函數(shù)-probe/remove are optional. Do any machine specific probe be/remove(探測(cè)和移除函數(shù))是可選的。可以做一些機(jī)器相關(guān)的探測(cè)。suspend()/resume()掛起和恢復(fù)函

5、數(shù)-The machine driver has pre and post versions of suspend and resume to take careof any machine audio tasks that have to be done before or after the codec, DAIsand DMA is suspended and resumed. Optional.機(jī)器驅(qū)動(dòng)有一前后兩個(gè)版本的掛起和恢復(fù)函數(shù)來(lái)管理在解碼前后要完成的機(jī)器音頻任務(wù)。DAI和DMA都要掛起和恢復(fù)。這也是可選的。Machine operations機(jī)器操作-The machine s

6、pecific audio operations can be set here. Again this is optional.機(jī)器相關(guān)音頻操作可以在這里設(shè)定。這也是可選的。Machine DAI Configuration機(jī)器數(shù)字音頻接口配置-The machine DAI configuration glues all the codec and CPU DAIs together. It canalso be used to set up the DAI system clock and for any machine related DAIinitialisation e.g. th

7、e machine audio map can be connected to the codec audiofor examples.機(jī)器的DAI配置把所有的解碼器和CPU DAI粘合在一起。它也可以用來(lái)啟動(dòng)DAI系統(tǒng)時(shí)鐘或機(jī)器相在DAI的初始化。如機(jī)器音頻映像可以與解碼器音頻映像連在一起。非相連的解碼器引腳也可以如此設(shè)置。例子請(qǐng)見(jiàn)corgi.c,spitz.c.struct snd_soc_dai_link is used to set up each DAI in your machine. e.g.結(jié)構(gòu)體snd_soc_dai_link設(shè)置你機(jī)器的DAI。例如:/* corgi dig

8、ital audio interface glue - connects codec <-> CPU */static struct snd_soc_dai_link corgi_dai = .name = "WM8731", .stream_name = "WM8731", .cpu_dai = &pxa_i2s_dai, .codec_dai = &wm8731_dai, .init = corgi_wm8731_init, .ops = &corgi_ops,;struct snd_soc_card then s

9、ets up the machine with it's DAIs. e.g.然后snd_soc_card用這個(gè)DAI來(lái)配置機(jī)器,例如:/* corgi audio machine driver */static struct snd_soc_card snd_soc_corgi = .name = "Corgi", .dai_link = &corgi_dai, .num_links = 1,;Machine Audio Subsystem機(jī)器音頻子系統(tǒng)-The machine soc device glues the platform, machine

10、and codec driver together.Private data can also be set here. e.g.機(jī)器soc 設(shè)備把平臺(tái),機(jī)器,解碼器驅(qū)動(dòng)結(jié)合在一起。這里也可以設(shè)置私有數(shù)據(jù)。/* corgi audio private data */static struct wm8731_setup_data corgi_wm8731_setup = .i2c_address = 0x1b,;/* corgi audio subsystem */static struct snd_soc_device corgi_snd_devdata = .machine = &s

11、nd_soc_corgi, .platform = &pxa2xx_soc_platform, .codec_dev = &soc_codec_dev_wm8731, .codec_data = &corgi_wm8731_setup,;Machine Power Map機(jī)器電源映像-The machine driver can optionally extend the codec power map and to become anaudio power map of the audio subsystem. This allows for automatic power up/downof speaker/HP amplifiers, etc. Codec pins can be connected to the machines jacksockets in the machine init function. See soc/pxa/spitz.c and dapm.txt fordetails.機(jī)器驅(qū)動(dòng)可以擴(kuò)展解碼器的電源映像,這樣就變成一個(gè)音頻子系統(tǒng)的音頻電源映像。這允許揚(yáng)聲器HP放大器

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論