aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2005-05-28 03:11:12 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2005-05-28 03:11:12 -0400
commit668d1e6093110f7534e661e2ff43d54c74659b6d (patch)
tree58823c949c881605fdf7b23876f2f682fa52effb
parent271b74d0b886301f297407dd7ae11b99607f8089 (diff)
Input:
This patch adds dummy gameport_register_port, gameport_unregister_port and gameport_set_phys functions to gameport.h for the case when a driver can't use gameport. This fixes the compilation of some OSS drivers with GAMEPORT=n without the need to #if inside every single driver. This patch also removes the non-working and now obsolete SOUND_GAMEPORT. This patch is also an alternative solution for ALSA drivers with similar problems (but #if's inside the drivers might have the advantage of saving some more bytes of gameport is not available). The only user-visible change is that for GAMEPORT=m the affected OSS drivers are now allowed to be built statically (but they won't have gameport support). Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Vojtech Pavlik <vojtech@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/gameport/Kconfig20
-rw-r--r--include/linux/gameport.h28
-rw-r--r--sound/oss/Kconfig12
3 files changed, 31 insertions, 29 deletions
diff --git a/drivers/input/gameport/Kconfig b/drivers/input/gameport/Kconfig
index 6282f460aba0..1d93f5092904 100644
--- a/drivers/input/gameport/Kconfig
+++ b/drivers/input/gameport/Kconfig
@@ -68,23 +68,3 @@ config GAMEPORT_CS461X
68 depends on PCI 68 depends on PCI
69 69
70endif 70endif
71
72# Yes, SOUND_GAMEPORT looks a bit odd. Yes, it ends up being turned on
73# in every .config. Please don't touch it. It is here to handle an
74# unusual dependency between GAMEPORT and sound drivers.
75#
76# Some sound drivers call gameport functions. If GAMEPORT is
77# not selected, empty stubs are provided for the functions and all is
78# well.
79# If GAMEPORT is built in, everything is fine.
80# If GAMEPORT is a module, however, it would need to be loaded for the
81# sound driver to be able to link properly. Therefore, the sound
82# driver must be a module as well in that case. Since there's no way
83# to express that directly in Kconfig, we use SOUND_GAMEPORT to
84# express it. SOUND_GAMEPORT boils down to "if GAMEPORT is 'm',
85# anything that depends on SOUND_GAMEPORT must be 'm' as well. if
86# GAMEPORT is 'y' or 'n', it can be anything".
87config SOUND_GAMEPORT
88 tristate
89 default m if GAMEPORT=m
90 default y
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index b1272f822cfa..cd623eccdbea 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -67,6 +67,8 @@ int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mo
67void gameport_close(struct gameport *gameport); 67void gameport_close(struct gameport *gameport);
68void gameport_rescan(struct gameport *gameport); 68void gameport_rescan(struct gameport *gameport);
69 69
70#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
71
70void __gameport_register_port(struct gameport *gameport, struct module *owner); 72void __gameport_register_port(struct gameport *gameport, struct module *owner);
71static inline void gameport_register_port(struct gameport *gameport) 73static inline void gameport_register_port(struct gameport *gameport)
72{ 74{
@@ -75,6 +77,29 @@ static inline void gameport_register_port(struct gameport *gameport)
75 77
76void gameport_unregister_port(struct gameport *gameport); 78void gameport_unregister_port(struct gameport *gameport);
77 79
80void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
81 __attribute__ ((format (printf, 2, 3)));
82
83#else
84
85static inline void gameport_register_port(struct gameport *gameport)
86{
87 return;
88}
89
90static inline void gameport_unregister_port(struct gameport *gameport)
91{
92 return;
93}
94
95static inline void gameport_set_phys(struct gameport *gameport,
96 const char *fmt, ...)
97{
98 return;
99}
100
101#endif
102
78static inline struct gameport *gameport_allocate_port(void) 103static inline struct gameport *gameport_allocate_port(void)
79{ 104{
80 struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL); 105 struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL);
@@ -92,9 +117,6 @@ static inline void gameport_set_name(struct gameport *gameport, const char *name
92 strlcpy(gameport->name, name, sizeof(gameport->name)); 117 strlcpy(gameport->name, name, sizeof(gameport->name));
93} 118}
94 119
95void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
96 __attribute__ ((format (printf, 2, 3)));
97
98/* 120/*
99 * Use the following fucntions to manipulate gameport's per-port 121 * Use the following fucntions to manipulate gameport's per-port
100 * driver-specific data. 122 * driver-specific data.
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index a9602f89d6b1..e537bd66a707 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -112,7 +112,7 @@ config SOUND_BCM_CS4297A
112 112
113config SOUND_ES1370 113config SOUND_ES1370
114 tristate "Ensoniq AudioPCI (ES1370)" 114 tristate "Ensoniq AudioPCI (ES1370)"
115 depends on SOUND_PRIME!=n && SOUND && PCI && SOUND_GAMEPORT 115 depends on SOUND_PRIME!=n && SOUND && PCI
116 help 116 help
117 Say Y or M if you have a PCI sound card utilizing the Ensoniq 117 Say Y or M if you have a PCI sound card utilizing the Ensoniq
118 ES1370 chipset, such as Ensoniq's AudioPCI (non-97). To find 118 ES1370 chipset, such as Ensoniq's AudioPCI (non-97). To find
@@ -125,7 +125,7 @@ config SOUND_ES1370
125 125
126config SOUND_ES1371 126config SOUND_ES1371
127 tristate "Creative Ensoniq AudioPCI 97 (ES1371)" 127 tristate "Creative Ensoniq AudioPCI 97 (ES1371)"
128 depends on SOUND_PRIME!=n && SOUND && PCI && SOUND_GAMEPORT 128 depends on SOUND_PRIME!=n && SOUND && PCI
129 help 129 help
130 Say Y or M if you have a PCI sound card utilizing the Ensoniq 130 Say Y or M if you have a PCI sound card utilizing the Ensoniq
131 ES1371 chipset, such as Ensoniq's AudioPCI97. To find out if 131 ES1371 chipset, such as Ensoniq's AudioPCI97. To find out if
@@ -138,7 +138,7 @@ config SOUND_ES1371
138 138
139config SOUND_ESSSOLO1 139config SOUND_ESSSOLO1
140 tristate "ESS Technology Solo1" 140 tristate "ESS Technology Solo1"
141 depends on SOUND_PRIME!=n && SOUND && SOUND_GAMEPORT && PCI 141 depends on SOUND_PRIME!=n && SOUND && PCI
142 help 142 help
143 Say Y or M if you have a PCI sound card utilizing the ESS Technology 143 Say Y or M if you have a PCI sound card utilizing the ESS Technology
144 Solo1 chip. To find out if your sound card uses a 144 Solo1 chip. To find out if your sound card uses a
@@ -179,7 +179,7 @@ config SOUND_HARMONY
179 179
180config SOUND_SONICVIBES 180config SOUND_SONICVIBES
181 tristate "S3 SonicVibes" 181 tristate "S3 SonicVibes"
182 depends on SOUND_PRIME!=n && SOUND && SOUND_GAMEPORT 182 depends on SOUND_PRIME!=n && SOUND
183 help 183 help
184 Say Y or M if you have a PCI sound card utilizing the S3 184 Say Y or M if you have a PCI sound card utilizing the S3
185 SonicVibes chipset. To find out if your sound card uses a 185 SonicVibes chipset. To find out if your sound card uses a
@@ -226,7 +226,7 @@ config SOUND_AU1550_AC97
226 226
227config SOUND_TRIDENT 227config SOUND_TRIDENT
228 tristate "Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core" 228 tristate "Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core"
229 depends on SOUND_PRIME!=n && SOUND && SOUND_GAMEPORT 229 depends on SOUND_PRIME!=n && SOUND
230 ---help--- 230 ---help---
231 Say Y or M if you have a PCI sound card utilizing the Trident 231 Say Y or M if you have a PCI sound card utilizing the Trident
232 4DWave-DX/NX chipset or your mother board chipset has SiS 7018 232 4DWave-DX/NX chipset or your mother board chipset has SiS 7018
@@ -739,7 +739,7 @@ config SOUND_NM256
739 739
740config SOUND_MAD16 740config SOUND_MAD16
741 tristate "OPTi MAD16 and/or Mozart based cards" 741 tristate "OPTi MAD16 and/or Mozart based cards"
742 depends on SOUND_OSS && SOUND_GAMEPORT 742 depends on SOUND_OSS
743 ---help--- 743 ---help---
744 Answer Y if your card has a Mozart (OAK OTI-601) or MAD16 (OPTi 744 Answer Y if your card has a Mozart (OAK OTI-601) or MAD16 (OPTi
745 82C928 or 82C929 or 82C931) audio interface chip. These chips are 745 82C928 or 82C929 or 82C931) audio interface chip. These chips are