All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@aknet.ru>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: [patch] snd-pcsp: relax dependancy on CONFIG_INPUT
Date: Thu, 08 May 2008 21:31:57 +0400	[thread overview]
Message-ID: <4823390D.8010000@aknet.ru> (raw)
In-Reply-To: <s5h4p98yfof.wl%tiwai@suse.de>

[-- Attachment #1: Type: text/plain, Size: 113 bytes --]

Hello.

The attached patch makes an input
driver part of snd-pcsp optional.

Would it be possible to apply that?

[-- Attachment #2: pcsp_inp.diff --]
[-- Type: text/x-patch, Size: 4222 bytes --]

# HG changeset patch
# User Stas Sergeev <stsp@users.sourceforge.net>
# Date 1210267204 -14400
# Node ID 5c3c0b965df21ac55112f907be0786dfa90b9dc6
# Parent  25a20d46d89a57c89e911452171af7e4cdcc8464
snd-pcsp: relax dependancy on CONFIG_INPUT by adding CONFIG_SND_PCSP_INPUT

Signed-off-by: Stas Sergeev <stsp@aknet.ru>

diff -r 25a20d46d89a -r 5c3c0b965df2 drivers/Kconfig
--- a/drivers/Kconfig	Mon May 05 14:16:12 2008 +0200
+++ b/drivers/Kconfig	Thu May 08 21:20:04 2008 +0400
@@ -5,16 +5,14 @@ menu "Generic devices"
 
 
 config SND_PCSP
-	tristate "Internal PC speaker support"
+	tristate "PC-Speaker support"
 	depends on X86_PC && HIGH_RES_TIMERS
-	depends on INPUT
 	depends on SND
 	select SND_PCM
 	help
 	  If you don't have a sound card in your computer, you can include a
 	  driver for the PC speaker which allows it to act like a primitive
 	  sound card.
-	  This driver also replaces the pcspkr driver for beeps.
 
 	  You can compile this as a module which will be called snd-pcsp.
 
@@ -23,6 +21,17 @@ config SND_PCSP
 	  in your PC instead of the real speaker.
 
 	  It should not hurt to say Y or M here in all other cases.
+
+config SND_PCSP_INPUT
+	bool "PC-Speaker input events (beeps) support"
+	depends on INPUT
+	depends on SND_PCSP
+	default y
+	help
+	  This option enables the PC-Speaker system beeps.
+	  This is an alternative to the pcspkr input driver (INPUT_PCSPKR).
+	  It provides the ability to enable/disable the system
+	  beeps with the sound mixer.
 
 config SND_MPU401_UART
         tristate
diff -r 25a20d46d89a -r 5c3c0b965df2 drivers/pcsp/Makefile
--- a/drivers/pcsp/Makefile	Mon May 05 14:16:12 2008 +0200
+++ b/drivers/pcsp/Makefile	Thu May 08 21:20:04 2008 +0400
@@ -1,2 +1,3 @@ snd-pcsp-objs := pcsp.o pcsp_lib.o pcsp_
-snd-pcsp-objs := pcsp.o pcsp_lib.o pcsp_mixer.o pcsp_input.o
+snd-pcsp-y := pcsp.o pcsp_lib.o pcsp_mixer.o
+snd-pcsp-$(CONFIG_SND_PCSP_INPUT) += pcsp_input.o
 obj-$(CONFIG_SND_PCSP) += snd-pcsp.o
diff -r 25a20d46d89a -r 5c3c0b965df2 drivers/pcsp/pcsp.c
--- a/drivers/pcsp/pcsp.c	Mon May 05 14:16:12 2008 +0200
+++ b/drivers/pcsp/pcsp.c	Thu May 08 21:20:04 2008 +0400
@@ -188,10 +188,12 @@ static int __devexit pcsp_remove(struct 
 
 static void pcsp_stop_beep(struct snd_pcsp *chip)
 {
+#ifdef CONFIG_SND_PCSP_INPUT
 	spin_lock_irq(&chip->substream_lock);
 	if (!chip->playback_substream)
 		pcspkr_stop_sound();
 	spin_unlock_irq(&chip->substream_lock);
+#endif	/* CONFIG_SND_PCSP_INPUT */
 }
 
 #ifdef CONFIG_PM
diff -r 25a20d46d89a -r 5c3c0b965df2 drivers/pcsp/pcsp_input.h
--- a/drivers/pcsp/pcsp_input.h	Mon May 05 14:16:12 2008 +0200
+++ b/drivers/pcsp/pcsp_input.h	Thu May 08 21:20:04 2008 +0400
@@ -7,8 +7,15 @@
 #ifndef __PCSP_INPUT_H__
 #define __PCSP_INPUT_H__
 
+#ifdef CONFIG_SND_PCSP_INPUT
 int __devinit pcspkr_input_init(struct input_dev **rdev, struct device *dev);
 int pcspkr_input_remove(struct input_dev *dev);
 void pcspkr_stop_sound(void);
+#else
+static inline int pcspkr_input_init(struct input_dev **rdev,
+	struct device *dev) { return 0; }
+static inline int pcspkr_input_remove(struct input_dev *dev) { return 0; }
+static inline void pcspkr_stop_sound(void) { }
+#endif	/* CONFIG_SND_PCSP_INPUT */
 
 #endif
diff -r 25a20d46d89a -r 5c3c0b965df2 drivers/pcsp/pcsp_mixer.c
--- a/drivers/pcsp/pcsp_mixer.c	Mon May 05 14:16:12 2008 +0200
+++ b/drivers/pcsp/pcsp_mixer.c	Thu May 08 21:20:04 2008 +0400
@@ -78,6 +78,7 @@ static int pcsp_treble_put(struct snd_kc
 	return changed;
 }
 
+#ifdef CONFIG_SND_PCSP_INPUT
 static int pcsp_pcspkr_info(struct snd_kcontrol *kcontrol,
 			    struct snd_ctl_elem_info *uinfo)
 {
@@ -108,6 +109,7 @@ static int pcsp_pcspkr_put(struct snd_kc
 	}
 	return changed;
 }
+#endif	/* CONFIG_SND_PCSP_INPUT */
 
 #define PCSP_MIXER_CONTROL(ctl_type, ctl_name) \
 { \
@@ -121,7 +123,9 @@ static struct snd_kcontrol_new __devinit
 static struct snd_kcontrol_new __devinitdata snd_pcsp_controls[] = {
 	PCSP_MIXER_CONTROL(enable, "Master Playback Switch"),
 	PCSP_MIXER_CONTROL(treble, "BaseFRQ Playback Volume"),
+#ifdef CONFIG_SND_PCSP_INPUT
 	PCSP_MIXER_CONTROL(pcspkr, "PC Speaker Playback Switch"),
+#endif	/* CONFIG_SND_PCSP_INPUT */
 };
 
 int __devinit snd_pcsp_new_mixer(struct snd_pcsp *chip)

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

       reply	other threads:[~2008-05-08 17:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <482316B8.5080200@aknet.ru>
     [not found] ` <s5h4p98yfof.wl%tiwai@suse.de>
2008-05-08 17:31   ` Stas Sergeev [this message]
2008-05-08 17:35     ` [patch] snd-pcsp: relax dependancy on CONFIG_INPUT Adrian Bunk
2008-05-08 17:53       ` Stas Sergeev
2008-05-08 18:25       ` Stas Sergeev
2008-05-08 22:17         ` Adrian Bunk
2008-05-08 22:38           ` Stas Sergeev
2008-05-08 22:48             ` Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4823390D.8010000@aknet.ru \
    --to=stsp@aknet.ru \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.