patch for sb16 and the quake mmap

Daniel J. Rodriksson (djr@dit.upm.es)
Wed, 25 Nov 1998 19:04:05 +0100


This is a multi-part message in MIME format.
--------------67DF54299FFB4E7971491B1F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Find attached a possible patch

When mmap is activated, a device specific mmap operation
is executed, if available.

In the sb16 case it deactivates full duplex.

Hope it is what everybody wanted !!

Cheers

-- 
---------------------------------------------------------------|
|         Remember Scotch: 'THERE CAN BE ONLY ONE'             |
---------------------------------------------------------------|
| Daniel J. Rodriksson       | B-204.1,ETSI Telecomunicaciones |
| djr@dit.upm.es             | Avda Paraninfo S/N              |
| http://www.dit.upm.es/~djr | 28040 Madrid                    |
| +34-1-3367366 + ext 442    | SPAIN                           |
|--------------------------------------------------------------|
--------------67DF54299FFB4E7971491B1F
Content-Type: text/plain; charset=us-ascii; name="sound-mmap.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="sound-mmap.diff"

diff -r -u linux-2.1.129.orig/drivers/sound/dev_table.h linux-2.1.129/drivers/sound/dev_table.h --- linux-2.1.129.orig/drivers/sound/dev_table.h Wed Nov 25 18:22:07 1998 +++ linux-2.1.129/drivers/sound/dev_table.h Wed Nov 25 18:47:57 1998 @@ -203,6 +203,7 @@ short (*set_channels)(int dev, short channels); void (*postprocess_write)(int dev); /* Device spesific postprocessing for written data */ void (*preprocess_read)(int dev); /* Device spesific preprocessing for read data */ + void (*mmap)(int dev); }; struct audio_operations diff -r -u linux-2.1.129.orig/drivers/sound/sb_audio.c linux-2.1.129/drivers/sound/sb_audio.c --- linux-2.1.129.orig/drivers/sound/sb_audio.c Sun Nov 8 22:56:10 1998 +++ linux-2.1.129/drivers/sound/sb_audio.c Wed Nov 25 18:48:59 1998 @@ -1136,6 +1136,12 @@ } } +static void +sb16_audio_mmap(int dev) +{ + sb_devc *devc = audio_devs[dev]->devc; + devc->fullduplex = 0; +} static struct audio_driver sb1_audio_driver = /* SB1.x */ { @@ -1254,7 +1260,10 @@ sb16_audio_trigger, sb16_audio_set_speed, sb16_audio_set_bits, - sbpro_audio_set_channels + sbpro_audio_set_channels, + NULL, + NULL, + sb16_audio_mmap }; static struct audio_driver ess_audio_driver = /* ESS ES688/1688 */ diff -r -u linux-2.1.129.orig/drivers/sound/soundcard.c linux-2.1.129/drivers/sound/soundcard.c --- linux-2.1.129.orig/drivers/sound/soundcard.c Fri Nov 13 19:29:44 1998 +++ linux-2.1.129/drivers/sound/soundcard.c Wed Nov 25 18:31:38 1998 @@ -760,6 +760,9 @@ dmap->mapping_flags |= DMA_MAP_MAPPED; + if( audio_devs[dev]->d->mmap) + audio_devs[dev]->d->mmap(dev); + memset(dmap->raw_buf, dmap->neutral_byte, dmap->bytes_in_use);

--------------67DF54299FFB4E7971491B1F--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/