原址

soc_probe
==> snd_soc_register_card或者snd_soc_register_dai或者snd_soc_register_platform或者snd_soc_register_codec
==> snd_soc_instantiate_cards
==> snd_soc_instantiate_card
==> codec_dev->probe
==> uda134x_soc_probe
==> snd_soc_new_pcms
==> soc_new_pcm
==> snd_pcm_newsnd_soc_new_pcms
snd_card_create
snd_ctl_create
snd_ctl_dev_register创建"controlC%i"声卡对应的控制节点,
他的fops为snd_ctl_f_opssnd_pcm_dev_register
snd_register_device_for_dev
创建"pcmC%iD%ip"或者"pcmC%iD%ic"设备节点,它的fops为snd_pcm_f_ops[2]snd_pcm_f_ops[2]
==> snd_pcm_playback_open或者snd_pcm_capture_open
==> snd_pcm_open或者oss的snd_pcm_oss_f_reg.snd_pcm_oss_open,这就对应/dev/dsp了
==> snd_pcm_open_file或者oss的snd_pcm_oss_open_file
==> snd_pcm_open_substream
==> soc_pcm_open/* ASoC PCM operations */
static struct snd_pcm_ops soc_pcm_ops = {.open        = soc_pcm_open,.close        = soc_codec_close,.hw_params    = soc_pcm_hw_params,.hw_free    = soc_pcm_hw_free,.prepare    = soc_pcm_prepare,.trigger    = soc_pcm_trigger,
};
==> soc_pcm_open
cpu_dai->ops->startup       // 无
platform->pcm_ops->open     // s3c_dma_open 分配DMA空间
codec_dai->ops->startup     // uda134x_startup
card_dai_link->ops->startup // s3c24xx_uda134x_startup 获取clock时钟源// cpu_dai单元
struct snd_soc_dai s3c24xx_i2s_dai = {.name = "s3c24xx-i2s",.id = 0,.probe = s3c24xx_i2s_probe,.suspend = s3c24xx_i2s_suspend,.resume = s3c24xx_i2s_resume,.playback = {.channels_min = 2,.channels_max = 2,.rates = S3C24XX_I2S_RATES,.formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,},.capture = {.channels_min = 2,.channels_max = 2,.rates = S3C24XX_I2S_RATES,.formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,},.ops = &s3c24xx_i2s_dai_ops,
};
//platform单元
struct snd_soc_platform s3c24xx_soc_platform = {.name        = "s3c24xx-audio",.pcm_ops     = &s3c_dma_ops,.pcm_new    = s3c_dma_new,.pcm_free    = s3c_dma_free_dma_buffers,
};static struct snd_pcm_ops s3c_dma_ops = {.open        = s3c_dma_open,.close        = s3c_dma_close,.ioctl        = snd_pcm_lib_ioctl,.hw_params    = s3c_dma_hw_params,.hw_free    = s3c_dma_hw_free,.prepare    = s3c_dma_prepare,.trigger    = s3c_dma_trigger,.pointer    = s3c_dma_pointer,.mmap        = s3c_dma_mmap,
};
// codec_dai单元
struct snd_soc_dai uda134x_dai = {.name = "UDA134X",/* playback capabilities */.playback = {.stream_name = "Playback",.channels_min = 1,.channels_max = 2,.rates = UDA134X_RATES,.formats = UDA134X_FORMATS,},/* capture capabilities */.capture = {.stream_name = "Capture",.channels_min = 1,.channels_max = 2,.rates = UDA134X_RATES,.formats = UDA134X_FORMATS,},/* pcm operations */.ops = &uda134x_dai_ops,
};//card_dai_link单元
static struct snd_soc_dai_link s3c24xx_uda134x_dai_link = {.name = "UDA134X",.stream_name = "UDA134X",.codec_dai = &uda134x_dai,.cpu_dai = &s3c24xx_i2s_dai,.ops = &s3c24xx_uda134x_ops,
};Pcm.csnd_pcm_control_ioctl()case SNDRV_CTL_IOCTL_PCM_INFO:*  S1:get params infofrom userspace arg**  S2:get info->device*  S3:get info->stream*  S4:get info->subdevice*  S5:get pcm from matching special card and device*  S1:get pstrfrom &pcm->streams[stream]*  S2:get substreamfrom pstr->substream*  S3:Now! we got struct snd_pcm_substream*substream*        which contents the struct snd_pcm_runtime*runtime;snd_pcm_runtime里面有/* -- hardware description -- */struct snd_pcm_hardware hw;struct snd_pcm_hw_constraintshw_constraints;xx_pcm.cxx_pcm_hardwarexx_pcm_open()xx_pcm_opsxx_soc_platformsnd_soc_register_platform()xx_soc_platform_init()module_init

