libaudiodriver: readd callback to drv_int_sum()

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
This commit is contained in:
David van Moolenbroek 2016-12-28 13:08:23 +00:00
parent 10a44c0ee2
commit 192c3a97f6

View 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);
}
}
}