ALSA: firewire-motu: register the size of PCM period to AMDTP domain
[linux-2.6-block.git] / sound / firewire / motu / motu-stream.c
index 813e38e6a86ec87ee7b797f2186d664212276979..52b7c375bb0bd203c5f920eaa3b612a53136e1b3 100644 (file)
@@ -133,7 +133,8 @@ int snd_motu_stream_cache_packet_formats(struct snd_motu *motu)
        return 0;
 }
 
-int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate)
+int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate,
+                                  unsigned int frames_per_period)
 {
        unsigned int curr_rate;
        int err;
@@ -171,6 +172,14 @@ int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate)
                        fw_iso_resources_free(&motu->tx_resources);
                        return err;
                }
+
+               err = amdtp_domain_set_events_per_period(&motu->domain,
+                                                        frames_per_period);
+               if (err < 0) {
+                       fw_iso_resources_free(&motu->tx_resources);
+                       fw_iso_resources_free(&motu->rx_resources);
+                       return err;
+               }
        }
 
        return 0;