Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3537
b: refs/heads/master
c: 04b6389
h: refs/heads/master
i:
  3535: fb81824
v: v3
  • Loading branch information
Dmitry Torokhov committed Jun 1, 2005
1 parent 777272c commit 23e4b1b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3f9f17d443226f2efd4ff45d333f21dd028afe50
refs/heads/master: 04b6389a5e236a0d214503e922f1e87ccb97f79d
26 changes: 21 additions & 5 deletions trunk/sound/oss/esssolo1.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,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;

/* --------------------------------------------------------------------- */
Expand Down Expand Up @@ -226,7 +230,9 @@ struct solo1_state {
unsigned char obuf[MIDIOUTBUF];
} midi;

#if SUPPORT_JOYSTICK
struct gameport *gameport;
#endif
};

/* --------------------------------------------------------------------- */
Expand Down Expand Up @@ -2280,6 +2286,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;
Expand All @@ -2306,6 +2313,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;
Expand Down Expand Up @@ -2437,11 +2457,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);
Expand Down

0 comments on commit 23e4b1b

Please sign in to comment.