ALSA驱动、设备函数调用关系相关推荐

  1. 嵌入式linux mtd,嵌入式Linux驱动设备之MTD技术详解

    原标题:嵌入式Linux驱动设备之MTD技术详解 MTD(memory technology device内存技术设备)是用于访问memory设备(ROM.flash)的Linux的子系统. MTD的 ...

  2. linux驱动 设备驱动模型

    前言 在早期的Liux内核中并没有为设备驱动提供统一的设备模型.随着内核的不断扩大及系统更加复杂,编写一个驱动程序越来越困难,所以在Liux2.6内核中添加了一个统一的设备模型.这样,写设备驱动程序就 ...

  3. 用ALSA驱动声卡流程详解

    作者:北南南北 来自:LinuxSir.Org 提要:目前大多数发行版都已经支持主流声卡,声卡的驱动无非是用ALSA:本文主要讲述声卡驱动的流程:目的是帮助遇到声卡的驱动问题的弟兄来弄清楚解决问题的流 ...

  4. ALSA驱动框架分析

    一.ALSA驱动框架介绍 1.ALSA介绍 ALSA(Advanced Linux Sound Architecture-高级linux声音架构),目前已经成为了linux的主流音频体系结构,ALSA ...

  5. Linux中用ALSA驱动声卡流程详解

    一.什么是ALSA : Advanced Linux Sound Architecture 的简称为 ALSA ,译成中文的意思是 Linux 高级声音体系(这是我直译的,可能译的不对):一谈到体系就 ...

  6. Linux音频设备两种框架OSS和ALSA驱动

    在Linux中,先后出现了音频设备的两种框架OSS和ALSA,本节将在介绍数字音频设备及音频设备硬件接口的基础上,展现OSS和ALSA驱动的结构. 17.1-17.2节讲解了音频设备及PCM.IIS和 ...

  7. Alsa驱动分析(转)

    1.    Abstract 2.    Introduction 3.    音频驱动框架介绍 3.1      音频设备的注册 3.2     音频驱动的注册 3.2.1       Probe函 ...

  8. Linux ALSA驱动框架(一)--ALSA架构简介--声卡的创建

    (1)ALSA简介 (1) Native ALSA Application:tinyplay/tinycap/tinymix,这些用户程序直接调用 alsa 用户库接口来实现放音.录音.控制 ALSA ...

  9. arm linux免驱usb声卡,arm linux利用alsa驱动并使用usb音频设备

    一.背景: arm linux的内核版本是3.13.0 二.准备工作 添加alsa驱动到内核中,也就是在编译内核的时候加入以下选项: 接下来就重新编译内核即可 三.交叉编译alsa-lib和alsa- ...

最新文章

  1. permute是最好的Mac上面的格式转换器
  2. mysql 中文含数字排序_英语| 124期 Sort 坑爹的字符串排序
  3. OS- -操作系统概念
  4. 在Windows 下使用OpenCL
  5. 在linux下使用360随身wifi 2 | 李凡希的blog,在Linux下使用“360随身WiFi 2”
  6. 自动驾驶之多传感器融合-硬件篇(激光雷达)
  7. 12月1日struts、spring、hibernate等框架的整合培训日记
  8. 数字证书是什么,主要应用于哪些方面?
  9. webmagic保存html页面,WebMagic抓取前端Ajax渲染的页面
  10. Could not resolve hostname github: Name or service
  11. 基于模板替换的word文档自动生成
  12. OpenBox:高效通用的黑盒优化系统
  13. Interop统计WORD字数
  14. 【信号与系统】Multisim 仿真连续时间系统的时域分析
  15. JLH统计法统计飞龙(C++) kkmd66
  16. LVM管理体系(二)通过扩展LV扩展逻辑卷(操作步骤)
  17. c语言数组越界也太难了吧,跨函数越界啥意思?
  18. R语言:作业六(逆变换法生成随机变量;线性同余发生器LCG的编写)
  19. 海思A182-Hi3516DV300推流摄像头数据
  20. Android开发定位

热门文章

  1. 扩充你的工具箱 - 大行文件的处理
  2. 国产杀毒软件连续因“作弊”遭全球权威评测机构指责
  3. SQL Server中CTE的另一种递归方式-从底层向上递归
  4. Apache Struts 1宣告退出舞台
  5. WPF几个核心类的类层次结构
  6. Sql server 分解字符串(实现split)
  7. 基于 POI 封装 ExcelUtil 精简的 Excel 导入导出
  8. 最好免费的 HTML5 JS 网站视频播放器收集
  9. Google工程师详解Android架构
  10. bat调用ant_bat调用ant_Ant调用批处理文件编译VS2005程序