]> Zhao Yanbai Git Server - minix.git/commitdiff
libaudiodriver: readd callback to drv_int_sum() 83/3383/1
authorDavid van Moolenbroek <david@minix3.org>
Wed, 28 Dec 2016 13:08:23 +0000 (13:08 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Wed, 28 Dec 2016 13:08:23 +0000 (13:08 +0000)
The callback, which was dropped in commit git-842c4ed, allows drivers
to fetch the interrupt status once and save it locally for subsequent
calls to drv_int().

This fixes #190 .

Change-Id: I83918656f637e716f60e9f4c19f1498f761d3b52

minix/lib/libaudiodriver/audio_fw.c

index a9f32febe15cdbb02400f1e6a823f8b709c90398..ff3ce5cfd94d43f718e1283a3ce170d6ad756f40 100644 (file)
@@ -496,15 +496,18 @@ static void msg_hardware(unsigned int UNUSED(mask))
 {
        int i;
 
-       /* loop over all sub devices */
-       for ( i = 0; i < drv.NrOfSubDevices; i++) {
-               /* if interrupt from sub device and Dma transfer 
-                  was actually busy, take care of business */
-               if( drv_int(i) && sub_dev[i].DmaBusy ) {
-                       if (sub_dev[i].DmaMode == WRITE_DMA)
-                               handle_int_write(i);
-                       if (sub_dev[i].DmaMode == READ_DMA)
-                               handle_int_read(i);
+       /* if we have an interrupt */
+       if (drv_int_sum()) {
+               /* loop over all sub devices */
+               for ( i = 0; i < drv.NrOfSubDevices; i++) {
+                       /* if interrupt from sub device and Dma transfer
+                          was actually busy, take care of business */
+                       if( drv_int(i) && sub_dev[i].DmaBusy ) {
+                               if (sub_dev[i].DmaMode == WRITE_DMA)
+                                       handle_int_write(i);
+                               if (sub_dev[i].DmaMode == READ_DMA)
+                                       handle_int_read(i);
+                       }
                }
        }