ASoC平台驱动程序

ASoC平台驱动程序

ASoC平台驱动程序类可分为音频DMA驱动程序,SoC DAI驱动程序和DSP驱动程序。平台驱动程序仅针对SoC CPU,并且必须没有特定于板的代码。

音频

平台DMA驱动程序可选择支持以下ALSA操作: -

/ * SoC音频操作* /
struct snd_soc_ops {
      int(* startup)(struct snd_pcm_substream *);
      void(* shutdown)(struct snd_pcm_substream *);
      int(* hw_params)(struct snd_pcm_substream *,struct snd_pcm_hw_params *);
      int(* hw_free)(struct snd_pcm_substream *);
      int(* prepare)(struct snd_pcm_substream *);
      int(* trigger)(struct snd_pcm_substream *,int);
};

平台驱动程序通过struct snd_soc_platform_driver导出其DMA功能: -

struct snd_soc_platform_driver {
      char * name;

      int(* probe)(struct platform_device * pdev);
      int(* remove)(struct platform_device * pdev);
      int(* suspend)(struct platform_device * pdev,struct snd_soc_cpu_dai * cpu_dai);
      int(* resume)(struct platform_device * pdev,struct snd_soc_cpu_dai * cpu_dai);

      / * pcm创建和销毁* /
      int(* pcm_new)(struct snd_card *,struct snd_soc_codec_dai *,struct snd_pcm *);
      void(* pcm_free)(struct snd_pcm *);

      / *
       *对于平台引起的延迟报告。
       * 可选的。
       * /
      snd_pcm_sframes_t(* delay)(struct snd_pcm_substream *,
              struct snd_soc_dai *);

      / * platform stream ops * /
      struct snd_pcm_ops * pcm_ops;
};

有关音频DMA的详细信息,请参阅ALSA驱动程序文档。 http://www.alsa-project.org/~iwai/writing-an-alsa-driver/

示例DMA驱动程序是soc / pxa / pxa2xx-pcm.c

SoC DAI驱动程序

每个SoC DAI驱动程序必须提供以下功能: -

  1. 数字音频接口(DAI)描述
  2. 数字音频接口配置
  3. PCM的描述
  4. SYSCLK配置
  5. 暂停和恢复(可选)

有关项目1 - 4的说明,请参阅codec.txt。

SoC DSP驱动程序

每个SoC DSP驱动器通常提供以下功能: -

  1. DAPM图
  2. 搅拌机控制
  3. 进出DSP缓冲区的DMA IO(如果适用)
  4. DSP前端(FE)PCM设备的定义。

有关第4项的说明,请参阅DPCM.txt。

猜你喜欢

转载自blog.csdn.net/humanspider1/article/details/83547611
今日推荐