title: Why and When we should implement snd_pcm_ops?
body: <p>I don't know whether I can ask here or not.</p>
  
  <p>I am trying to understand the Alsa drivers in the Linux.</p>
  
  <p>I have an idea on codec driver, machine driver and platform driver.</p>
  
  <p><strong>Codec driver:</strong> <em>This driver used for the codec specific stuff.</em></p>
  
  <p><strong>Machine driver:</strong> <em>This driver binds the codec driver and the platform driver.</em></p>
  
  <p><strong>Platform driver:</strong> <em>This driver registers the dai and DMA related to the platform.</em></p>
  
  <p>Recently I found a platform driver where they used <code>snd_pcm_ops</code> and they didn't register any dai ops and DMA related stuff in their probe.</p>
  
  <pre><code>/* define all pcm ops of hi6210 pcm */
  static struct snd_pcm_ops hi6210_pcm_ops = {
      .open       = hi6210_pcm_open,
      .close      = hi6210_pcm_close,
      .ioctl      = snd_pcm_lib_ioctl,
      .hw_params  = hi6210_pcm_hw_params,
      .hw_free    = hi6210_pcm_hw_free,
      .prepare    = hi6210_pcm_prepare,
      .trigger    = hi6210_pcm_trigger,
      .pointer    = hi6210_pcm_pointer,
  };
  /* Code from an Android mobile kernel */
  </code></pre>
  
  <p>I just want to understand when and why we should register our platform driver using those <code>snd_pcm_ops</code>.</p>
  
  <p>I found a <a href="http://www.alsa-project.org/~tiwai/writing-an-alsa-driver/ch05s06.html" rel="nofollow noreferrer">doc</a> , I am unable to understand the situation where we can use them.</p>
  
  <p>We never used those in the RPI i2s driver.</p>
  
  <p>Can anyone explain me about this?</p>