diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-07-13 08:57:38 -0500 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-07-13 08:57:38 -0500 |
commit | f7f24758ac98a506770bc5910d33567610fa3403 (patch) | |
tree | ff7fad3d01bf9dc2e2e54b908f9fca4891e1ee72 /sound/oss | |
parent | b38a3ab3d1bb0dc3288f73903d4dc4672b5cd2d0 (diff) | |
parent | c32511e2718618f0b53479eb36e07439aa363a74 (diff) |
Merge with /home/shaggy/git/linus-clean/
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Diffstat (limited to 'sound/oss')
-rw-r--r-- | sound/oss/Kconfig | 64 | ||||
-rw-r--r-- | sound/oss/ad1816.c | 2 | ||||
-rw-r--r-- | sound/oss/ad1848.c | 3 | ||||
-rw-r--r-- | sound/oss/ad1889.c | 3 | ||||
-rw-r--r-- | sound/oss/cmpci.c | 3 | ||||
-rw-r--r-- | sound/oss/cs46xx.c | 6 | ||||
-rw-r--r-- | sound/oss/dmasound/dmasound_awacs.c | 34 | ||||
-rw-r--r-- | sound/oss/emu10k1/midi.c | 6 | ||||
-rw-r--r-- | sound/oss/emu10k1/passthrough.c | 3 | ||||
-rw-r--r-- | sound/oss/es1370.c | 91 | ||||
-rw-r--r-- | sound/oss/es1371.c | 98 | ||||
-rw-r--r-- | sound/oss/esssolo1.c | 29 | ||||
-rw-r--r-- | sound/oss/mad16.c | 30 | ||||
-rw-r--r-- | sound/oss/maestro.c | 2 | ||||
-rw-r--r-- | sound/oss/mpu401.c | 3 | ||||
-rw-r--r-- | sound/oss/nm256.h | 5 | ||||
-rw-r--r-- | sound/oss/nm256_audio.c | 9 | ||||
-rw-r--r-- | sound/oss/nm256_coeff.h | 2 | ||||
-rw-r--r-- | sound/oss/rme96xx.c | 4 | ||||
-rw-r--r-- | sound/oss/sb_common.c | 4 | ||||
-rw-r--r-- | sound/oss/sonicvibes.c | 25 | ||||
-rw-r--r-- | sound/oss/sscape.c | 8 | ||||
-rw-r--r-- | sound/oss/trident.c | 37 | ||||
-rw-r--r-- | sound/oss/v_midi.c | 2 | ||||
-rw-r--r-- | sound/oss/via82cxxx_audio.c | 5 | ||||
-rw-r--r-- | sound/oss/wavfront.c | 12 |
26 files changed, 294 insertions, 196 deletions
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig index e537bd66a70..7bd95ceab7c 100644 --- a/sound/oss/Kconfig +++ b/sound/oss/Kconfig @@ -6,7 +6,7 @@ # Prompt user for primary drivers. config SOUND_BT878 tristate "BT878 audio dma" - depends on SOUND_PRIME!=n && SOUND + depends on SOUND_PRIME ---help--- Audio DMA support for bt878 based grabber boards. As you might have already noticed, bt878 is listed with two functions in /proc/pci. @@ -22,7 +22,7 @@ config SOUND_BT878 config SOUND_CMPCI tristate "C-Media PCI (CMI8338/8738)" - depends on SOUND_PRIME!=n && SOUND && PCI + depends on SOUND_PRIME && PCI help Say Y or M if you have a PCI sound card using the CMI8338 or the CMI8738 chipset. Data on these chips are available at @@ -52,7 +52,7 @@ config SOUND_CMPCI_MIDI config SOUND_CMPCI_JOYSTICK bool "Enable joystick" - depends on SOUND_CMPCI && X86 + depends on SOUND_CMPCI && X86 && (GAMEPORT=y || SOUND_CMPCI=GAMEPORT) help Say Y here in order to enable the joystick port on a sound card using the CMI8338 or the CMI8738 chipset. You need to config the @@ -61,7 +61,7 @@ config SOUND_CMPCI_JOYSTICK config SOUND_EMU10K1 tristate "Creative SBLive! (EMU10K1)" - depends on SOUND_PRIME!=n && SOUND && PCI + depends on SOUND_PRIME && PCI ---help--- Say Y or M if you have a PCI sound card using the EMU10K1 chipset, such as the Creative SBLive!, SB PCI512 or Emu-APS. @@ -87,7 +87,7 @@ config MIDI_EMU10K1 config SOUND_FUSION tristate "Crystal SoundFusion (CS4280/461x)" - depends on SOUND_PRIME!=n && SOUND + depends on SOUND_PRIME help This module drives the Crystal SoundFusion devices (CS4280/46xx series) when wired as native sound drivers with AC97 codecs. If @@ -95,14 +95,14 @@ config SOUND_FUSION config SOUND_CS4281 tristate "Crystal Sound CS4281" - depends on SOUND_PRIME!=n && SOUND + depends on SOUND_PRIME help Picture and feature list at <http://www.pcbroker.com/crystal4281.html>. config SOUND_BCM_CS4297A tristate "Crystal Sound CS4297a (for Swarm)" - depends on SOUND_PRIME!=n && SIBYTE_SWARM && SOUND + depends on SOUND_PRIME && SIBYTE_SWARM help The BCM91250A has a Crystal CS4297a on synchronous serial port B (in addition to the DB-9 serial port). Say Y or M @@ -112,7 +112,7 @@ config SOUND_BCM_CS4297A config SOUND_ES1370 tristate "Ensoniq AudioPCI (ES1370)" - depends on SOUND_PRIME!=n && SOUND && PCI + depends on SOUND_PRIME && PCI help Say Y or M if you have a PCI sound card utilizing the Ensoniq ES1370 chipset, such as Ensoniq's AudioPCI (non-97). To find @@ -125,7 +125,7 @@ config SOUND_ES1370 config SOUND_ES1371 tristate "Creative Ensoniq AudioPCI 97 (ES1371)" - depends on SOUND_PRIME!=n && SOUND && PCI + depends on SOUND_PRIME && PCI help Say Y or M if you have a PCI sound card utilizing the Ensoniq ES1371 chipset, such as Ensoniq's AudioPCI97. To find out if @@ -138,7 +138,7 @@ config SOUND_ES1371 config SOUND_ESSSOLO1 tristate "ESS Technology Solo1" - depends on SOUND_PRIME!=n && SOUND && PCI + depends on SOUND_PRIME && PCI help Say Y or M if you have a PCI sound card utilizing the ESS Technology Solo1 chip. To find out if your sound card uses a @@ -149,7 +149,7 @@ config SOUND_ESSSOLO1 config SOUND_MAESTRO tristate "ESS Maestro, Maestro2, Maestro2E driver" - depends on SOUND_PRIME!=n && SOUND && PCI + depends on SOUND_PRIME && PCI help Say Y or M if you have a sound system driven by ESS's Maestro line of PCI sound chips. These include the Maestro 1, Maestro 2, and @@ -158,28 +158,28 @@ config SOUND_MAESTRO config SOUND_MAESTRO3 tristate "ESS Maestro3/Allegro driver (EXPERIMENTAL)" - depends on SOUND_PRIME!=n && SOUND && PCI && EXPERIMENTAL + depends on SOUND_PRIME && PCI && EXPERIMENTAL help Say Y or M if you have a sound system driven by ESS's Maestro 3 PCI sound chip. config SOUND_ICH tristate "Intel ICH (i8xx) audio support" - depends on SOUND_PRIME!=n && PCI + depends on SOUND_PRIME && PCI help Support for integral audio in Intel's I/O Controller Hub (ICH) chipset, as used on the 810/820/840 motherboards. config SOUND_HARMONY tristate "PA Harmony audio driver" - depends on GSC_LASI && SOUND_PRIME!=n + depends on GSC_LASI && SOUND_PRIME help Say 'Y' or 'M' to include support for Harmony soundchip on HP 712, 715/new and many other GSC based machines. config SOUND_SONICVIBES tristate "S3 SonicVibes" - depends on SOUND_PRIME!=n && SOUND + depends on SOUND_PRIME help Say Y or M if you have a PCI sound card utilizing the S3 SonicVibes chipset. To find out if your sound card uses a @@ -190,7 +190,7 @@ config SOUND_SONICVIBES config SOUND_VWSND tristate "SGI Visual Workstation Sound" - depends on SOUND_PRIME!=n && X86_VISWS && SOUND + depends on SOUND_PRIME && X86_VISWS help Say Y or M if you have an SGI Visual Workstation and you want to be able to use its on-board audio. Read @@ -199,18 +199,18 @@ config SOUND_VWSND config SOUND_HAL2 tristate "SGI HAL2 sound (EXPERIMENTAL)" - depends on SOUND_PRIME!=n && SOUND && SGI_IP22 && EXPERIMENTAL + depends on SOUND_PRIME && SGI_IP22 && EXPERIMENTAL help Say Y or M if you have an SGI Indy system and want to be able to use it's on-board A2 audio system. config SOUND_IT8172 tristate "IT8172G Sound" - depends on SOUND_PRIME!=n && (MIPS_ITE8172 || MIPS_IVR) && SOUND + depends on SOUND_PRIME && (MIPS_ITE8172 || MIPS_IVR) config SOUND_VRC5477 tristate "NEC Vrc5477 AC97 sound" - depends on SOUND_PRIME!=n && DDB5477 && SOUND + depends on SOUND_PRIME && DDB5477 help Say Y here to enable sound support for the NEC Vrc5477 chip, an integrated, multi-function controller chip for MIPS CPUs. Works @@ -218,15 +218,15 @@ config SOUND_VRC5477 config SOUND_AU1000 tristate "Au1000 Sound" - depends on SOUND_PRIME!=n && (SOC_AU1000 || SOC_AU1100 || SOC_AU1500) && SOUND + depends on SOUND_PRIME && (SOC_AU1000 || SOC_AU1100 || SOC_AU1500) config SOUND_AU1550_AC97 tristate "Au1550 AC97 Sound" - depends on SOUND_PRIME!=n && SOC_AU1550 && SOUND + depends on SOUND_PRIME && SOC_AU1550 config SOUND_TRIDENT tristate "Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core" - depends on SOUND_PRIME!=n && SOUND + depends on SOUND_PRIME ---help--- Say Y or M if you have a PCI sound card utilizing the Trident 4DWave-DX/NX chipset or your mother board chipset has SiS 7018 @@ -267,7 +267,7 @@ config SOUND_TRIDENT config SOUND_MSNDCLAS tristate "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey" - depends on SOUND_PRIME!=n && SOUND && (m || !STANDALONE) + depends on SOUND_PRIME && (m || !STANDALONE) help Say M here if you have a Turtle Beach MultiSound Classic, Tahiti or Monterey (not for the Pinnacle or Fiji). @@ -331,7 +331,7 @@ config MSNDCLAS_IO config SOUND_MSNDPIN tristate "Support for Turtle Beach MultiSound Pinnacle, Fiji" - depends on SOUND_PRIME!=n && SOUND && (m || !STANDALONE) + depends on SOUND_PRIME && (m || !STANDALONE) help Say M here if you have a Turtle Beach MultiSound Pinnacle or Fiji. See <file:Documentation/sound/oss/MultiSound> for important information @@ -492,7 +492,7 @@ config MSND_FIFOSIZE config SOUND_VIA82CXXX tristate "VIA 82C686 Audio Codec" - depends on SOUND_PRIME!=n && PCI + depends on SOUND_PRIME && PCI help Say Y here to include support for the audio codec found on VIA 82Cxxx-based chips. Typically these are built into a motherboard. @@ -512,7 +512,7 @@ config MIDI_VIA82CXXX config SOUND_OSS tristate "OSS sound modules" - depends on SOUND_PRIME!=n && SOUND + depends on SOUND_PRIME help OSS is the Open Sound System suite of sound card drivers. They make sound programming easier since they provide a common API. Say Y or @@ -1077,7 +1077,7 @@ config SOUND_WAVEARTIST config SOUND_TVMIXER tristate "TV card (bt848) mixer support" - depends on SOUND_PRIME!=n && SOUND && I2C + depends on SOUND_PRIME && I2C help Support for audio mixer facilities on the BT848 TV frame-grabber card. @@ -1088,11 +1088,11 @@ config SOUND_KAHLUA config SOUND_ALI5455 tristate "ALi5455 audio support" - depends on SOUND_PRIME!=n && PCI + depends on SOUND_PRIME && PCI config SOUND_FORTE tristate "ForteMedia FM801 driver" - depends on SOUND_PRIME!=n && PCI + depends on SOUND_PRIME && PCI help Say Y or M if you want driver support for the ForteMedia FM801 PCI audio controller (Abit AU10, Genius Sound Maker, HP Workstation @@ -1100,7 +1100,7 @@ config SOUND_FORTE config SOUND_RME96XX tristate "RME Hammerfall (RME96XX) support" - depends on SOUND_PRIME!=n && PCI + depends on SOUND_PRIME && PCI help Say Y or M if you have a Hammerfall or Hammerfall light multichannel card from RME. If you want to access advanced @@ -1108,11 +1108,11 @@ config SOUND_RME96XX config SOUND_AD1980 tristate "AD1980 front/back switch plugin" - depends on SOUND_PRIME!=n + depends on SOUND_PRIME config SOUND_SH_DAC_AUDIO tristate "SuperH DAC audio support" - depends on SOUND_PRIME!=n && SOUND && CPU_SH3 + depends on SOUND_PRIME && CPU_SH3 config SOUND_SH_DAC_AUDIO_CHANNEL int " DAC channel" diff --git a/sound/oss/ad1816.c b/sound/oss/ad1816.c index 22dae5d0fda..95586de0202 100644 --- a/sound/oss/ad1816.c +++ b/sound/oss/ad1816.c @@ -592,7 +592,7 @@ typedef struct mixer_def mixer_ent; {{reg_l, pola_l, pos_l, len_l}, {reg_r, pola_r, pos_r, len_r}} -mixer_ent mix_devices[SOUND_MIXER_NRDEVICES][2] = { +static mixer_ent mix_devices[SOUND_MIXER_NRDEVICES][2] = { MIX_ENT(SOUND_MIXER_VOLUME, 14, 1, 8, 5, 14, 1, 0, 5), MIX_ENT(SOUND_MIXER_BASS, 0, 0, 0, 0, 0, 0, 0, 0), MIX_ENT(SOUND_MIXER_TREBLE, 0, 0, 0, 0, 0, 0, 0, 0), diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c index 4384dac3f79..7c835abd99b 100644 --- a/sound/oss/ad1848.c +++ b/sound/oss/ad1848.c @@ -2178,8 +2178,7 @@ void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int if (devc != NULL) { - if(audio_devs[dev]->portc!=NULL) - kfree(audio_devs[dev]->portc); + kfree(audio_devs[dev]->portc); release_region(devc->base, 4); if (!share_dma) diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c index b767c621fd0..2cfd214e4c2 100644 --- a/sound/oss/ad1889.c +++ b/sound/oss/ad1889.c @@ -277,8 +277,7 @@ static void ad1889_free_dev(ad1889_dev_t *dev) for (j = 0; j < AD_MAX_STATES; j++) { dmabuf = &dev->state[j].dmabuf; - if (dmabuf->rawbuf != NULL) - kfree(dmabuf->rawbuf); + kfree(dmabuf->rawbuf); } kfree(dev); diff --git a/sound/oss/cmpci.c b/sound/oss/cmpci.c index 34720e66dae..74dcca78c6c 100644 --- a/sound/oss/cmpci.c +++ b/sound/oss/cmpci.c @@ -123,6 +123,7 @@ #include <linux/smp_lock.h> #include <linux/bitops.h> #include <linux/wait.h> +#include <linux/dma-mapping.h> #include <asm/io.h> #include <asm/page.h> @@ -3058,7 +3059,7 @@ static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id return -ENODEV; if (pcidev->irq == 0) return -ENODEV; - i = pci_set_dma_mask(pcidev, 0xffffffff); + i = pci_set_dma_mask(pcidev, DMA_32BIT_MASK); if (i) { printk(KERN_WARNING "cmpci: architecture does not support 32bit PCI busmaster DMA\n"); return i; diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c index 9e42a1a67ca..cb998e8c0fd 100644 --- a/sound/oss/cs46xx.c +++ b/sound/oss/cs46xx.c @@ -4174,7 +4174,7 @@ static int cs_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int list_for_each(entry, &cs46xx_devs) { card = list_entry(entry, struct cs_card, list); - cs46xx_suspend(card, 0); + cs46xx_suspend(card, PMSG_ON); } } @@ -5749,7 +5749,7 @@ static int cs46xx_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data) case PM_SUSPEND: CS_DBGOUT(CS_PM, 2, printk(KERN_INFO "cs46xx: PM suspend request\n")); - if(cs46xx_suspend(card, 0)) + if(cs46xx_suspend(card, PMSG_SUSPEND)) { CS_DBGOUT(CS_ERROR, 2, printk(KERN_INFO "cs46xx: PM suspend request refused\n")); @@ -5779,7 +5779,7 @@ static int cs46xx_suspend_tbl(struct pci_dev *pcidev, pm_message_t state) struct cs_card *s = PCI_GET_DRIVER_DATA(pcidev); CS_DBGOUT(CS_PM | CS_FUNCTION, 2, printk(KERN_INFO "cs46xx: cs46xx_suspend_tbl request\n")); - cs46xx_suspend(s, 0); + cs46xx_suspend(s, state); return 0; } diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c index 5281b88987f..2704e1598ad 100644 --- a/sound/oss/dmasound/dmasound_awacs.c +++ b/sound/oss/dmasound/dmasound_awacs.c @@ -255,7 +255,7 @@ static int awacs_burgundy_read_mvolume(unsigned address); static volatile struct dbdma_cmd *emergency_dbdma_cmd; -#ifdef CONFIG_PMAC_PBOOK +#ifdef CONFIG_PM /* * Stuff for restoring after a sleep. */ @@ -263,7 +263,7 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when); struct pmu_sleep_notifier awacs_sleep_notifier = { awacs_sleep_notify, SLEEP_LEVEL_SOUND, }; -#endif /* CONFIG_PMAC_PBOOK */ +#endif /* CONFIG_PM */ /* for (soft) sample rate translations */ int expand_bal; /* Balance factor for expanding (not volume!) */ @@ -671,15 +671,11 @@ static void PMacIrqCleanup(void) release_OF_resource(awacs_node, 1); release_OF_resource(awacs_node, 2); - if (awacs_tx_cmd_space) - kfree(awacs_tx_cmd_space); - if (awacs_rx_cmd_space) - kfree(awacs_rx_cmd_space); - if (beep_dbdma_cmd_space) - kfree(beep_dbdma_cmd_space); - if (beep_buf) - kfree(beep_buf); -#ifdef CONFIG_PMAC_PBOOK + kfree(awacs_tx_cmd_space); + kfree(awacs_rx_cmd_space); + kfree(beep_dbdma_cmd_space); + kfree(beep_buf); +#ifdef CONFIG_PM pmu_unregister_sleep_notifier(&awacs_sleep_notifier); #endif } @@ -1419,7 +1415,7 @@ load_awacs(void) } } -#ifdef CONFIG_PMAC_PBOOK +#ifdef CONFIG_PM /* * Save state when going to sleep, restore it afterwards. */ @@ -1555,7 +1551,7 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when) } return PBOOK_SLEEP_OK; } -#endif /* CONFIG_PMAC_PBOOK */ +#endif /* CONFIG_PM */ /* All the burgundy functions: */ @@ -2301,8 +2297,7 @@ if (count <= 0) #endif if ((write_sq.max_count + 1) > number_of_tx_cmd_buffers) { - if (awacs_tx_cmd_space) - kfree(awacs_tx_cmd_space); + kfree(awacs_tx_cmd_space); number_of_tx_cmd_buffers = 0; /* we need nbufs + 1 (for the loop) and we should request + 1 @@ -2360,8 +2355,7 @@ if (count <= 0) #endif if ((read_sq.max_count+1) > number_of_rx_cmd_buffers ) { - if (awacs_rx_cmd_space) - kfree(awacs_rx_cmd_space); + kfree(awacs_rx_cmd_space); number_of_rx_cmd_buffers = 0; /* we need nbufs + 1 (for the loop) and we should request + 1 again @@ -2805,7 +2799,7 @@ __init setup_beep(void) beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL); if (beep_buf == NULL) { printk(KERN_ERR "dmasound_pmac: no memory for beep buffer\n"); - if( beep_dbdma_cmd_space ) kfree(beep_dbdma_cmd_space) ; + kfree(beep_dbdma_cmd_space) ; return -ENOMEM ; } return 0 ; @@ -3059,9 +3053,9 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev); if ((res=setup_beep())) return res ; -#ifdef CONFIG_PMAC_PBOOK +#ifdef CONFIG_PM pmu_register_sleep_notifier(&awacs_sleep_notifier); -#endif /* CONFIG_PMAC_PBOOK */ +#endif /* CONFIG_PM */ /* Powerbooks have odd ways of enabling inputs such as an expansion-bay CD or sound from an internal modem diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c index 33dea3d56c1..b40b5f97aac 100644 --- a/sound/oss/emu10k1/midi.c +++ b/sound/oss/emu10k1/midi.c @@ -523,10 +523,8 @@ void emu10k1_seq_midi_close(int dev) card = midi_devs[dev]->devc; emu10k1_mpuout_close(card); - if (card->seq_mididev) { - kfree(card->seq_mididev); - card->seq_mididev = NULL; - } + kfree(card->seq_mididev); + card->seq_mididev = NULL; } int emu10k1_seq_midi_out(int dev, unsigned char midi_byte) diff --git a/sound/oss/emu10k1/passthrough.c b/sound/oss/emu10k1/passthrough.c index 4094be55f3b..4e3baca7d41 100644 --- a/sound/oss/emu10k1/passthrough.c +++ b/sound/oss/emu10k1/passthrough.c @@ -213,8 +213,7 @@ void emu10k1_pt_stop(struct emu10k1_card *card) sblive_writeptr(card, SPCS0 + i, 0, pt->old_spcs[i]); } pt->state = PT_STATE_INACTIVE; - if(pt->buf) - kfree(pt->buf); + kfree(pt->buf); } } diff --git a/sound/oss/es1370.c b/sound/oss/es1370.c index 056091cff26..8538085086e 100644 --- a/sound/oss/es1370.c +++ b/sound/oss/es1370.c @@ -156,11 +156,16 @@ #include <linux/spinlock.h> #include <linux/gameport.h> #include <linux/wait.h> +#include <linux/dma-mapping.h> #include <asm/io.h> #include <asm/page.h> #include <asm/uaccess.h> +#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) +#define SUPPORT_JOYSTICK +#endif + /* --------------------------------------------------------------------- */ #undef OSS_DOCUMENTED_MIXER_SEMANTICS @@ -384,7 +389,10 @@ struct es1370_state { unsigned char obuf[MIDIOUTBUF]; } midi; +#ifdef SUPPORT_JOYSTICK struct gameport *gameport; +#endif + struct semaphore sem; }; @@ -2553,10 +2561,55 @@ static struct initvol { { SOUND_MIXER_WRITE_OGAIN, 0x4040 } }; +#ifdef SUPPORT_JOYSTICK + +static int __devinit es1370_register_gameport(struct es1370_state *s) +{ + struct gameport *gp; + + if (!request_region(0x200, JOY_EXTENT, "es1370")) { + printk(KERN_ERR "es1370: joystick io port 0x200 in use\n"); + return -EBUSY; + } + + s->gameport = gp = gameport_allocate_port(); + if (!gp) { + printk(KERN_ERR "es1370: can not allocate memory for gameport\n"); + release_region(0x200, JOY_EXTENT); + return -ENOMEM; + } + + gameport_set_name(gp, "ESS1370"); + gameport_set_phys(gp, "pci%s/gameport0", pci_name(s->dev)); + gp->dev.parent = &s->dev->dev; + gp->io = 0x200; + + s->ctrl |= CTRL_JYSTK_EN; + outl(s->ctrl, s->io + ES1370_REG_CONTROL); + + gameport_register_port(gp); + + return 0; +} + +static inline void es1370_unregister_gameport(struct es1370_state *s) +{ + if (s->gameport) { + int gpio = s->gameport->io; + gameport_unregister_port(s->gameport); + release_region(gpio, JOY_EXTENT); + + } +} + +#else +static inline int es1370_register_gameport(struct es1370_state *s) { return -ENOSYS; } +static inline void es1370_unregister_gameport(struct es1370_state *s) { } +#endif /* SUPPORT_JOYSTICK */ + static int __devinit es1370_probe(struct pci_dev *pcidev, const struct pci_device_id *pciid) { struct es1370_state *s; - struct gameport *gp = NULL; mm_segment_t fs; int i, val, ret; @@ -2569,7 +2622,7 @@ static int __devinit es1370_probe(struct pci_dev *pcidev, const struct pci_devic return -ENODEV; if (pcidev->irq == 0) return -ENODEV; - i = pci_set_dma_mask(pcidev, 0xffffffff); + i = pci_set_dma_mask(pcidev, DMA_32BIT_MASK); if (i) { printk(KERN_WARNING "es1370: architecture does not support 32bit PCI busmaster DMA\n"); return i; @@ -2605,28 +2658,14 @@ static int __devinit es1370_probe(struct pci_dev *pcidev, const struct pci_devic /* note: setting CTRL_SERR_DIS is reported to break * mic bias setting (by Kim.Berts@fisub.mail.abb.com) */ s->ctrl = CTRL_CDC_EN | (DAC2_SRTODIV(8000) << CTRL_SH_PCLKDIV) | (1 << CTRL_SH_WTSRSEL); - if (!request_region(0x200, JOY_EXTENT, "es1370")) { - printk(KERN_ERR "es1370: joystick io port 0x200 in use\n"); - } else if (!(s->gameport = gp = gameport_allocate_port())) { - printk(KERN_ERR "es1370: can not allocate memory for gameport\n"); - release_region(0x200, JOY_EXTENT); - } else { - gameport_set_name(gp, "ESS1370"); - gameport_set_phys(gp, "pci%s/gameport0", pci_name(s->dev)); - gp->dev.parent = &s->dev->dev; - gp->io = 0x200; - s->ctrl |= CTRL_JYSTK_EN; - } if (lineout[devindex]) s->ctrl |= CTRL_XCTL0; if (micbias[devindex]) s->ctrl |= CTRL_XCTL1; s->sctrl = 0; - printk(KERN_INFO "es1370: found adapter at io %#lx irq %u\n" - KERN_INFO "es1370: features: joystick %s, line %s, mic impedance %s\n", - s->io, s->irq, (s->ctrl & CTRL_JYSTK_EN) ? "on" : "off", - (s->ctrl & CTRL_XCTL0) ? "out" : "in", - (s->ctrl & CTRL_XCTL1) ? "1" : "0"); + printk(KERN_INFO "es1370: adapter at io %#lx irq %u, line %s, mic impedance %s\n", + s->io, s->irq, (s->ctrl & CTRL_XCTL0) ? "out" : "in", + (s->ctrl & CTRL_XCTL1) ? "1" : "0"); /* register devices */ if ((s->dev_audio = register_sound_dsp(&es1370_audio_fops, -1)) < 0) { ret = s->dev_audio; @@ -2672,9 +2711,7 @@ static int __devinit es1370_probe(struct pci_dev *pcidev, const struct pci_devic } set_fs(fs); - /* register gameport */ - if (gp) - gameport_register_port(gp); + es1370_register_gameport(s); /* store it in the driver field */ pci_set_drvdata(pcidev, s); @@ -2696,10 +2733,6 @@ static int __devinit es1370_probe(struct pci_dev *pcidev, const struct pci_devic err_dev1: printk(KERN_ERR "es1370: cannot register misc device\n"); free_irq(s->irq, s); - if (s->gameport) { - release_region(s->gameport->io, JOY_EXTENT); - gameport_free_port(s->gameport); - } err_irq: release_region(s->io, ES1370_EXTENT); err_region: @@ -2718,11 +2751,7 @@ static void __devexit es1370_remove(struct pci_dev *dev) outl(0, s->io+ES1370_REG_SERIAL_CONTROL); /* clear serial interrupts */ synchronize_irq(s->irq); free_irq(s->irq, s); - if (s->gameport) { - int gpio = s->gameport->io; - gameport_unregister_port(s->gameport); - release_region(gpio, JOY_EXTENT); - } + es1370_unregister_gameport(s); release_region(s->io, ES1370_EXTENT); unregister_sound_dsp(s->dev_audio); unregister_sound_mixer(s->dev_mixer); diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c index a50fddaeea2..12a56d5ab49 100644 --- a/sound/oss/es1371.c +++ b/sound/oss/es1371.c @@ -128,11 +128,16 @@ #include <linux/ac97_codec.h> #include <linux/gameport.h> #include <linux/wait.h> +#include <linux/dma-mapping.h> #include <asm/io.h> #include <asm/page.h> #include <asm/uaccess.h> +#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) +#define SUPPORT_JOYSTICK +#endif + /* --------------------------------------------------------------------- */ #undef OSS_DOCUMENTED_MIXER_SEMANTICS @@ -453,7 +458,10 @@ struct es1371_state { unsigned char obuf[MIDIOUTBUF]; } midi; +#ifdef SUPPORT_JOYSTICK struct gameport *gameport; +#endif + struct semaphore sem; }; @@ -2786,12 +2794,63 @@ static struct { PCI_ANY_ID, PCI_ANY_ID } }; +#ifdef SUPPORT_JOYSTICK + +static int __devinit es1371_register_gameport(struct es1371_state *s) +{ + struct gameport *gp; + int gpio; + + for (gpio = 0x218; gpio >= 0x200; gpio -= 0x08) + if (request_region(gpio, JOY_EXTENT, "es1371")) + break; + + if (gpio < 0x200) { + printk(KERN_ERR PFX "no free joystick address found\n"); + return -EBUSY; + } + + s->gameport = gp = gameport_allocate_port(); + if (!gp) { + printk(KERN_ERR PFX "can not allocate memory for gameport\n"); + release_region(gpio, JOY_EXTENT); + return -ENOMEM; + } + + gameport_set_name(gp, "ESS1371 Gameport"); + gameport_set_phys(gp, "isa%04x/gameport0", gpio); + gp->dev.parent = &s->dev->dev; + gp->io = gpio; + + s->ctrl |= CTRL_JYSTK_EN | (((gpio >> 3) & CTRL_JOY_MASK) << CTRL_JOY_SHIFT); + outl(s->ctrl, s->io + ES1371_REG_CONTROL); + + gameport_register_port(gp); + + return 0; +} + +static inline void es1371_unregister_gameport(struct es1371_state *s) +{ + if (s->gameport) { + int gpio = s->gameport->io; + gameport_unregister_port(s->gameport); + release_region(gpio, JOY_EXTENT); + + } +} + +#else +static inline int es1371_register_gameport(struct es1371_state *s) { return -ENOSYS; } +static inline void es1371_unregister_gameport(struct es1371_state *s) { } +#endif /* SUPPORT_JOYSTICK */ + + static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_device_id *pciid) { struct es1371_state *s; - struct gameport *gp; mm_segment_t fs; - int i, gpio, val, res = -1; + int i, val, res = -1; int idx; unsigned long tmo; signed long tmo2; @@ -2804,7 +2863,7 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic return -ENODEV; if (pcidev->irq == 0) return -ENODEV; - i = pci_set_dma_mask(pcidev, 0xffffffff); + i = pci_set_dma_mask(pcidev, DMA_32BIT_MASK); if (i) { printk(KERN_WARNING "es1371: architecture does not support 32bit PCI busmaster DMA\n"); return i; @@ -2882,23 +2941,6 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic } } - for (gpio = 0x218; gpio >= 0x200; gpio -= 0x08) - if (request_region(gpio, JOY_EXTENT, "es1371")) - break; - - if (gpio < 0x200) { - printk(KERN_ERR PFX "no free joystick address found\n"); - } else if (!(s->gameport = gp = gameport_allocate_port())) { - printk(KERN_ERR PFX "can not allocate memory for gameport\n"); - release_region(gpio, JOY_EXTENT); - } else { - gameport_set_name(gp, "ESS1371 Gameport"); - gameport_set_phys(gp, "isa%04x/gameport0", gpio); - gp->dev.parent = &s->dev->dev; - gp->io = gpio; - s->ctrl |= CTRL_JYSTK_EN | (((gpio >> 3) & CTRL_JOY_MASK) << CTRL_JOY_SHIFT); - } - s->sctrl = 0; cssr = 0; s->spdif_volume = -1; @@ -2968,9 +3010,7 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic /* turn on S/PDIF output driver if requested */ outl(cssr, s->io+ES1371_REG_STATUS); - /* register gameport */ - if (s->gameport) - gameport_register_port(s->gameport); + es1371_register_gameport(s); /* store it in the driver field */ pci_set_drvdata(pcidev, s); @@ -2979,13 +3019,9 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic /* increment devindex */ if (devindex < NR_DEVICE-1) devindex++; - return 0; + return 0; err_gp: - if (s->gameport) { - release_region(s->gameport->io, JOY_EXTENT); - gameport_free_port(s->gameport); - } #ifdef ES1371_DEBUG if (s->ps) remove_proc_entry("es1371", NULL); @@ -3024,11 +3060,7 @@ static void __devexit es1371_remove(struct pci_dev *dev) outl(0, s->io+ES1371_REG_SERIAL_CONTROL); /* clear serial interrupts */ synchronize_irq(s->irq); free_irq(s->irq, s); - if (s->gameport) { - int gpio = s->gameport->io; - gameport_unregister_port(s->gameport); - release_region(gpio, JOY_EXTENT); - } + es1371_unregister_gameport(s); release_region(s->io, ES1371_EXTENT); unregister_sound_dsp(s->dev_audio); unregister_sound_mixer(s->codec->dev_mixer); diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c index 6b3b9a99579..a4ecab2f052 100644 --- a/sound/oss/esssolo1.c +++ b/sound/oss/esssolo1.c @@ -104,6 +104,7 @@ #include <linux/smp_lock.h> #include <linux/gameport.h> #include <linux/wait.h> +#include <linux/dma-mapping.h> #include <asm/io.h> #include <asm/page.h> @@ -149,6 +150,10 @@ #define FMODE_DMFM 0x10 +#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) +#define SUPPORT_JOYSTICK 1 +#endif + static struct pci_driver solo1_driver; /* --------------------------------------------------------------------- */ @@ -226,7 +231,9 @@ struct solo1_state { unsigned char obuf[MIDIOUTBUF]; } midi; +#if SUPPORT_JOYSTICK struct gameport *gameport; +#endif }; /* --------------------------------------------------------------------- */ @@ -2280,6 +2287,7 @@ solo1_resume(struct pci_dev *pci_dev) { return 0; } +#ifdef SUPPORT_JOYSTICK static int __devinit solo1_register_gameport(struct solo1_state *s, int io_port) { struct gameport *gp; @@ -2306,6 +2314,19 @@ static int __devinit solo1_register_gameport(struct solo1_state *s, int io_port) return 0; } +static inline void solo1_unregister_gameport(struct solo1_state *s) +{ + if (s->gameport) { + int gpio = s->gameport->io; + gameport_unregister_port(s->gameport); + release_region(gpio, GAMEPORT_EXTENT); + } +} +#else +static inline int solo1_register_gameport(struct solo1_state *s, int io_port) { return -ENOSYS; } +static inline void solo1_unregister_gameport(struct solo1_state *s) { } +#endif /* SUPPORT_JOYSTICK */ + static int __devinit solo1_probe(struct pci_dev *pcidev, const struct pci_device_id *pciid) { struct solo1_state *s; @@ -2326,7 +2347,7 @@ static int __devinit solo1_probe(struct pci_dev *pcidev, const struct pci_device * to 24 bits first, then 32 bits (playback only) if that fails. */ if (pci_set_dma_mask(pcidev, 0x00ffffff) && - pci_set_dma_mask(pcidev, 0xffffffff)) { + pci_set_dma_mask(pcidev, DMA_32BIT_MASK)) { printk(KERN_WARNING "solo1: architecture does not support 24bit or 32bit PCI busmaster DMA\n"); return -ENODEV; } @@ -2437,11 +2458,7 @@ static void __devexit solo1_remove(struct pci_dev *dev) synchronize_irq(s->irq); pci_write_config_word(s->dev, 0x60, 0); /* turn off DDMA controller address space */ free_irq(s->irq, s); - if (s->gameport) { - int gpio = s->gameport->io; - gameport_unregister_port(s->gameport); - release_region(gpio, GAMEPORT_EXTENT); - } + solo1_unregister_gameport(s); release_region(s->iobase, IOBASE_EXTENT); release_region(s->sbbase+FMSYNTH_EXTENT, SBBASE_EXTENT-FMSYNTH_EXTENT); release_region(s->ddmabase, DDMABASE_EXTENT); diff --git a/sound/oss/mad16.c b/sound/oss/mad16.c index a7067f16991..aa3c50db66c 100644 --- a/sound/oss/mad16.c +++ b/sound/oss/mad16.c @@ -50,9 +50,12 @@ #include "sb.h" #include "mpu401.h" +#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) +#define SUPPORT_JOYSTICK 1 +#endif + static int mad16_conf; static int mad16_cdsel; -static struct gameport *gameport; static DEFINE_SPINLOCK(lock); #define C928 1 @@ -902,6 +905,10 @@ static int __initdata irq_map[16] = -1, -1, -1, -1 }; +#ifdef SUPPORT_JOYSTICK + +static struct gameport *gameport; + static int __devinit mad16_register_gameport(int io_port) { if (!request_region(io_port, 1, "mad16 gameport")) { @@ -925,6 +932,20 @@ static int __devinit mad16_register_gameport(int io_port) return 0; } +static inline void mad16_unregister_gameport(void) +{ + if (gameport) { + /* the gameport was initialized so we must free it up */ + gameport_unregister_port(gameport); + gameport = NULL; + release_region(0x201, 1); + } +} +#else +static inline int mad16_register_gameport(int io_port) { return -ENOSYS; } +static inline void mad16_unregister_gameport(void) { } +#endif + static int __devinit init_mad16(void) { int dmatype = 0; @@ -1060,12 +1081,7 @@ static void __exit cleanup_mad16(void) { if (found_mpu) unload_mad16_mpu(&cfg_mpu); - if (gameport) { - /* the gameport was initialized so we must free it up */ - gameport_unregister_port(gameport); - gameport = NULL; - release_region(0x201, 1); - } + mad16_unregister_gameport(); unload_mad16(&cfg); release_region(MC0_PORT, 12); } diff --git a/sound/oss/maestro.c b/sound/oss/maestro.c index 52d2db4bc31..3dce504e6d6 100644 --- a/sound/oss/maestro.c +++ b/sound/oss/maestro.c @@ -2356,7 +2356,7 @@ ess_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) } rec_return_free: - if(combbuf) kfree(combbuf); + kfree(combbuf); return ret; } diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c index b66f53fa8db..0aac54c68f0 100644 --- a/sound/oss/mpu401.c +++ b/sound/oss/mpu401.c @@ -1240,8 +1240,7 @@ void unload_mpu401(struct address_info *hw_config) p=mpu401_synth_operations[n]; sound_unload_mididev(n); sound_unload_timerdev(hw_config->slots[2]); - if(p) - kfree(p); + kfree(p); } } diff --git a/sound/oss/nm256.h b/sound/oss/nm256.h index eae7d99d682..21e07b5081f 100644 --- a/sound/oss/nm256.h +++ b/sound/oss/nm256.h @@ -128,9 +128,6 @@ struct nm256_info struct nm256_info *next_card; }; -/* Debug flag--bigger numbers mean more output. */ -extern int nm256_debug; - /* The BIOS signature. */ #define NM_SIGNATURE 0x4e4d0000 /* Signature mask. */ @@ -284,7 +281,7 @@ nm256_readBuffer8 (struct nm256_info *card, u8 *dst, int port, int offset, } /* Returns a non-zero value if we should use the coefficient cache. */ -extern int nm256_cachedCoefficients (struct nm256_info *card); +static int nm256_cachedCoefficients (struct nm256_info *card); #endif diff --git a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c index f9166e13519..66970062eb3 100644 --- a/sound/oss/nm256_audio.c +++ b/sound/oss/nm256_audio.c @@ -28,12 +28,13 @@ #include <linux/delay.h> #include <linux/spinlock.h> #include "sound_config.h" -#include "nm256.h" -#include "nm256_coeff.h" -int nm256_debug; +static int nm256_debug; static int force_load; +#include "nm256.h" +#include "nm256_coeff.h" + /* * The size of the playback reserve. When the playback buffer has less * than NM256_PLAY_WMARK_SIZE bytes to output, we request a new @@ -138,7 +139,7 @@ static int usecache; static int buffertop; /* Check to see if we're using the bank of cached coefficients. */ -int +static int nm256_cachedCoefficients (struct nm256_info *card) { return usecache; diff --git a/sound/oss/nm256_coeff.h b/sound/oss/nm256_coeff.h index 0ceecc20077..6fc07f3cb33 100644 --- a/sound/oss/nm256_coeff.h +++ b/sound/oss/nm256_coeff.h @@ -4650,7 +4650,7 @@ nm256_loadAllCoefficients (struct nm256_info *card) card->coeffsCurrent = 1; } -void +static void nm256_loadCoefficient (struct nm256_info *card, int which, int number) { static u16 addrs[3] = { 0x1c, 0x21c, 0x408 }; diff --git a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c index b4278eecc91..7609c68a89f 100644 --- a/sound/oss/rme96xx.c +++ b/sound/oss/rme96xx.c @@ -1750,9 +1750,7 @@ static unsigned int rme96xx_poll(struct file *file, struct poll_table_struct *wa static struct file_operations rme96xx_audio_fops = { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) .owner = THIS_MODULE, -#endif .read = rme96xx_read, .write = rme96xx_write, .poll = rme96xx_poll, @@ -1852,9 +1850,7 @@ static int rme96xx_mixer_release(struct inode *inode, struct file *file) } static /*const*/ struct file_operations rme96xx_mixer_fops = { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) .owner = THIS_MODULE, -#endif .ioctl = rme96xx_mixer_ioctl, .open = rme96xx_mixer_open, .release = rme96xx_mixer_release, diff --git a/sound/oss/sb_common.c b/sound/oss/sb_common.c index ce359e6c933..5f955e3d2e2 100644 --- a/sound/oss/sb_common.c +++ b/sound/oss/sb_common.c @@ -915,8 +915,8 @@ void sb_dsp_unload(struct address_info *hw_config, int sbmpu) } else release_region(hw_config->io_base, 16); - if(detected_devc) - kfree(detected_devc); + + kfree(detected_devc); } /* diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c index 06047e7979a..17d0e461f8d 100644 --- a/sound/oss/sonicvibes.c +++ b/sound/oss/sonicvibes.c @@ -122,6 +122,9 @@ #include "dm.h" +#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) +#define SUPPORT_JOYSTICK 1 +#endif /* --------------------------------------------------------------------- */ @@ -365,7 +368,9 @@ struct sv_state { unsigned char obuf[MIDIOUTBUF]; } midi; +#if SUPPORT_JOYSTICK struct gameport *gameport; +#endif }; /* --------------------------------------------------------------------- */ @@ -2485,6 +2490,7 @@ static struct initvol { #define RSRCISIOREGION(dev,num) (pci_resource_start((dev), (num)) != 0 && \ (pci_resource_flags((dev), (num)) & IORESOURCE_IO)) +#ifdef SUPPORT_JOYSTICK static int __devinit sv_register_gameport(struct sv_state *s, int io_port) { struct gameport *gp; @@ -2511,6 +2517,19 @@ static int __devinit sv_register_gameport(struct sv_state *s, int io_port) return 0; } +static inline void sv_unregister_gameport(struct sv_state *s) +{ + if (s->gameport) { + int gpio = s->gameport->io; + gameport_unregister_port(s->gameport); + release_region(gpio, SV_EXTENT_GAME); + } +} +#else +static inline int sv_register_gameport(struct sv_state *s, int io_port) { return -ENOSYS; } +static inline void sv_unregister_gameport(struct sv_state *s) { } +#endif /* SUPPORT_JOYSTICK */ + static int __devinit sv_probe(struct pci_dev *pcidev, const struct pci_device_id *pciid) { static char __devinitdata sv_ddma_name[] = "S3 Inc. SonicVibes DDMA Controller"; @@ -2711,11 +2730,7 @@ static void __devexit sv_remove(struct pci_dev *dev) /*outb(0, s->iodmaa + SV_DMA_RESET);*/ /*outb(0, s->iodmac + SV_DMA_RESET);*/ free_irq(s->irq, s); - if (s->gameport) { - int gpio = s->gameport->io; - gameport_unregister_port(s->gameport); - release_region(gpio, SV_EXTENT_GAME); - } + sv_unregister_gameport(s); release_region(s->iodmac, SV_EXTENT_DMA); release_region(s->iodmaa, SV_EXTENT_DMA); release_region(s->ioenh, SV_EXTENT_ENH); diff --git a/sound/oss/sscape.c b/sound/oss/sscape.c index 50ca6462945..9ed5211c316 100644 --- a/sound/oss/sscape.c +++ b/sound/oss/sscape.c @@ -991,7 +991,6 @@ static void __init sscape_pnp_init_hw(sscape_info* devc) unsigned i; static char code_file_name[23] = "/sndscape/sndscape.cox"; - int sscape_sb_enable = 0; int sscape_joystic_enable = 0x7f; int sscape_mic_enable = 0; int sscape_ext_midi = 0; @@ -1015,14 +1014,9 @@ static void __init sscape_pnp_init_hw(sscape_info* devc) sscape_write( devc, 2, devc->ic_type == IC_ODIE ? 0x70 : 0x40); sscape_write( devc, 3, ( devc -> dma << 4) | 0x80); - if ( sscape_sb_enable ) - sscape_write (devc, 4, 0xF0 | (sb_irq << 2) | midi_irq); - else - sscape_write (devc, 4, 0xF0 | (midi_irq<<2) | midi_irq); + sscape_write (devc, 4, 0xF0 | (midi_irq<<2) | midi_irq); i = 0x10; //sscape_read(devc, 9) & (devc->ic_type == IC_ODIE ? 0xf0 : 0xc0); - if ( sscape_sb_enable ) - i |= devc->ic_type == IC_ODIE ? 0x05 : 0x07; if (sscape_joystic_enable) i |= 8; sscape_write (devc, 9, i); diff --git a/sound/oss/trident.c b/sound/oss/trident.c index 47537f0a5b0..5f0ad6bb43b 100644 --- a/sound/oss/trident.c +++ b/sound/oss/trident.c @@ -228,6 +228,10 @@ #define DRIVER_VERSION "0.14.10j-2.6" +#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) +#define SUPPORT_JOYSTICK 1 +#endif + /* magic numbers to protect our data structures */ #define TRIDENT_CARD_MAGIC 0x5072696E /* "Prin" */ #define TRIDENT_STATE_MAGIC 0x63657373 /* "cess" */ @@ -4252,24 +4256,25 @@ trident_ac97_init(struct trident_card *card) return num_ac97 + 1; } +#ifdef SUPPORT_JOYSTICK /* Gameport functions for the cards ADC gameport */ -static unsigned char -trident_game_read(struct gameport *gameport) +static unsigned char trident_game_read(struct gameport *gameport) { struct trident_card *card = gameport->port_data; + return inb(TRID_REG(card, T4D_GAME_LEG)); } -static void -trident_game_trigger(struct gameport *gameport) +static void trident_game_trigger(struct gameport *gameport) { struct trident_card *card = gameport->port_data; + outb(0xff, TRID_REG(card, T4D_GAME_LEG)); } -static int -trident_game_cooked_read(struct gameport *gameport, int *axes, int *buttons) +static int trident_game_cooked_read(struct gameport *gameport, + int *axes, int *buttons) { struct trident_card *card = gameport->port_data; int i; @@ -4285,8 +4290,7 @@ trident_game_cooked_read(struct gameport *gameport, int *axes, int *buttons) return 0; } -static int -trident_game_open(struct gameport *gameport, int mode) +static int trident_game_open(struct gameport *gameport, int mode) { struct trident_card *card = gameport->port_data; @@ -4305,8 +4309,7 @@ trident_game_open(struct gameport *gameport, int mode) return 0; } -static int __devinit -trident_register_gameport(struct trident_card *card) +static int __devinit trident_register_gameport(struct trident_card *card) { struct gameport *gp; @@ -4330,6 +4333,17 @@ trident_register_gameport(struct trident_card *card) return 0; } +static inline void trident_unregister_gameport(struct trident_card *card) +{ + if (card->gameport) + gameport_unregister_port(card->gameport); +} + +#else +static inline int trident_register_gameport(struct trident_card *card) { return -ENOSYS; } +static inline void trident_unregister_gameport(struct trident_card *card) { } +#endif /* SUPPORT_JOYSTICK */ + /* install the driver, we do not allocate hardware channel nor DMA buffer */ /* now, they are defered until "ACCESS" time (in prog_dmabuf called by */ /* open/read/write/ioctl/mmap) */ @@ -4569,8 +4583,7 @@ trident_remove(struct pci_dev *pci_dev) } /* Unregister gameport */ - if (card->gameport) - gameport_unregister_port(card->gameport); + trident_unregister_gameport(card); /* Kill interrupts, and SP/DIF */ trident_disable_loop_interrupts(card); diff --git a/sound/oss/v_midi.c b/sound/oss/v_midi.c index 077b7679766..a7ef04fab07 100644 --- a/sound/oss/v_midi.c +++ b/sound/oss/v_midi.c @@ -39,8 +39,6 @@ static void *midi_mem = NULL; */ -void (*midi_input_intr) (int dev, unsigned char data); - static int v_midi_open (int dev, int mode, void (*input) (int dev, unsigned char data), void (*output) (int dev) diff --git a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c index b387e1e5248..83edda93f0b 100644 --- a/sound/oss/via82cxxx_audio.c +++ b/sound/oss/via82cxxx_audio.c @@ -35,6 +35,7 @@ #include <linux/smp_lock.h> #include <linux/ioport.h> #include <linux/delay.h> +#include <linux/dma-mapping.h> #include <asm/io.h> #include <asm/uaccess.h> #include <asm/semaphore.h> @@ -3391,10 +3392,10 @@ static int __devinit via_init_one (struct pci_dev *pdev, const struct pci_device if (rc) goto err_out_disable; - rc = pci_set_dma_mask(pdev, 0xffffffffULL); + rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); if (rc) goto err_out_res; - rc = pci_set_consistent_dma_mask(pdev, 0xffffffffULL); + rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); if (rc) goto err_out_res; diff --git a/sound/oss/wavfront.c b/sound/oss/wavfront.c index cce1278dc48..b92ba892163 100644 --- a/sound/oss/wavfront.c +++ b/sound/oss/wavfront.c @@ -151,11 +151,11 @@ static int (*midi_load_patch) (int devno, int format, const char __user *addr, /*** Module-accessible parameters ***************************************/ -int wf_raw; /* we normally check for "raw state" to firmware - loading. if set, then during driver loading, the - state of the board is ignored, and we reset the - board and load the firmware anyway. - */ +static int wf_raw; /* we normally check for "raw state" to firmware + loading. if set, then during driver loading, the + state of the board is ignored, and we reset the + board and load the firmware anyway. + */ static int fx_raw = 1; /* if this is zero, we'll leave the FX processor in whatever state it is when the driver is loaded. @@ -2911,7 +2911,7 @@ int __init detect_wffx (void) return 0; } -void +static void wffx_mute (int onoff) { |