Skip to contentSkip to conversation

pcspkr: fix dependancies

PATCH RESEND Superseded Stas Sergeev 2 participants 2 messages May 3, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 pcspkr: fix dependancies

Hello.

linux-2.6.25 has the strange dependancies for pc-speaker, which prevents snd-pcsp from working.
Namely, the platform device (created in arch/x86/kernel/pcspeaker.c) depends on the platform driver (CONFIG_INPUT_PCSPKR). I wonder if it is a good practice to make the platform device to depend on the driver, I guess it is not.

The attached patch reverses that.
It adds the config option for the pcspkr platform device and makes the platform drivers to depend on that.
This allows snd-pcsp to work at least in some configurations.

Ingo, would it be possible to get that applied?

---
fix pcspkr dependancies: make the pcspkr platform drivers to depend on a platform device, and not the other way around.

CC Dmitry Torokhov <[email protected]>
CC Vojtech Pavlik <[email protected]>
CC Michael Opdenacker <[email protected]>
CC Takashi Iwai <[email protected]>
init/Kconfig +8 -0
@@ -624,6 +624,14 @@
 	help
 	  Enable support for generating core dumps. Disabling saves about 4k.
 
+config PCSPKR_PLATFORM
+	bool "Enable PC-Speaker support" if EMBEDDED
+	depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
+	default y
+	help
+          This option allows to disable the internal PC-Speaker
+          support, saving some memory.
+
 config COMPAT_BRK
 	bool "Disable heap randomization"
 	default y
arch/x86/kernel/Makefile +1 -1
@@ -83,7 +83,7 @@
 obj-$(CONFIG_VMI)		+= vmi_32.o vmiclock_32.o
 obj-$(CONFIG_PARAVIRT)		+= paravirt.o paravirt_patch_$(BITS).o
 
-ifdef CONFIG_INPUT_PCSPKR
+ifdef CONFIG_PCSPKR_PLATFORM
 obj-y				+= pcspeaker.o
 endif
 
drivers/input/misc/Kconfig +1 -1
@@ -14,7 +14,7 @@
 
 config INPUT_PCSPKR
 	tristate "PC Speaker support"
-	depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
+	depends on PCSPKR_PLATFORM
 	help
 	  Say Y here if you want the standard PC Speaker to be used for
 	  bells and whistles.
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Stas Sergeev

Ingo, would it be possible to get that
applied?

The input changes need to go via Dimitry, the x86 part can go in the same commit.

Quoted 11 lines

---
fix pcspkr dependancies: make the pcspkr platform
drivers to depend on a platform device, and
not the other way around.

CC Dmitry Torokhov <[email protected]>
CC Vojtech Pavlik <[email protected]>
CC Michael Opdenacker <[email protected]>
CC Takashi Iwai <[email protected]>