From e5e1d3cb20034a3cbcfff1f0bae12201aa2ce17e Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Wed, 7 May 2008 12:39:56 +0200 Subject: [PATCH 1/3] pcspkr: fix dependancies fix pcspkr dependancies: make the pcspkr platform drivers to depend on a platform device, and not the other way around. Signed-off-by: Stas Sergeev Acked-by: Thomas Gleixner Acked-by: Dmitry Torokhov CC: Vojtech Pavlik CC: Michael Opdenacker [fixed for 2.6.26-rc1 by tiwai] Signed-off-by: Takashi Iwai --- arch/x86/kernel/Makefile | 4 +--- drivers/input/misc/Kconfig | 2 +- init/Kconfig | 8 ++++++++ sound/drivers/Kconfig | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index bbdacb398d48..5e618c3b4720 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -83,9 +83,7 @@ obj-$(CONFIG_KVM_GUEST) += kvm.o obj-$(CONFIG_KVM_CLOCK) += kvmclock.o obj-$(CONFIG_PARAVIRT) += paravirt.o paravirt_patch_$(BITS).o -ifdef CONFIG_INPUT_PCSPKR -obj-y += pcspeaker.o -endif +obj-$(CONFIG_PCSPKR_PLATFORM) += pcspeaker.o obj-$(CONFIG_SCx200) += scx200.o scx200-y += scx200_32.o diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 92b683411d5a..3ad8bd9f7543 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -14,7 +14,7 @@ if INPUT_MISC config INPUT_PCSPKR tristate "PC Speaker support" - depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES + depends on PCSPKR_PLATFORM depends on SND_PCSP=n help Say Y here if you want the standard PC Speaker to be used for diff --git a/init/Kconfig b/init/Kconfig index 4c33316743f5..3b5adbf228c7 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -634,6 +634,14 @@ config ELF_CORE 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 diff --git a/sound/drivers/Kconfig b/sound/drivers/Kconfig index a78a8d045175..379bcb074463 100644 --- a/sound/drivers/Kconfig +++ b/sound/drivers/Kconfig @@ -5,8 +5,8 @@ menu "Generic devices" config SND_PCSP - tristate "Internal PC speaker support" - depends on X86_PC && HIGH_RES_TIMERS + tristate "PC-Speaker support" + depends on PCSPKR_PLATFORM && X86_PC && HIGH_RES_TIMERS depends on INPUT depends on SND select SND_PCM From 30a717f7e951ec0260f31c0637ecf8e6268ba607 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 8 May 2008 14:03:30 +0200 Subject: [PATCH 2/3] [ALSA] soc - at91-pcm - Fix line wrapping There's more checkpatch stuff to fix in the driver, this just fixes the minimum required for the following patch to be clean. Signed-off-by: Mark Brown Signed-off-by: Takashi Iwai --- sound/soc/at91/at91-pcm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sound/soc/at91/at91-pcm.c b/sound/soc/at91/at91-pcm.c index 67c88e322fb1..e36533d37964 100644 --- a/sound/soc/at91/at91-pcm.c +++ b/sound/soc/at91/at91-pcm.c @@ -103,7 +103,8 @@ static void at91_pcm_dma_irq(u32 ssc_sr, if (prtd->period_ptr >= prtd->dma_buffer_end) { prtd->period_ptr = prtd->dma_buffer; } - at91_ssc_write(params->ssc_base + params->pdc->xnpr, prtd->period_ptr); + at91_ssc_write(params->ssc_base + params->pdc->xnpr, + prtd->period_ptr); at91_ssc_write(params->ssc_base + params->pdc->xncr, prtd->period_size / params->pdc_xfer_size); } @@ -191,10 +192,12 @@ static int at91_pcm_trigger(struct snd_pcm_substream *substream, at91_ssc_write(params->ssc_base + AT91_SSC_IER, params->mask->ssc_endx | params->mask->ssc_endbuf); - at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable); + at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, + params->mask->pdc_enable); - DBG("sr=%lx imr=%lx\n", at91_ssc_read(params->ssc_base + AT91_SSC_SR), - at91_ssc_read(params->ssc_base + AT91_SSC_IER)); + DBG("sr=%lx imr=%lx\n", + at91_ssc_read(params->ssc_base + AT91_SSC_SR), + at91_ssc_read(params->ssc_base + AT91_SSC_IER)); break; case SNDRV_PCM_TRIGGER_STOP: From e3a2efa67a029453b8098dba179ec2d9d8df612e Mon Sep 17 00:00:00 2001 From: Patrik Sevallius Date: Thu, 8 May 2008 14:04:08 +0200 Subject: [PATCH 3/3] [ALSA] soc at91 minor bug fixes Found these two bugs while browsing through the code. The first one is a cut-n-paste bug, instead of disabling the clock when request_irq() fails, it enabled it once more. The second one fixes a debug printout, AT91_SSC_IER is write only, AT91_SSC_IMR is readable (the printed string actually says imr). Frank Mandarino was busy so he asked me to send these to this list. /Patrik Signed-off-by: Patrik Sevallius Acked-by: Frank Mandarino Signed-off-by: Mark Brown Signed-off-by: Takashi Iwai --- sound/soc/at91/at91-pcm.c | 2 +- sound/soc/at91/at91-ssc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/at91/at91-pcm.c b/sound/soc/at91/at91-pcm.c index e36533d37964..ccac6bd2889c 100644 --- a/sound/soc/at91/at91-pcm.c +++ b/sound/soc/at91/at91-pcm.c @@ -197,7 +197,7 @@ static int at91_pcm_trigger(struct snd_pcm_substream *substream, DBG("sr=%lx imr=%lx\n", at91_ssc_read(params->ssc_base + AT91_SSC_SR), - at91_ssc_read(params->ssc_base + AT91_SSC_IER)); + at91_ssc_read(params->ssc_base + AT91_SSC_IMR)); break; case SNDRV_PCM_TRIGGER_STOP: diff --git a/sound/soc/at91/at91-ssc.c b/sound/soc/at91/at91-ssc.c index f642d2dd4ec3..bc35d00a38f8 100644 --- a/sound/soc/at91/at91-ssc.c +++ b/sound/soc/at91/at91-ssc.c @@ -590,7 +590,7 @@ static int at91_ssc_hw_params(struct snd_pcm_substream *substream, printk(KERN_WARNING "at91-ssc: request_irq failure\n"); DBG("Stopping pid %d clock\n", ssc_p->ssc.pid); - at91_sys_write(AT91_PMC_PCER, 1<ssc.pid); + at91_sys_write(AT91_PMC_PCDR, 1<ssc.pid); return ret; }