All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 00/14] Sort out i8253 and PC speaker locking and headers
@ 2011-06-01 18:04 ralf
  2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
                   ` (14 more replies)
  0 siblings, 15 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch, linux-alpha, linuxppc-dev, linux-mips

No longer terribly relevant these days but still broken and just an eyesore
mess of neglience just as I've already raised it a few days ago.  Time to
sort this.

drivers/input/misc/pcspkr.c:

#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
/* Use the global PIT lock ! */
#include <asm/i8253.h>
#else
#include <asm/8253pit.h>
static DEFINE_RAW_SPINLOCK(i8253_lock);
#endif

sound/drivers/pcsp/pcsp.h:

#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
/* Use the global PIT lock ! */
#include <asm/i8253.h>
#else
#include <asm/8253pit.h>
static DEFINE_RAW_SPINLOCK(i8253_lock);

$ git grep -F pcsp.h sound/drivers/pcsp
sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
$ git grep -w i8253_lock sound/drivers/pcsp/
sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
sound/drivers/pcsp/pcsp_input.c:        raw_spin_lock_irqsave(&i8253_lock, flags
sound/drivers/pcsp/pcsp_input.c:        raw_spin_unlock_irqrestore(&i8253_lock, 
sound/drivers/pcsp/pcsp_lib.c:          raw_spin_lock_irqsave(&i8253_lock, flags
sound/drivers/pcsp/pcsp_lib.c:          raw_spin_unlock_irqrestore(&i8253_lock, 
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);

Locks are great, everybody should have their own lock!

$ find . -name 8253pit.h
./arch/powerpc/include/asm/8253pit.h
./arch/alpha/include/asm/8253pit.h
$ cat arch/*/include/asm/8253pit.h
/*
 * 8253/8254 Programmable Interval Timer
 */
/*
 * 8253/8254 Programmable Interval Timer
 */
$

Eh...

$ git grep -w PCSPKR_PLATFORM 
arch/mips/Kconfig:      select PCSPKR_PLATFORM
arch/mips/Kconfig:      select PCSPKR_PLATFORM
arch/mips/Kconfig:      select PCSPKR_PLATFORM
arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
init/Kconfig:config PCSPKR_PLATFORM
sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 && HIGH_RES_TIMERS

So the status is:

 Alpha:		There is no PCSPKR_PLATFORM so while a platform device is
		being installed no drivers will be built.  I don't know
		which Alpha platforms or even if all of Alpha should be
		doing a PCSPKR_PLATFORM so I haven't even tried to sort
		this.
 ARM:		No PC speaker supported, yeah :)
 PowerPC:	Should compile but the locking is wrong but only the AmigaOne
   		platforms should be affected.
 MIPS:		Ok.
 x86:		Ok.
 All others:	No PC speaker supported

Also only the plain old IBM PC XT was using a i8253; every later system
had i8254.  So maybe this is the time for renaming the support code?

  Ralf


^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
@ 2011-06-01 18:04 ` ralf
  2011-06-09 11:16   ` [tip:timers/cleanup] i8253: Create linux/i8253.h and use it in all 8253 related files tip-bot for Ralf Baechle
  2011-06-09 13:04   ` tip-bot for Ralf Baechle
  2011-06-01 18:04   ` ralf at linux-mips.org
                   ` (13 subsequent siblings)
  14 siblings, 2 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, John Stultz,
	linux-mips

[-- Attachment #1: i8253-add-shared-header.patch --]
[-- Type: text/plain, Size: 10803 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: John Stultz <johnstul@us.ibm.com>
Cc: linux-mips@linux-mips.org

 arch/arm/mach-footbridge/isa-timer.c |    2 +-
 arch/mips/cobalt/time.c              |    2 +-
 arch/mips/jazz/irq.c                 |    2 +-
 arch/mips/kernel/i8253.c             |    2 +-
 arch/mips/mti-malta/malta-time.c     |    2 +-
 arch/mips/sgi-ip22/ip22-time.c       |    2 +-
 arch/mips/sni/time.c                 |    2 +-
 arch/x86/kernel/apic/apic.c          |    2 +-
 arch/x86/kernel/apm_32.c             |    2 +-
 arch/x86/kernel/hpet.c               |    2 +-
 arch/x86/kernel/i8253.c              |    2 +-
 arch/x86/kernel/time.c               |    2 +-
 drivers/block/hd.c                   |    2 +-
 drivers/clocksource/i8253.c          |    2 +-
 drivers/input/gameport/gameport.c    |    2 +-
 drivers/input/joystick/analog.c      |    2 +-
 drivers/input/misc/pcspkr.c          |    2 +-
 include/linux/i8253.h                |   11 +++++++++++
 sound/drivers/pcsp/pcsp.h            |    2 +-
 19 files changed, 29 insertions(+), 18 deletions(-)

Index: linux-mips/include/linux/i8253.h
===================================================================
--- /dev/null
+++ linux-mips/include/linux/i8253.h
@@ -0,0 +1,11 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#ifndef __LINUX_I8253_H
+#define __LINUX_I8253_H
+
+#include <asm/i8253.h>
+
+#endif /* __LINUX_I8253_H */
Index: linux-mips/arch/arm/mach-footbridge/isa-timer.c
===================================================================
--- linux-mips.orig/arch/arm/mach-footbridge/isa-timer.c
+++ linux-mips/arch/arm/mach-footbridge/isa-timer.c
@@ -6,6 +6,7 @@
  */
 #include <linux/clockchips.h>
 #include <linux/clocksource.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -14,7 +15,6 @@
 #include <linux/timex.h>
 
 #include <asm/irq.h>
-#include <asm/i8253.h>
 #include <asm/mach/time.h>
 
 #include "common.h"
Index: linux-mips/arch/mips/cobalt/time.c
===================================================================
--- linux-mips.orig/arch/mips/cobalt/time.c
+++ linux-mips/arch/mips/cobalt/time.c
@@ -17,10 +17,10 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
+#include <linux/i8253.h>
 #include <linux/init.h>
 
 #include <asm/gt64120.h>
-#include <asm/i8253.h>
 #include <asm/time.h>
 
 #define GT641XX_BASE_CLOCK	50000000	/* 50MHz */
Index: linux-mips/arch/mips/jazz/irq.c
===================================================================
--- linux-mips.orig/arch/mips/jazz/irq.c
+++ linux-mips/arch/mips/jazz/irq.c
@@ -7,6 +7,7 @@
  * Copyright (C) 1994 - 2001, 2003, 07 Ralf Baechle
  */
 #include <linux/clockchips.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
@@ -15,7 +16,6 @@
 #include <linux/irq.h>
 
 #include <asm/irq_cpu.h>
-#include <asm/i8253.h>
 #include <asm/i8259.h>
 #include <asm/io.h>
 #include <asm/jazz.h>
Index: linux-mips/arch/mips/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/mips/kernel/i8253.c
+++ linux-mips/arch/mips/kernel/i8253.c
@@ -3,6 +3,7 @@
  *
  */
 #include <linux/clockchips.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/jiffies.h>
@@ -12,7 +13,6 @@
 #include <linux/irq.h>
 
 #include <asm/delay.h>
-#include <asm/i8253.h>
 #include <asm/io.h>
 #include <asm/time.h>
 
Index: linux-mips/arch/mips/mti-malta/malta-time.c
===================================================================
--- linux-mips.orig/arch/mips/mti-malta/malta-time.c
+++ linux-mips/arch/mips/mti-malta/malta-time.c
@@ -19,6 +19,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
@@ -31,7 +32,6 @@
 #include <asm/mipsregs.h>
 #include <asm/mipsmtregs.h>
 #include <asm/hardirq.h>
-#include <asm/i8253.h>
 #include <asm/irq.h>
 #include <asm/div64.h>
 #include <asm/cpu.h>
Index: linux-mips/arch/mips/sgi-ip22/ip22-time.c
===================================================================
--- linux-mips.orig/arch/mips/sgi-ip22/ip22-time.c
+++ linux-mips/arch/mips/sgi-ip22/ip22-time.c
@@ -10,6 +10,7 @@
  * Copyright (C) 2003, 06 Ralf Baechle (ralf@linux-mips.org)
  */
 #include <linux/bcd.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
@@ -20,7 +21,6 @@
 
 #include <asm/cpu.h>
 #include <asm/mipsregs.h>
-#include <asm/i8253.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/time.h>
Index: linux-mips/arch/mips/sni/time.c
===================================================================
--- linux-mips.orig/arch/mips/sni/time.c
+++ linux-mips/arch/mips/sni/time.c
@@ -1,11 +1,11 @@
 #include <linux/types.h>
+#include <linux/i8253.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/smp.h>
 #include <linux/time.h>
 #include <linux/clockchips.h>
 
-#include <asm/i8253.h>
 #include <asm/sni.h>
 #include <asm/time.h>
 #include <asm-generic/rtc.h>
Index: linux-mips/arch/x86/kernel/apic/apic.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apic/apic.c
+++ linux-mips/arch/x86/kernel/apic/apic.c
@@ -27,6 +27,7 @@
 #include <linux/syscore_ops.h>
 #include <linux/delay.h>
 #include <linux/timex.h>
+#include <linux/i8253.h>
 #include <linux/dmar.h>
 #include <linux/init.h>
 #include <linux/cpu.h>
@@ -39,7 +40,6 @@
 #include <asm/pgalloc.h>
 #include <asm/atomic.h>
 #include <asm/mpspec.h>
-#include <asm/i8253.h>
 #include <asm/i8259.h>
 #include <asm/proto.h>
 #include <asm/apic.h>
Index: linux-mips/arch/x86/kernel/apm_32.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apm_32.c
+++ linux-mips/arch/x86/kernel/apm_32.c
@@ -229,11 +229,11 @@
 #include <linux/jiffies.h>
 #include <linux/acpi.h>
 #include <linux/syscore_ops.h>
+#include <linux/i8253.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/desc.h>
-#include <asm/i8253.h>
 #include <asm/olpc.h>
 #include <asm/paravirt.h>
 #include <asm/reboot.h>
Index: linux-mips/arch/x86/kernel/hpet.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/hpet.c
+++ linux-mips/arch/x86/kernel/hpet.c
@@ -4,6 +4,7 @@
 #include <linux/sysdev.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
+#include <linux/i8253.h>
 #include <linux/slab.h>
 #include <linux/hpet.h>
 #include <linux/init.h>
@@ -12,7 +13,6 @@
 #include <linux/io.h>
 
 #include <asm/fixmap.h>
-#include <asm/i8253.h>
 #include <asm/hpet.h>
 
 #define HPET_MASK			CLOCKSOURCE_MASK(32)
Index: linux-mips/arch/x86/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/i8253.c
+++ linux-mips/arch/x86/kernel/i8253.c
@@ -9,10 +9,10 @@
 #include <linux/module.h>
 #include <linux/timex.h>
 #include <linux/delay.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/io.h>
 
-#include <asm/i8253.h>
 #include <asm/hpet.h>
 #include <asm/smp.h>
 
Index: linux-mips/arch/x86/kernel/time.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/time.c
+++ linux-mips/arch/x86/kernel/time.c
@@ -11,13 +11,13 @@
 
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
+#include <linux/i8253.h>
 #include <linux/time.h>
 #include <linux/mca.h>
 
 #include <asm/vsyscall.h>
 #include <asm/x86_init.h>
 #include <asm/i8259.h>
-#include <asm/i8253.h>
 #include <asm/timer.h>
 #include <asm/hpet.h>
 #include <asm/time.h>
Index: linux-mips/drivers/block/hd.c
===================================================================
--- linux-mips.orig/drivers/block/hd.c
+++ linux-mips/drivers/block/hd.c
@@ -155,7 +155,7 @@ else \
 
 #if (HD_DELAY > 0)
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 unsigned long last_req;
 
Index: linux-mips/drivers/clocksource/i8253.c
===================================================================
--- linux-mips.orig/drivers/clocksource/i8253.c
+++ linux-mips/drivers/clocksource/i8253.c
@@ -7,7 +7,7 @@
 #include <linux/spinlock.h>
 #include <linux/timex.h>
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 /*
  * Since the PIT overflows every tick, its not very useful
Index: linux-mips/drivers/input/gameport/gameport.c
===================================================================
--- linux-mips.orig/drivers/input/gameport/gameport.c
+++ linux-mips/drivers/input/gameport/gameport.c
@@ -47,7 +47,7 @@ static void gameport_disconnect_port(str
 
 #if defined(__i386__)
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 #define DELTA(x,y)      ((y)-(x)+((y)<(x)?1193182/HZ:0))
 #define GET_TIME(x)     do { x = get_time_pit(); } while (0)
Index: linux-mips/drivers/input/joystick/analog.c
===================================================================
--- linux-mips.orig/drivers/input/joystick/analog.c
+++ linux-mips/drivers/input/joystick/analog.c
@@ -136,7 +136,7 @@ struct analog_port {
 
 #ifdef __i386__
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 #define GET_TIME(x)	do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)
 #define DELTA(x,y)	(cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0)))
Index: linux-mips/drivers/input/misc/pcspkr.c
===================================================================
--- linux-mips.orig/drivers/input/misc/pcspkr.c
+++ linux-mips/drivers/input/misc/pcspkr.c
@@ -27,7 +27,7 @@ MODULE_ALIAS("platform:pcspkr");
 
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 #else
 #include <asm/8253pit.h>
 static DEFINE_RAW_SPINLOCK(i8253_lock);
Index: linux-mips/sound/drivers/pcsp/pcsp.h
===================================================================
--- linux-mips.orig/sound/drivers/pcsp/pcsp.h
+++ linux-mips/sound/drivers/pcsp/pcsp.h
@@ -13,7 +13,7 @@
 #include <linux/timex.h>
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 #else
 #include <asm/8253pit.h>
 static DEFINE_RAW_SPINLOCK(i8253_lock);



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 02/14] i8253: Unify all kernel declarations of i8253_lock in <linux/i8253.h>.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
@ 2011-06-01 18:04   ` ralf at linux-mips.org
  2011-06-01 18:04   ` ralf at linux-mips.org
                     ` (13 subsequent siblings)
  14 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Russell King, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	linux-arm-kernel, linux-mips

[-- Attachment #1: i8253-move-common-declarations-to-new-header.patch --]
[-- Type: text/plain, Size: 3142 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org

 arch/arm/include/asm/i8253.h  |    9 ---------
 arch/mips/include/asm/i8253.h |   12 ------------
 arch/x86/include/asm/i8253.h  |   10 ----------
 include/linux/i8253.h         |   14 ++++++++++++++
 4 files changed, 14 insertions(+), 31 deletions(-)

Index: linux-mips/include/linux/i8253.h
===================================================================
--- linux-mips.orig/include/linux/i8253.h
+++ linux-mips/include/linux/i8253.h
@@ -2,10 +2,24 @@
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
+ *
+ *  Machine specific IO port address definition for generic.
+ *  Written by Osamu Tomita <tomita@cinet.co.jp>
  */
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/spinlock.h>
 #include <asm/i8253.h>
 
+/* i8253A PIT registers */
+#define PIT_MODE	0x43
+#define PIT_CH0		0x40
+#define PIT_CH2		0x42
+
+#define inb_pit         inb_p
+#define outb_pit        outb_p
+
+extern raw_spinlock_t i8253_lock;
+
 #endif /* __LINUX_I8253_H */
Index: linux-mips/arch/arm/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/arm/include/asm/i8253.h
+++ linux-mips/arch/arm/include/asm/i8253.h
@@ -1,15 +1,6 @@
 #ifndef __ASMARM_I8253_H
 #define __ASMARM_I8253_H
 
-/* i8253A PIT registers */
-#define PIT_MODE	0x43
-#define PIT_CH0		0x40
-
 #define PIT_LATCH	((PIT_TICK_RATE + HZ / 2) / HZ)
 
-extern raw_spinlock_t i8253_lock;
-
-#define outb_pit	outb_p
-#define inb_pit		inb_p
-
 #endif
Index: linux-mips/arch/mips/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/mips/include/asm/i8253.h
+++ linux-mips/arch/mips/include/asm/i8253.h
@@ -5,20 +5,8 @@
 #ifndef __ASM_I8253_H
 #define __ASM_I8253_H
 
-#include <linux/spinlock.h>
-
-/* i8253A PIT registers */
-#define PIT_MODE		0x43
-#define PIT_CH0			0x40
-#define PIT_CH2			0x42
-
 #define PIT_LATCH		LATCH
 
-extern raw_spinlock_t i8253_lock;
-
 extern void setup_pit_timer(void);
 
-#define inb_pit inb_p
-#define outb_pit outb_p
-
 #endif /* __ASM_I8253_H */
Index: linux-mips/arch/x86/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/i8253.h
+++ linux-mips/arch/x86/include/asm/i8253.h
@@ -1,20 +1,10 @@
 #ifndef _ASM_X86_I8253_H
 #define _ASM_X86_I8253_H
 
-/* i8253A PIT registers */
-#define PIT_MODE		0x43
-#define PIT_CH0			0x40
-#define PIT_CH2			0x42
-
 #define PIT_LATCH	LATCH
 
-extern raw_spinlock_t i8253_lock;
-
 extern struct clock_event_device *global_clock_event;
 
 extern void setup_pit_timer(void);
 
-#define inb_pit		inb_p
-#define outb_pit	outb_p
-
 #endif /* _ASM_X86_I8253_H */



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 02/14] i8253: Unify all kernel declarations of i8253_lock in <linux/i8253.h>.
@ 2011-06-01 18:04   ` ralf at linux-mips.org
  0 siblings, 0 replies; 60+ messages in thread
From: ralf at linux-mips.org @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: i8253-move-common-declarations-to-new-header.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110601/66c86a24/attachment.ksh>

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
  2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
  2011-06-01 18:04   ` ralf at linux-mips.org
@ 2011-06-01 18:04 ` ralf
  2011-06-09 11:17   ` [tip:timers/cleanup] i8253: Consolidate all kernel definitions of i8253_lock tip-bot for Ralf Baechle
  2011-06-09 13:04   ` tip-bot for Ralf Baechle
  2011-06-01 18:05 ` [patch 04/14] i8253: Make MIPS use the shared i8253_lock ralf
                   ` (11 subsequent siblings)
  14 siblings, 2 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch

[-- Attachment #1: i8253-add-shared-lock.patch --]
[-- Type: text/plain, Size: 1635 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org

 lib/Kconfig      |    6 ++++++
 lib/Makefile     |    1 +
 lib/i8253-lock.c |   11 +++++++++++
 3 files changed, 18 insertions(+)

Index: linux-i8253/lib/i8253-lock.c
===================================================================
--- /dev/null
+++ linux-i8253/lib/i8253-lock.c
@@ -0,0 +1,11 @@
+#include <linux/spinlock.h>
+#include <linux/module.h>
+
+/*
+ * Protects access to I/O ports
+ *
+ * 0040-0043 : timer0, i8253 / i8254
+ * 0061-0061 : NMI Control Register which contains two speaker control bits.
+ */
+DEFINE_RAW_SPINLOCK(i8253_lock);
+EXPORT_SYMBOL(i8253_lock);
Index: linux-i8253/lib/Makefile
===================================================================
--- linux-i8253.orig/lib/Makefile
+++ linux-i8253/lib/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o 
 obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o
 obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
 obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
+obj-$(CONFIG_I8253_LOCK) += i8253-lock.o
 lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
 
Index: linux-i8253/lib/Kconfig
===================================================================
--- linux-i8253.orig/lib/Kconfig
+++ linux-i8253/lib/Kconfig
@@ -237,6 +237,12 @@ config CPU_RMAP
 	bool
 	depends on SMP
 
+config I8253_LOCK
+	bool
+	help
+	  Enable the shared lock for the i8253 PIT.  Any system that uses
+	  the i8253 should select this.
+
 #
 # Netlink attribute parsing support is select'ed if needed
 #



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 04/14] i8253: Make MIPS use the shared i8253_lock.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (2 preceding siblings ...)
  2011-06-01 18:04 ` [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05 ` [patch 05/14] i8253: Make x86 " ralf
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: linux-mips

[-- Attachment #1: i8253-move-mips-to-shared-lock.patch --]
[-- Type: text/plain, Size: 921 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org

 arch/mips/Kconfig        |    1 +
 arch/mips/kernel/i8253.c |    3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)

Index: linux-mips/arch/mips/Kconfig
===================================================================
--- linux-mips.orig/arch/mips/Kconfig
+++ linux-mips/arch/mips/Kconfig
@@ -2388,6 +2388,7 @@ config MMU
 config I8253
 	bool
 	select CLKSRC_I8253
+	select I8253_LOCK
 	select MIPS_EXTERNAL_TIMER
 
 config ZONE_DMA32
Index: linux-mips/arch/mips/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/mips/kernel/i8253.c
+++ linux-mips/arch/mips/kernel/i8253.c
@@ -16,9 +16,6 @@
 #include <asm/io.h>
 #include <asm/time.h>
 
-DEFINE_RAW_SPINLOCK(i8253_lock);
-EXPORT_SYMBOL(i8253_lock);
-
 /*
  * Initialize the PIT timer.
  *



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 05/14] i8253: Make x86 use the shared i8253_lock.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (3 preceding siblings ...)
  2011-06-01 18:05 ` [patch 04/14] i8253: Make MIPS use the shared i8253_lock ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05 ` [patch 06/14] i8253: Make pcspkr input driver " ralf
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86

[-- Attachment #1: i8253-move-x86-to-shared-lock.patch --]
[-- Type: text/plain, Size: 1182 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org

 arch/x86/Kconfig        |    1 +
 arch/x86/kernel/i8253.c |    3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)

Index: linux-mips/arch/x86/Kconfig
===================================================================
--- linux-mips.orig/arch/x86/Kconfig
+++ linux-mips/arch/x86/Kconfig
@@ -67,6 +67,7 @@ config X86
 	select GENERIC_IRQ_PROBE
 	select GENERIC_PENDING_IRQ if SMP
 	select GENERIC_IRQ_SHOW
+	select I8253_LOCK
 	select IRQ_FORCED_THREADING
 	select USE_GENERIC_SMP_HELPERS if SMP
 	select HAVE_BPF_JIT if (X86_64 && NET)
Index: linux-mips/arch/x86/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/i8253.c
+++ linux-mips/arch/x86/kernel/i8253.c
@@ -16,9 +16,6 @@
 #include <asm/hpet.h>
 #include <asm/smp.h>
 
-DEFINE_RAW_SPINLOCK(i8253_lock);
-EXPORT_SYMBOL(i8253_lock);
-
 /*
  * HPET replaces the PIT, when enabled. So we need to know, which of
  * the two timers is used



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 06/14] i8253: Make pcspkr input driver use the shared i8253_lock.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (4 preceding siblings ...)
  2011-06-01 18:05 ` [patch 05/14] i8253: Make x86 " ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-09 11:17   ` [tip:timers/cleanup] " tip-bot for Ralf Baechle
  2011-06-09 13:05   ` tip-bot for Ralf Baechle
  2011-06-01 18:05   ` ralf
                   ` (8 subsequent siblings)
  14 siblings, 2 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: Dmitry Torokhov, linux-input

[-- Attachment #1: i8253-move-pcspkr.c-to-shared-lock.patch --]
[-- Type: text/plain, Size: 1091 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org

 drivers/input/misc/pcspkr.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Index: linux-mips/drivers/input/misc/pcspkr.c
===================================================================
--- linux-mips.orig/drivers/input/misc/pcspkr.c
+++ linux-mips/drivers/input/misc/pcspkr.c
@@ -14,6 +14,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/platform_device.h>
@@ -25,14 +26,6 @@ MODULE_DESCRIPTION("PC Speaker beeper dr
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pcspkr");
 
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
-#include <linux/i8253.h>
-#else
-#include <asm/8253pit.h>
-static DEFINE_RAW_SPINLOCK(i8253_lock);
-#endif
-
 static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
 	unsigned int count = 0;



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 07/14] i8253: Make pcsp sound driver use the shared i8253_lock.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
@ 2011-06-01 18:05   ` ralf
  2011-06-01 18:04   ` ralf at linux-mips.org
                     ` (13 subsequent siblings)
  14 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel

[-- Attachment #1: i8253-move-sound-pcsp-to-shared-lock.patch --]
[-- Type: text/plain, Size: 864 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org

 sound/drivers/pcsp/pcsp.h |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Index: linux-mips/sound/drivers/pcsp/pcsp.h
===================================================================
--- linux-mips.orig/sound/drivers/pcsp/pcsp.h
+++ linux-mips/sound/drivers/pcsp/pcsp.h
@@ -10,14 +10,8 @@
 #define __PCSP_H__
 
 #include <linux/hrtimer.h>
-#include <linux/timex.h>
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
 #include <linux/i8253.h>
-#else
-#include <asm/8253pit.h>
-static DEFINE_RAW_SPINLOCK(i8253_lock);
-#endif
+#include <linux/timex.h>
 
 #define PCSP_SOUND_VERSION 0x400	/* read 4.00 */
 #define PCSP_DEBUG 0



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 07/14] i8253: Make pcsp sound driver use the shared i8253_lock.
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: Takashi Iwai, alsa-devel

[-- Attachment #1: i8253-move-sound-pcsp-to-shared-lock.patch --]
[-- Type: text/plain, Size: 862 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org

 sound/drivers/pcsp/pcsp.h |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Index: linux-mips/sound/drivers/pcsp/pcsp.h
===================================================================
--- linux-mips.orig/sound/drivers/pcsp/pcsp.h
+++ linux-mips/sound/drivers/pcsp/pcsp.h
@@ -10,14 +10,8 @@
 #define __PCSP_H__
 
 #include <linux/hrtimer.h>
-#include <linux/timex.h>
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
 #include <linux/i8253.h>
-#else
-#include <asm/8253pit.h>
-static DEFINE_RAW_SPINLOCK(i8253_lock);
-#endif
+#include <linux/timex.h>
 
 #define PCSP_SOUND_VERSION 0x400	/* read 4.00 */
 #define PCSP_DEBUG 0

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 08/14] i8253: Alpha: Cleanup remaining users of i8253pit.h
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (6 preceding siblings ...)
  2011-06-01 18:05   ` ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-09 11:19   ` [tip:timers/cleanup] alpha: i8253: " tip-bot for Ralf Baechle
  2011-06-09 13:06   ` tip-bot for Ralf Baechle
  2011-06-01 18:05   ` ralf
                   ` (6 subsequent siblings)
  14 siblings, 2 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha

[-- Attachment #1: i8253-cleanup-remaining-alpha-users-of-8253pit.h.patch --]
[-- Type: text/plain, Size: 1196 bytes --]

The Alpha <asm/i8253pit.h> header is empty so this inclusion can just be
removed.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-alpha@vger.kernel.org

 arch/alpha/kernel/sys_ruffian.c |    1 -
 arch/alpha/kernel/time.c        |    1 -
 2 files changed, 2 deletions(-)

Index: linux-mips/arch/alpha/kernel/sys_ruffian.c
===================================================================
--- linux-mips.orig/arch/alpha/kernel/sys_ruffian.c
+++ linux-mips/arch/alpha/kernel/sys_ruffian.c
@@ -26,7 +26,6 @@
 #include <asm/pgtable.h>
 #include <asm/core_cia.h>
 #include <asm/tlbflush.h>
-#include <asm/8253pit.h>
 
 #include "proto.h"
 #include "irq_impl.h"
Index: linux-mips/arch/alpha/kernel/time.c
===================================================================
--- linux-mips.orig/arch/alpha/kernel/time.c
+++ linux-mips/arch/alpha/kernel/time.c
@@ -46,7 +46,6 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/hwrpb.h>
-#include <asm/8253pit.h>
 #include <asm/rtc.h>
 
 #include <linux/mc146818rtc.h>



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
@ 2011-06-01 18:05   ` ralf
  2011-06-01 18:04   ` ralf at linux-mips.org
                     ` (13 subsequent siblings)
  14 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev

[-- Attachment #1: i8253-remove-unused-8253pit.h-files.patch --]
[-- Type: text/plain, Size: 1006 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-alpha@vger.kernel.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org

 arch/alpha/include/asm/8253pit.h   |    3 ---
 arch/powerpc/include/asm/8253pit.h |    3 ---
 2 files changed, 6 deletions(-)

Index: linux-mips/arch/alpha/include/asm/8253pit.h
===================================================================
--- linux-mips.orig/arch/alpha/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */
Index: linux-mips/arch/powerpc/include/asm/8253pit.h
===================================================================
--- linux-mips.orig/arch/powerpc/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header.
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Ivan Kokshaysky, linux-alpha, Paul Mackerras, Matt Turner,
	linuxppc-dev, Richard Henderson

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-alpha@vger.kernel.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org

 arch/alpha/include/asm/8253pit.h   |    3 ---
 arch/powerpc/include/asm/8253pit.h |    3 ---
 2 files changed, 6 deletions(-)

Index: linux-mips/arch/alpha/include/asm/8253pit.h
===================================================================
--- linux-mips.orig/arch/alpha/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */
Index: linux-mips/arch/powerpc/include/asm/8253pit.h
===================================================================
--- linux-mips.orig/arch/powerpc/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 10/14] i8253: x86: Consolidate definitions of global_clock_event
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (8 preceding siblings ...)
  2011-06-01 18:05   ` ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-09 11:19   ` [tip:timers/cleanup] x86: i8253: " tip-bot for Ralf Baechle
  2011-06-09 13:07   ` tip-bot for Ralf Baechle
  2011-06-01 18:05   ` ralf
                   ` (4 subsequent siblings)
  14 siblings, 2 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Venkatesh Pallipadi (Venki)

[-- Attachment #1: i8253-cleanup-x86-global_clock_event.patch --]
[-- Type: text/plain, Size: 3677 bytes --]

There are multiple declarations of global_clock_event in header files
specific to particular clock event implementatiosn.  Consolidate them
in <asm/time.h> and make sure all users include that header.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: "Venkatesh Pallipadi (Venki)" <venki@google.com>

 arch/x86/include/asm/apb_timer.h |    1 -
 arch/x86/include/asm/i8253.h     |    2 --
 arch/x86/include/asm/time.h      |    6 ++++--
 arch/x86/kernel/apb_timer.c      |    1 +
 arch/x86/kernel/apic/apic.c      |    1 +
 arch/x86/kernel/hpet.c           |    1 +
 arch/x86/kernel/i8253.c          |    1 +
 7 files changed, 8 insertions(+), 5 deletions(-)

Index: linux-mips/arch/x86/include/asm/apb_timer.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/apb_timer.h
+++ linux-mips/arch/x86/include/asm/apb_timer.h
@@ -50,7 +50,6 @@
 #define APBT_DEV_USED  1
 
 extern void apbt_time_init(void);
-extern struct clock_event_device *global_clock_event;
 extern unsigned long apbt_quick_calibrate(void);
 extern int arch_setup_apbt_irqs(int irq, int trigger, int mask, int cpu);
 extern void apbt_setup_secondary_clock(void);
Index: linux-mips/arch/x86/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/i8253.h
+++ linux-mips/arch/x86/include/asm/i8253.h
@@ -3,8 +3,6 @@
 
 #define PIT_LATCH	LATCH
 
-extern struct clock_event_device *global_clock_event;
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
Index: linux-mips/arch/x86/include/asm/time.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/time.h
+++ linux-mips/arch/x86/include/asm/time.h
@@ -1,10 +1,12 @@
 #ifndef _ASM_X86_TIME_H
 #define _ASM_X86_TIME_H
 
-extern void hpet_time_init(void);
-
+#include <linux/clocksource.h>
 #include <asm/mc146818rtc.h>
 
+extern void hpet_time_init(void);
 extern void time_init(void);
 
+extern struct clock_event_device *global_clock_event;
+
 #endif /* _ASM_X86_TIME_H */
Index: linux-mips/arch/x86/kernel/apb_timer.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apb_timer.c
+++ linux-mips/arch/x86/kernel/apb_timer.c
@@ -44,6 +44,7 @@
 #include <asm/fixmap.h>
 #include <asm/apb_timer.h>
 #include <asm/mrst.h>
+#include <asm/time.h>
 
 #define APBT_MASK			CLOCKSOURCE_MASK(32)
 #define APBT_SHIFT			22
Index: linux-mips/arch/x86/kernel/apic/apic.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apic/apic.c
+++ linux-mips/arch/x86/kernel/apic/apic.c
@@ -48,6 +48,7 @@
 #include <asm/hpet.h>
 #include <asm/idle.h>
 #include <asm/mtrr.h>
+#include <asm/time.h>
 #include <asm/smp.h>
 #include <asm/mce.h>
 #include <asm/tsc.h>
Index: linux-mips/arch/x86/kernel/hpet.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/hpet.c
+++ linux-mips/arch/x86/kernel/hpet.c
@@ -14,6 +14,7 @@
 
 #include <asm/fixmap.h>
 #include <asm/hpet.h>
+#include <asm/time.h>
 
 #define HPET_MASK			CLOCKSOURCE_MASK(32)
 
Index: linux-mips/arch/x86/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/i8253.c
+++ linux-mips/arch/x86/kernel/i8253.c
@@ -14,6 +14,7 @@
 #include <linux/io.h>
 
 #include <asm/hpet.h>
+#include <asm/time.h>
 #include <asm/smp.h>
 
 /*



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 11/14] i8253: Consolidate definitions of PIT_LATCH
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
  2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
@ 2011-06-01 18:05   ` ralf
  2011-06-01 18:04 ` [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c ralf
                     ` (12 subsequent siblings)
  14 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Russell King, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	linux-arm-kernel, linux-mips

[-- Attachment #1: i8253-sort-out-pit_latch-definitions.patch --]
[-- Type: text/plain, Size: 2715 bytes --]

x86 defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as PIT_TICK_RATE.

MIPS defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as 1193182.

ARM defines PITCH_LATCH as ((PIT_TICK_RATE + HZ / 2) / HZ) - and that's
the sanest thing and equivalent to above definitions so use that as the
new definition in <linux/i8253.h>.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org

 arch/arm/include/asm/i8253.h  |    2 --
 arch/mips/include/asm/i8253.h |    2 --
 arch/x86/include/asm/i8253.h  |    2 --
 include/linux/i8253.h         |    4 ++++
 4 files changed, 4 insertions(+), 6 deletions(-)

Index: linux-mips/arch/arm/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/arm/include/asm/i8253.h
+++ linux-mips/arch/arm/include/asm/i8253.h
@@ -1,6 +1,4 @@
 #ifndef __ASMARM_I8253_H
 #define __ASMARM_I8253_H
 
-#define PIT_LATCH	((PIT_TICK_RATE + HZ / 2) / HZ)
-
 #endif
Index: linux-mips/arch/mips/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/mips/include/asm/i8253.h
+++ linux-mips/arch/mips/include/asm/i8253.h
@@ -5,8 +5,6 @@
 #ifndef __ASM_I8253_H
 #define __ASM_I8253_H
 
-#define PIT_LATCH		LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* __ASM_I8253_H */
Index: linux-mips/arch/x86/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/i8253.h
+++ linux-mips/arch/x86/include/asm/i8253.h
@@ -1,8 +1,6 @@
 #ifndef _ASM_X86_I8253_H
 #define _ASM_X86_I8253_H
 
-#define PIT_LATCH	LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
Index: linux-mips/include/linux/i8253.h
===================================================================
--- linux-mips.orig/include/linux/i8253.h
+++ linux-mips/include/linux/i8253.h
@@ -9,7 +9,9 @@
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/param.h>
 #include <linux/spinlock.h>
+#include <linux/timex.h>
 #include <asm/i8253.h>
 
 /* i8253A PIT registers */
@@ -17,6 +19,8 @@
 #define PIT_CH0		0x40
 #define PIT_CH2		0x42
 
+#define PIT_LATCH	((PIT_TICK_RATE + HZ/2) / HZ)
+
 #define inb_pit         inb_p
 #define outb_pit        outb_p
 



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 11/14] i8253: Consolidate definitions of PIT_LATCH
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: linux-mips, Russell King, x86, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner, linux-arm-kernel

[-- Attachment #1: i8253-sort-out-pit_latch-definitions.patch --]
[-- Type: text/plain, Size: 2711 bytes --]

x86 defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as PIT_TICK_RATE.

MIPS defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as 1193182.

ARM defines PITCH_LATCH as ((PIT_TICK_RATE + HZ / 2) / HZ) - and that's
the sanest thing and equivalent to above definitions so use that as the
new definition in <linux/i8253.h>.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org

 arch/arm/include/asm/i8253.h  |    2 --
 arch/mips/include/asm/i8253.h |    2 --
 arch/x86/include/asm/i8253.h  |    2 --
 include/linux/i8253.h         |    4 ++++
 4 files changed, 4 insertions(+), 6 deletions(-)

Index: linux-mips/arch/arm/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/arm/include/asm/i8253.h
+++ linux-mips/arch/arm/include/asm/i8253.h
@@ -1,6 +1,4 @@
 #ifndef __ASMARM_I8253_H
 #define __ASMARM_I8253_H
 
-#define PIT_LATCH	((PIT_TICK_RATE + HZ / 2) / HZ)
-
 #endif
Index: linux-mips/arch/mips/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/mips/include/asm/i8253.h
+++ linux-mips/arch/mips/include/asm/i8253.h
@@ -5,8 +5,6 @@
 #ifndef __ASM_I8253_H
 #define __ASM_I8253_H
 
-#define PIT_LATCH		LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* __ASM_I8253_H */
Index: linux-mips/arch/x86/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/i8253.h
+++ linux-mips/arch/x86/include/asm/i8253.h
@@ -1,8 +1,6 @@
 #ifndef _ASM_X86_I8253_H
 #define _ASM_X86_I8253_H
 
-#define PIT_LATCH	LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
Index: linux-mips/include/linux/i8253.h
===================================================================
--- linux-mips.orig/include/linux/i8253.h
+++ linux-mips/include/linux/i8253.h
@@ -9,7 +9,9 @@
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/param.h>
 #include <linux/spinlock.h>
+#include <linux/timex.h>
 #include <asm/i8253.h>
 
 /* i8253A PIT registers */
@@ -17,6 +19,8 @@
 #define PIT_CH0		0x40
 #define PIT_CH2		0x42
 
+#define PIT_LATCH	((PIT_TICK_RATE + HZ/2) / HZ)
+
 #define inb_pit         inb_p
 #define outb_pit        outb_p

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 11/14] i8253: Consolidate definitions of PIT_LATCH
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 60+ messages in thread
From: ralf at linux-mips.org @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: i8253-sort-out-pit_latch-definitions.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110601/dca93b95/attachment.ksh>

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h>
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
  2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
@ 2011-06-01 18:05   ` ralf
  2011-06-01 18:04 ` [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c ralf
                     ` (12 subsequent siblings)
  14 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: linux-arm-kernel, Russell King, linux-mips, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86

[-- Attachment #1: i8253-sort-remaining-definitions.patch --]
[-- Type: text/plain, Size: 3094 bytes --]

There is no really good other place but one line for two out of three
architectures that have a <asm/i8253.h> file doesn't justify this files
existence.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-mips@linux-mips.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org

 arch/arm/include/asm/i8253.h  |    4 ----
 arch/mips/include/asm/i8253.h |   10 ----------
 arch/mips/include/asm/time.h  |    5 +++++
 arch/x86/include/asm/i8253.h  |    6 ------
 arch/x86/include/asm/time.h   |    1 +
 include/linux/i8253.h         |    1 -
 6 files changed, 6 insertions(+), 21 deletions(-)

Index: linux-i8253/arch/x86/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/x86/include/asm/i8253.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_X86_I8253_H
-#define _ASM_X86_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* _ASM_X86_I8253_H */
Index: linux-i8253/include/linux/i8253.h
===================================================================
--- linux-i8253.orig/include/linux/i8253.h
+++ linux-i8253/include/linux/i8253.h
@@ -12,7 +12,6 @@
 #include <linux/param.h>
 #include <linux/spinlock.h>
 #include <linux/timex.h>
-#include <asm/i8253.h>
 
 /* i8253A PIT registers */
 #define PIT_MODE	0x43
Index: linux-i8253/arch/x86/include/asm/time.h
===================================================================
--- linux-i8253.orig/arch/x86/include/asm/time.h
+++ linux-i8253/arch/x86/include/asm/time.h
@@ -6,6 +6,7 @@
 
 extern void hpet_time_init(void);
 extern void time_init(void);
+extern void setup_pit_timer(void);
 
 extern struct clock_event_device *global_clock_event;
 
Index: linux-i8253/arch/mips/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/mips/include/asm/i8253.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  Machine specific IO port address definition for generic.
- *  Written by Osamu Tomita <tomita@cinet.co.jp>
- */
-#ifndef __ASM_I8253_H
-#define __ASM_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* __ASM_I8253_H */
Index: linux-i8253/arch/arm/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/arm/include/asm/i8253.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __ASMARM_I8253_H
-#define __ASMARM_I8253_H
-
-#endif
Index: linux-i8253/arch/mips/include/asm/time.h
===================================================================
--- linux-i8253.orig/arch/mips/include/asm/time.h
+++ linux-i8253/arch/mips/include/asm/time.h
@@ -36,6 +36,11 @@ extern int rtc_mips_set_mmss(unsigned lo
 extern void plat_time_init(void);
 
 /*
+ * Initialize i8253 / i8254 PIT clockevent device.
+ */
+extern void setup_pit_timer(void);
+
+/*
  * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
  * counter as a timer interrupt source.
  */



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h>
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: linux-mips, Russell King, x86, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner, linux-arm-kernel

[-- Attachment #1: i8253-sort-remaining-definitions.patch --]
[-- Type: text/plain, Size: 3092 bytes --]

There is no really good other place but one line for two out of three
architectures that have a <asm/i8253.h> file doesn't justify this files
existence.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-mips@linux-mips.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org

 arch/arm/include/asm/i8253.h  |    4 ----
 arch/mips/include/asm/i8253.h |   10 ----------
 arch/mips/include/asm/time.h  |    5 +++++
 arch/x86/include/asm/i8253.h  |    6 ------
 arch/x86/include/asm/time.h   |    1 +
 include/linux/i8253.h         |    1 -
 6 files changed, 6 insertions(+), 21 deletions(-)

Index: linux-i8253/arch/x86/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/x86/include/asm/i8253.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_X86_I8253_H
-#define _ASM_X86_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* _ASM_X86_I8253_H */
Index: linux-i8253/include/linux/i8253.h
===================================================================
--- linux-i8253.orig/include/linux/i8253.h
+++ linux-i8253/include/linux/i8253.h
@@ -12,7 +12,6 @@
 #include <linux/param.h>
 #include <linux/spinlock.h>
 #include <linux/timex.h>
-#include <asm/i8253.h>
 
 /* i8253A PIT registers */
 #define PIT_MODE	0x43
Index: linux-i8253/arch/x86/include/asm/time.h
===================================================================
--- linux-i8253.orig/arch/x86/include/asm/time.h
+++ linux-i8253/arch/x86/include/asm/time.h
@@ -6,6 +6,7 @@
 
 extern void hpet_time_init(void);
 extern void time_init(void);
+extern void setup_pit_timer(void);
 
 extern struct clock_event_device *global_clock_event;
 
Index: linux-i8253/arch/mips/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/mips/include/asm/i8253.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  Machine specific IO port address definition for generic.
- *  Written by Osamu Tomita <tomita@cinet.co.jp>
- */
-#ifndef __ASM_I8253_H
-#define __ASM_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* __ASM_I8253_H */
Index: linux-i8253/arch/arm/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/arm/include/asm/i8253.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __ASMARM_I8253_H
-#define __ASMARM_I8253_H
-
-#endif
Index: linux-i8253/arch/mips/include/asm/time.h
===================================================================
--- linux-i8253.orig/arch/mips/include/asm/time.h
+++ linux-i8253/arch/mips/include/asm/time.h
@@ -36,6 +36,11 @@ extern int rtc_mips_set_mmss(unsigned lo
 extern void plat_time_init(void);
 
 /*
+ * Initialize i8253 / i8254 PIT clockevent device.
+ */
+extern void setup_pit_timer(void);
+
+/*
  * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
  * counter as a timer interrupt source.
  */

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h>
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 60+ messages in thread
From: ralf at linux-mips.org @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-arm-kernel

An embedded and charset-unspecified text was scrubbed...
Name: i8253-sort-remaining-definitions.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110601/a1bf7239/attachment.ksh>

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 13/14] PCSPKR: Cleanup Kconfig dependencies
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
@ 2011-06-01 18:05   ` ralf
  2011-06-01 18:04   ` ralf at linux-mips.org
                     ` (13 subsequent siblings)
  14 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner,
	Benjamin Herrenschmidt, Paul Mackerras, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86, linux-alpha, linux-mips,
	linuxppc-dev

[-- Attachment #1: i8253-use-aux-symbol-for-pcspkr-config.patch --]
[-- Type: text/plain, Size: 4160 bytes --]

Lenghty lists of the kind "depends on ARCH1 || ARCH2 ... || ARCH123" are
usually either wrong or too coarse grained.  Or plain an ugly sin.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-alpha@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linuxppc-dev@lists.ozlabs.org

 arch/alpha/Kconfig                     |    1 +
 arch/mips/Kconfig                      |    1 +
 arch/powerpc/platforms/chrp/Kconfig    |    1 +
 arch/powerpc/platforms/prep/Kconfig    |    1 +
 arch/powerpc/platforms/pseries/Kconfig |    1 +
 arch/x86/Kconfig                       |    1 +
 init/Kconfig                           |    5 ++++-
 7 files changed, 10 insertions(+), 1 deletion(-)

Index: linux-mips/arch/alpha/Kconfig
===================================================================
--- linux-mips.orig/arch/alpha/Kconfig
+++ linux-mips/arch/alpha/Kconfig
@@ -6,6 +6,7 @@ config ALPHA
 	select HAVE_OPROFILE
 	select HAVE_SYSCALL_WRAPPERS
 	select HAVE_IRQ_WORK
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_DMA_ATTRS
 	select HAVE_GENERIC_HARDIRQS
Index: linux-mips/arch/mips/Kconfig
===================================================================
--- linux-mips.orig/arch/mips/Kconfig
+++ linux-mips/arch/mips/Kconfig
@@ -5,6 +5,7 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
Index: linux-mips/arch/powerpc/platforms/chrp/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/chrp/Kconfig
+++ linux-mips/arch/powerpc/platforms/chrp/Kconfig
@@ -1,6 +1,7 @@
 config PPC_CHRP
 	bool "Common Hardware Reference Platform (CHRP) based machines"
 	depends on 6xx
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PPC_I8259
 	select PPC_INDIRECT_PCI
Index: linux-mips/arch/powerpc/platforms/prep/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/prep/Kconfig
+++ linux-mips/arch/powerpc/platforms/prep/Kconfig
@@ -1,6 +1,7 @@
 config PPC_PREP
 	bool "PowerPC Reference Platform (PReP) based machines"
 	depends on 6xx && BROKEN
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PPC_I8259
 	select PPC_INDIRECT_PCI
Index: linux-mips/arch/powerpc/platforms/pseries/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/pseries/Kconfig
+++ linux-mips/arch/powerpc/platforms/pseries/Kconfig
@@ -1,6 +1,7 @@
 config PPC_PSERIES
 	depends on PPC64 && PPC_BOOK3S
 	bool "IBM pSeries & new (POWER5-based) iSeries"
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PCI_MSI
 	select PPC_XICS
Index: linux-mips/arch/x86/Kconfig
===================================================================
--- linux-mips.orig/arch/x86/Kconfig
+++ linux-mips/arch/x86/Kconfig
@@ -20,6 +20,7 @@ config X86
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select HAVE_IDE
 	select HAVE_OPROFILE
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_IRQ_WORK
 	select HAVE_IOREMAP_PROT
Index: linux-mips/init/Kconfig
===================================================================
--- linux-mips.orig/init/Kconfig
+++ linux-mips/init/Kconfig
@@ -1001,12 +1001,15 @@ config ELF_CORE
 
 config PCSPKR_PLATFORM
 	bool "Enable PC-Speaker support" if EXPERT
-	depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
+	depends on HAVE_PCSPKR_PLATFORM
 	default y
 	help
           This option allows to disable the internal PC-Speaker
           support, saving some memory.
 
+config HAVE_PCSPKR_PLATFORM
+	bool
+
 config BASE_FULL
 	default y
 	bool "Enable full-sized data structures for core" if EXPERT



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 13/14] PCSPKR: Cleanup Kconfig dependencies
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: linux-mips, linux-alpha, x86, Ingo Molnar, Ivan Kokshaysky,
	H. Peter Anvin, Paul Mackerras, Matt Turner, linuxppc-dev,
	Thomas Gleixner, Richard Henderson

Lenghty lists of the kind "depends on ARCH1 || ARCH2 ... || ARCH123" are
usually either wrong or too coarse grained.  Or plain an ugly sin.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-alpha@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linuxppc-dev@lists.ozlabs.org

 arch/alpha/Kconfig                     |    1 +
 arch/mips/Kconfig                      |    1 +
 arch/powerpc/platforms/chrp/Kconfig    |    1 +
 arch/powerpc/platforms/prep/Kconfig    |    1 +
 arch/powerpc/platforms/pseries/Kconfig |    1 +
 arch/x86/Kconfig                       |    1 +
 init/Kconfig                           |    5 ++++-
 7 files changed, 10 insertions(+), 1 deletion(-)

Index: linux-mips/arch/alpha/Kconfig
===================================================================
--- linux-mips.orig/arch/alpha/Kconfig
+++ linux-mips/arch/alpha/Kconfig
@@ -6,6 +6,7 @@ config ALPHA
 	select HAVE_OPROFILE
 	select HAVE_SYSCALL_WRAPPERS
 	select HAVE_IRQ_WORK
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_DMA_ATTRS
 	select HAVE_GENERIC_HARDIRQS
Index: linux-mips/arch/mips/Kconfig
===================================================================
--- linux-mips.orig/arch/mips/Kconfig
+++ linux-mips/arch/mips/Kconfig
@@ -5,6 +5,7 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
Index: linux-mips/arch/powerpc/platforms/chrp/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/chrp/Kconfig
+++ linux-mips/arch/powerpc/platforms/chrp/Kconfig
@@ -1,6 +1,7 @@
 config PPC_CHRP
 	bool "Common Hardware Reference Platform (CHRP) based machines"
 	depends on 6xx
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PPC_I8259
 	select PPC_INDIRECT_PCI
Index: linux-mips/arch/powerpc/platforms/prep/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/prep/Kconfig
+++ linux-mips/arch/powerpc/platforms/prep/Kconfig
@@ -1,6 +1,7 @@
 config PPC_PREP
 	bool "PowerPC Reference Platform (PReP) based machines"
 	depends on 6xx && BROKEN
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PPC_I8259
 	select PPC_INDIRECT_PCI
Index: linux-mips/arch/powerpc/platforms/pseries/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/pseries/Kconfig
+++ linux-mips/arch/powerpc/platforms/pseries/Kconfig
@@ -1,6 +1,7 @@
 config PPC_PSERIES
 	depends on PPC64 && PPC_BOOK3S
 	bool "IBM pSeries & new (POWER5-based) iSeries"
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PCI_MSI
 	select PPC_XICS
Index: linux-mips/arch/x86/Kconfig
===================================================================
--- linux-mips.orig/arch/x86/Kconfig
+++ linux-mips/arch/x86/Kconfig
@@ -20,6 +20,7 @@ config X86
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select HAVE_IDE
 	select HAVE_OPROFILE
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_IRQ_WORK
 	select HAVE_IOREMAP_PROT
Index: linux-mips/init/Kconfig
===================================================================
--- linux-mips.orig/init/Kconfig
+++ linux-mips/init/Kconfig
@@ -1001,12 +1001,15 @@ config ELF_CORE
 
 config PCSPKR_PLATFORM
 	bool "Enable PC-Speaker support" if EXPERT
-	depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
+	depends on HAVE_PCSPKR_PLATFORM
 	default y
 	help
           This option allows to disable the internal PC-Speaker
           support, saving some memory.
 
+config HAVE_PCSPKR_PLATFORM
+	bool
+
 config BASE_FULL
 	default y
 	bool "Enable full-sized data structures for core" if EXPERT

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (12 preceding siblings ...)
  2011-06-01 18:05   ` ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-09 11:21   ` [tip:timers/cleanup] pcpskr: " tip-bot for Ralf Baechle
  2011-06-09 13:09   ` tip-bot for Ralf Baechle
  2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
  14 siblings, 2 replies; 60+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: linux-mips

[-- Attachment #1: i8253-make-mips-pcspkr-config-finer-grained.patch --]
[-- Type: text/plain, Size: 1464 bytes --]

Only the Siemens-Nixdorf RM series workstations and the Jazz family
workstations have PC speakers built in; Malta can connect one via the
infamous AMR connector with an AMR sound card or a little creativity.
So we don't want to offer the PC speaker driver on all MIPS systems.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org

 arch/mips/Kconfig |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-mips/arch/mips/Kconfig
===================================================================
--- linux-mips.orig/arch/mips/Kconfig
+++ linux-mips/arch/mips/Kconfig
@@ -5,7 +5,6 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
-	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
@@ -186,6 +185,7 @@ config MACH_JAZZ
 	select CSRC_R4K
 	select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN
 	select GENERIC_ISA_DMA
+	select HAVE_PCSPKR_PLATFORM
 	select IRQ_CPU
 	select I8253
 	select I8259
@@ -267,6 +267,7 @@ config MIPS_MALTA
 	select CSRC_R4K
 	select DMA_NONCOHERENT
 	select GENERIC_ISA_DMA
+	select HAVE_PCSPKR_PLATFORM
 	select IRQ_CPU
 	select IRQ_GIC
 	select HW_HAS_PCI
@@ -641,6 +642,7 @@ config SNI_RM
 	select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN
 	select DMA_NONCOHERENT
 	select GENERIC_ISA_DMA
+	select HAVE_PCSPKR_PLATFORM
 	select HW_HAS_EISA
 	select HW_HAS_PCI
 	select IRQ_CPU



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h>
  2011-06-01 18:05   ` ralf
@ 2011-06-02 11:29     ` Sergei Shtylyov
  -1 siblings, 0 replies; 60+ messages in thread
From: Sergei Shtylyov @ 2011-06-02 11:29 UTC (permalink / raw)
  To: ralf
  Cc: linux-kernel, linux-arch, linux-mips, Russell King, x86,
	Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-arm-kernel

Hello.

On 01-06-2011 22:05, ralf@linux-mips.org wrote:

> There is no really good other place but one line for two out of three
> architectures that have a <asm/i8253.h> file doesn't justify this files
> existence.

    I couldn't parse that. :-)

> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: linux-mips@linux-mips.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org

WBR, Sergei

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h>
@ 2011-06-02 11:29     ` Sergei Shtylyov
  0 siblings, 0 replies; 60+ messages in thread
From: Sergei Shtylyov @ 2011-06-02 11:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 01-06-2011 22:05, ralf at linux-mips.org wrote:

> There is no really good other place but one line for two out of three
> architectures that have a <asm/i8253.h> file doesn't justify this files
> existence.

    I couldn't parse that. :-)

> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: linux-mips at linux-mips.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86 at kernel.org

WBR, Sergei

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (13 preceding siblings ...)
  2011-06-01 18:05 ` [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained ralf
@ 2011-06-02 19:11 ` Gerhard Pircher
  2011-06-03 18:00     ` Ralf Baechle
  14 siblings, 1 reply; 60+ messages in thread
From: Gerhard Pircher @ 2011-06-02 19:11 UTC (permalink / raw)
  To: ralf, linux-mips, linuxppc-dev, linux-alpha, linux-arch, linux-kernel


-------- Original-Nachricht --------
> Datum: Wed, 01 Jun 2011 19:04:56 +0100
> Von: ralf@linux-mips.org
> An: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mips@linux-mips.org
> Betreff: [patch 00/14] Sort out i8253 and PC speaker locking and headers

> No longer terribly relevant these days but still broken and just an
> eyesore mess of neglience just as I've already raised it a few days 
> ago.  Time to sort this.
> 
> drivers/input/misc/pcspkr.c:
> 
> #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> /* Use the global PIT lock ! */
> #include <asm/i8253.h>
> #else
> #include <asm/8253pit.h>
> static DEFINE_RAW_SPINLOCK(i8253_lock);
> #endif
> 
> sound/drivers/pcsp/pcsp.h:
> 
> #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> /* Use the global PIT lock ! */
> #include <asm/i8253.h>
> #else
> #include <asm/8253pit.h>
> static DEFINE_RAW_SPINLOCK(i8253_lock);
> 
> $ git grep -F pcsp.h sound/drivers/pcsp
> sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
> sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
> sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
> sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
> $ git grep -w i8253_lock sound/drivers/pcsp/
> sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
> sound/drivers/pcsp/pcsp_input.c:        raw_spin_lock_irqsave(&i8253_lock,
> flags
> sound/drivers/pcsp/pcsp_input.c:       
> raw_spin_unlock_irqrestore(&i8253_lock, 
> sound/drivers/pcsp/pcsp_lib.c:          raw_spin_lock_irqsave(&i8253_lock,
> flags
> sound/drivers/pcsp/pcsp_lib.c:         
> raw_spin_unlock_irqrestore(&i8253_lock, 
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> 
> Locks are great, everybody should have their own lock!
> 
> $ find . -name 8253pit.h
> ./arch/powerpc/include/asm/8253pit.h
> ./arch/alpha/include/asm/8253pit.h
> $ cat arch/*/include/asm/8253pit.h
> /*
>  * 8253/8254 Programmable Interval Timer
>  */
> /*
>  * 8253/8254 Programmable Interval Timer
>  */
> $
> 
> Eh...
> 
> $ git grep -w PCSPKR_PLATFORM 
> arch/mips/Kconfig:      select PCSPKR_PLATFORM
> arch/mips/Kconfig:      select PCSPKR_PLATFORM
> arch/mips/Kconfig:      select PCSPKR_PLATFORM
> arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
> drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
> init/Kconfig:config PCSPKR_PLATFORM
> sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 &&
> HIGH_RES_TIMERS
> 
> So the status is:
> 
>  Alpha:	There is no PCSPKR_PLATFORM so while a platform device is
> 		being installed no drivers will be built.  I don't know
> 		which Alpha platforms or even if all of Alpha should be
> 		doing a PCSPKR_PLATFORM so I haven't even tried to sort
> 		this.
>  ARM:		No PC speaker supported, yeah :)
>  PowerPC:	Should compile but the locking is wrong but only the 
>    		AmigaOne platforms should be affected.
The Kconfig dependencies cleanup patch for CHRP, PSERIES, etc. should
also apply to the AmigaOne. Can you resend it with a fix for the
AmigaOne, or should I send a patch?
I'll check next week, if the PC speaker is still working on my AmigaOne.

Thanks,
Gerhard

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [alsa-devel] [patch 07/14] i8253: Make pcsp sound driver use the shared i8253_lock.
  2011-06-01 18:05   ` ralf
@ 2011-06-03  9:53     ` Takashi Iwai
  -1 siblings, 0 replies; 60+ messages in thread
From: Takashi Iwai @ 2011-06-03  9:53 UTC (permalink / raw)
  To: ralf; +Cc: linux-kernel, linux-arch, alsa-devel

At Wed, 01 Jun 2011 19:05:03 +0100,
ralf@linux-mips.org wrote:
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: alsa-devel@alsa-project.org

Acked-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi

> 
>  sound/drivers/pcsp/pcsp.h |    8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> Index: linux-mips/sound/drivers/pcsp/pcsp.h
> ===================================================================
> --- linux-mips.orig/sound/drivers/pcsp/pcsp.h
> +++ linux-mips/sound/drivers/pcsp/pcsp.h
> @@ -10,14 +10,8 @@
>  #define __PCSP_H__
>  
>  #include <linux/hrtimer.h>
> -#include <linux/timex.h>
> -#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> -/* Use the global PIT lock ! */
>  #include <linux/i8253.h>
> -#else
> -#include <asm/8253pit.h>
> -static DEFINE_RAW_SPINLOCK(i8253_lock);
> -#endif
> +#include <linux/timex.h>
>  
>  #define PCSP_SOUND_VERSION 0x400	/* read 4.00 */
>  #define PCSP_DEBUG 0
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 07/14] i8253: Make pcsp sound driver use the shared i8253_lock.
@ 2011-06-03  9:53     ` Takashi Iwai
  0 siblings, 0 replies; 60+ messages in thread
From: Takashi Iwai @ 2011-06-03  9:53 UTC (permalink / raw)
  To: ralf; +Cc: linux-arch, alsa-devel, linux-kernel

At Wed, 01 Jun 2011 19:05:03 +0100,
ralf@linux-mips.org wrote:
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: alsa-devel@alsa-project.org

Acked-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi

> 
>  sound/drivers/pcsp/pcsp.h |    8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> Index: linux-mips/sound/drivers/pcsp/pcsp.h
> ===================================================================
> --- linux-mips.orig/sound/drivers/pcsp/pcsp.h
> +++ linux-mips/sound/drivers/pcsp/pcsp.h
> @@ -10,14 +10,8 @@
>  #define __PCSP_H__
>  
>  #include <linux/hrtimer.h>
> -#include <linux/timex.h>
> -#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> -/* Use the global PIT lock ! */
>  #include <linux/i8253.h>
> -#else
> -#include <asm/8253pit.h>
> -static DEFINE_RAW_SPINLOCK(i8253_lock);
> -#endif
> +#include <linux/timex.h>
>  
>  #define PCSP_SOUND_VERSION 0x400	/* read 4.00 */
>  #define PCSP_DEBUG 0
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers
  2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
@ 2011-06-03 18:00     ` Ralf Baechle
  0 siblings, 0 replies; 60+ messages in thread
From: Ralf Baechle @ 2011-06-03 18:00 UTC (permalink / raw)
  To: Gerhard Pircher
  Cc: linux-mips, linuxppc-dev, linux-alpha, linux-arch, linux-kernel,
	Thomas Gleixner, Benjamin Herrenschmidt

On Thu, Jun 02, 2011 at 09:11:19PM +0200, Gerhard Pircher wrote:

> > #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> > /* Use the global PIT lock ! */
> > #include <asm/i8253.h>
> > #else
> > #include <asm/8253pit.h>
> > static DEFINE_RAW_SPINLOCK(i8253_lock);
> > #endif
> > 
> > sound/drivers/pcsp/pcsp.h:
> > 
> > #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> > /* Use the global PIT lock ! */
> > #include <asm/i8253.h>
> > #else
> > #include <asm/8253pit.h>
> > static DEFINE_RAW_SPINLOCK(i8253_lock);
> > 
> > $ git grep -F pcsp.h sound/drivers/pcsp
> > sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
> > $ git grep -w i8253_lock sound/drivers/pcsp/
> > sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
> > sound/drivers/pcsp/pcsp_input.c:        raw_spin_lock_irqsave(&i8253_lock,
> > flags
> > sound/drivers/pcsp/pcsp_input.c:       
> > raw_spin_unlock_irqrestore(&i8253_lock, 
> > sound/drivers/pcsp/pcsp_lib.c:          raw_spin_lock_irqsave(&i8253_lock,
> > flags
> > sound/drivers/pcsp/pcsp_lib.c:         
> > raw_spin_unlock_irqrestore(&i8253_lock, 
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > 
> > Locks are great, everybody should have their own lock!
> > 
> > $ find . -name 8253pit.h
> > ./arch/powerpc/include/asm/8253pit.h
> > ./arch/alpha/include/asm/8253pit.h
> > $ cat arch/*/include/asm/8253pit.h
> > /*
> >  * 8253/8254 Programmable Interval Timer
> >  */
> > /*
> >  * 8253/8254 Programmable Interval Timer
> >  */
> > $
> > 
> > Eh...
> > 
> > $ git grep -w PCSPKR_PLATFORM 
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
> > drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
> > init/Kconfig:config PCSPKR_PLATFORM
> > sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 &&
> > HIGH_RES_TIMERS
> > 
> > So the status is:
> > 
> >  Alpha:	There is no PCSPKR_PLATFORM so while a platform device is
> > 		being installed no drivers will be built.  I don't know
> > 		which Alpha platforms or even if all of Alpha should be
> > 		doing a PCSPKR_PLATFORM so I haven't even tried to sort
> > 		this.
> >  ARM:		No PC speaker supported, yeah :)
> >  PowerPC:	Should compile but the locking is wrong but only the 
> >    		AmigaOne platforms should be affected.
> The Kconfig dependencies cleanup patch for CHRP, PSERIES, etc. should
> also apply to the AmigaOne. Can you resend it with a fix for the
> AmigaOne, or should I send a patch?

I can sort that; it's easy enough.

> I'll check next week, if the PC speaker is still working on my AmigaOne.

I can't imagine that it's going to break - the code is sorta simple ;-)

One obscurity I noticed is this bit in the amigaone.dts:

        timer@40 {
                // Also adds pcspkr to platform devices.
                compatible = "pnpPNP,100";
                reg = <1 0x00000040 0x00000020>;
        };

Shouldn't that rather be something like the following?

        pcspeaker@61 {
                device_type = "sound";
                compatible = "pnpPNP,800";
                reg = <1 0x61 1>;
        };

pnpPNP,100 is the i8253 timer as I understand and pnpPNP,800 the PC speaker.
If you interpret pnpPNP,100 to imply the presence of a PC speaker you can't
express a system that has a i8253 but no PCspeaker in a DT so maybe
amigaone.dts and arch/powerpc/kernel/setup-common.c should be changed to
use pnpPNP,800 instead?

  Ralf

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers
@ 2011-06-03 18:00     ` Ralf Baechle
  0 siblings, 0 replies; 60+ messages in thread
From: Ralf Baechle @ 2011-06-03 18:00 UTC (permalink / raw)
  To: Gerhard Pircher
  Cc: linux-arch, linux-mips, linux-kernel, linux-alpha,
	Thomas Gleixner, linuxppc-dev

On Thu, Jun 02, 2011 at 09:11:19PM +0200, Gerhard Pircher wrote:

> > #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> > /* Use the global PIT lock ! */
> > #include <asm/i8253.h>
> > #else
> > #include <asm/8253pit.h>
> > static DEFINE_RAW_SPINLOCK(i8253_lock);
> > #endif
> > 
> > sound/drivers/pcsp/pcsp.h:
> > 
> > #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> > /* Use the global PIT lock ! */
> > #include <asm/i8253.h>
> > #else
> > #include <asm/8253pit.h>
> > static DEFINE_RAW_SPINLOCK(i8253_lock);
> > 
> > $ git grep -F pcsp.h sound/drivers/pcsp
> > sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
> > $ git grep -w i8253_lock sound/drivers/pcsp/
> > sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
> > sound/drivers/pcsp/pcsp_input.c:        raw_spin_lock_irqsave(&i8253_lock,
> > flags
> > sound/drivers/pcsp/pcsp_input.c:       
> > raw_spin_unlock_irqrestore(&i8253_lock, 
> > sound/drivers/pcsp/pcsp_lib.c:          raw_spin_lock_irqsave(&i8253_lock,
> > flags
> > sound/drivers/pcsp/pcsp_lib.c:         
> > raw_spin_unlock_irqrestore(&i8253_lock, 
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > 
> > Locks are great, everybody should have their own lock!
> > 
> > $ find . -name 8253pit.h
> > ./arch/powerpc/include/asm/8253pit.h
> > ./arch/alpha/include/asm/8253pit.h
> > $ cat arch/*/include/asm/8253pit.h
> > /*
> >  * 8253/8254 Programmable Interval Timer
> >  */
> > /*
> >  * 8253/8254 Programmable Interval Timer
> >  */
> > $
> > 
> > Eh...
> > 
> > $ git grep -w PCSPKR_PLATFORM 
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
> > drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
> > init/Kconfig:config PCSPKR_PLATFORM
> > sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 &&
> > HIGH_RES_TIMERS
> > 
> > So the status is:
> > 
> >  Alpha:	There is no PCSPKR_PLATFORM so while a platform device is
> > 		being installed no drivers will be built.  I don't know
> > 		which Alpha platforms or even if all of Alpha should be
> > 		doing a PCSPKR_PLATFORM so I haven't even tried to sort
> > 		this.
> >  ARM:		No PC speaker supported, yeah :)
> >  PowerPC:	Should compile but the locking is wrong but only the 
> >    		AmigaOne platforms should be affected.
> The Kconfig dependencies cleanup patch for CHRP, PSERIES, etc. should
> also apply to the AmigaOne. Can you resend it with a fix for the
> AmigaOne, or should I send a patch?

I can sort that; it's easy enough.

> I'll check next week, if the PC speaker is still working on my AmigaOne.

I can't imagine that it's going to break - the code is sorta simple ;-)

One obscurity I noticed is this bit in the amigaone.dts:

        timer@40 {
                // Also adds pcspkr to platform devices.
                compatible = "pnpPNP,100";
                reg = <1 0x00000040 0x00000020>;
        };

Shouldn't that rather be something like the following?

        pcspeaker@61 {
                device_type = "sound";
                compatible = "pnpPNP,800";
                reg = <1 0x61 1>;
        };

pnpPNP,100 is the i8253 timer as I understand and pnpPNP,800 the PC speaker.
If you interpret pnpPNP,100 to imply the presence of a PC speaker you can't
express a system that has a i8253 but no PCspeaker in a DT so maybe
amigaone.dts and arch/powerpc/kernel/setup-common.c should be changed to
use pnpPNP,800 instead?

  Ralf

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers
  2011-06-03 18:00     ` Ralf Baechle
@ 2011-06-03 19:22       ` Gerhard Pircher
  -1 siblings, 0 replies; 60+ messages in thread
From: Gerhard Pircher @ 2011-06-03 19:22 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: benh, tglx, linux-kernel, linux-arch, linux-alpha, linuxppc-dev,
	linux-mips


-------- Original-Nachricht --------
> Datum: Fri, 3 Jun 2011 19:00:38 +0100
> Von: Ralf Baechle <ralf@linux-mips.org>
> An: Gerhard Pircher <gerhard_pircher@gmx.net>
> CC: linux-mips@linux-mips.org, linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>, Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Betreff: Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers

> On Thu, Jun 02, 2011 at 09:11:19PM +0200, Gerhard Pircher wrote:
> 
> > > #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> > > /* Use the global PIT lock ! */
> > > #include <asm/i8253.h>
> > > #else
> > > #include <asm/8253pit.h>
> > > static DEFINE_RAW_SPINLOCK(i8253_lock);
> > > #endif
> > > 
> > > sound/drivers/pcsp/pcsp.h:
> > > 
> > > #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> > > /* Use the global PIT lock ! */
> > > #include <asm/i8253.h>
> > > #else
> > > #include <asm/8253pit.h>
> > > static DEFINE_RAW_SPINLOCK(i8253_lock);
> > > 
> > > $ git grep -F pcsp.h sound/drivers/pcsp
> > > sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
> > > sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
> > > sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
> > > sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
> > > $ git grep -w i8253_lock sound/drivers/pcsp/
> > > sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
> > > sound/drivers/pcsp/pcsp_input.c:       
> raw_spin_lock_irqsave(&i8253_lock,
> > > flags
> > > sound/drivers/pcsp/pcsp_input.c:       
> > > raw_spin_unlock_irqrestore(&i8253_lock, 
> > > sound/drivers/pcsp/pcsp_lib.c:         
> raw_spin_lock_irqsave(&i8253_lock,
> > > flags
> > > sound/drivers/pcsp/pcsp_lib.c:         
> > > raw_spin_unlock_irqrestore(&i8253_lock, 
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > > 
> > > Locks are great, everybody should have their own lock!
> > > 
> > > $ find . -name 8253pit.h
> > > ./arch/powerpc/include/asm/8253pit.h
> > > ./arch/alpha/include/asm/8253pit.h
> > > $ cat arch/*/include/asm/8253pit.h
> > > /*
> > >  * 8253/8254 Programmable Interval Timer
> > >  */
> > > /*
> > >  * 8253/8254 Programmable Interval Timer
> > >  */
> > > $
> > > 
> > > Eh...
> > > 
> > > $ git grep -w PCSPKR_PLATFORM 
> > > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > > arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
> > > drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
> > > init/Kconfig:config PCSPKR_PLATFORM
> > > sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 &&
> > > HIGH_RES_TIMERS
> > > 
> > > So the status is:
> > > 
> > >  Alpha:	There is no PCSPKR_PLATFORM so while a platform device is
> > > 		being installed no drivers will be built.  I don't know
> > > 		which Alpha platforms or even if all of Alpha should be
> > > 		doing a PCSPKR_PLATFORM so I haven't even tried to sort
> > > 		this.
> > >  ARM:		No PC speaker supported, yeah :)
> > >  PowerPC:	Should compile but the locking is wrong but only the 
> > >    		AmigaOne platforms should be affected.
> > The Kconfig dependencies cleanup patch for CHRP, PSERIES, etc. should
> > also apply to the AmigaOne. Can you resend it with a fix for the
> > AmigaOne, or should I send a patch?
> 
> I can sort that; it's easy enough.
Thanks a lot!

> > I'll check next week, if the PC speaker is still working on my
> > AmigaOne.
> 
> I can't imagine that it's going to break - the code is sorta simple ;-)
That's true, but testing the most recent Linux kernel on the AmigaOne is
never wrong. :-)

> One obscurity I noticed is this bit in the amigaone.dts:
> 
>         timer@40 {
>                 // Also adds pcspkr to platform devices.
>                 compatible = "pnpPNP,100";
>                 reg = <1 0x00000040 0x00000020>;
>         };
> 
> Shouldn't that rather be something like the following?
> 
>         pcspeaker@61 {
>                 device_type = "sound";
>                 compatible = "pnpPNP,800";
>                 reg = <1 0x61 1>;
>         };
> 
> pnpPNP,100 is the i8253 timer as I understand and pnpPNP,800 the PC
> speaker.
> If you interpret pnpPNP,100 to imply the presence of a PC speaker you
> can't express a system that has a i8253 but no PCspeaker in a DT so
> maybe amigaone.dts and arch/powerpc/kernel/setup-common.c should be
> changed to use pnpPNP,800 instead?

That would be cleaner, but I guess it would break CHRP and PSERIES.
These platforms probably only provide a pnpPNP,100 entry in the device
tree (at least that's the case on the Pegasos2 CHRP machine AFAICT).

Gerhard
-- 
NEU: FreePhone - kostenlos mobil telefonieren!			
Jetzt informieren: http://www.gmx.net/de/go/freephone

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers
@ 2011-06-03 19:22       ` Gerhard Pircher
  0 siblings, 0 replies; 60+ messages in thread
From: Gerhard Pircher @ 2011-06-03 19:22 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: linux-arch, linux-mips, linux-kernel, linux-alpha, tglx, linuxppc-dev


-------- Original-Nachricht --------
> Datum: Fri, 3 Jun 2011 19:00:38 +0100
> Von: Ralf Baechle <ralf@linux-mips.org>
> An: Gerhard Pircher <gerhard_pircher@gmx.net>
> CC: linux-mips@linux-mips.org, linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>, Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Betreff: Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers

> On Thu, Jun 02, 2011 at 09:11:19PM +0200, Gerhard Pircher wrote:
> 
> > > #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> > > /* Use the global PIT lock ! */
> > > #include <asm/i8253.h>
> > > #else
> > > #include <asm/8253pit.h>
> > > static DEFINE_RAW_SPINLOCK(i8253_lock);
> > > #endif
> > > 
> > > sound/drivers/pcsp/pcsp.h:
> > > 
> > > #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> > > /* Use the global PIT lock ! */
> > > #include <asm/i8253.h>
> > > #else
> > > #include <asm/8253pit.h>
> > > static DEFINE_RAW_SPINLOCK(i8253_lock);
> > > 
> > > $ git grep -F pcsp.h sound/drivers/pcsp
> > > sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
> > > sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
> > > sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
> > > sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
> > > $ git grep -w i8253_lock sound/drivers/pcsp/
> > > sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
> > > sound/drivers/pcsp/pcsp_input.c:       
> raw_spin_lock_irqsave(&i8253_lock,
> > > flags
> > > sound/drivers/pcsp/pcsp_input.c:       
> > > raw_spin_unlock_irqrestore(&i8253_lock, 
> > > sound/drivers/pcsp/pcsp_lib.c:         
> raw_spin_lock_irqsave(&i8253_lock,
> > > flags
> > > sound/drivers/pcsp/pcsp_lib.c:         
> > > raw_spin_unlock_irqrestore(&i8253_lock, 
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > > 
> > > Locks are great, everybody should have their own lock!
> > > 
> > > $ find . -name 8253pit.h
> > > ./arch/powerpc/include/asm/8253pit.h
> > > ./arch/alpha/include/asm/8253pit.h
> > > $ cat arch/*/include/asm/8253pit.h
> > > /*
> > >  * 8253/8254 Programmable Interval Timer
> > >  */
> > > /*
> > >  * 8253/8254 Programmable Interval Timer
> > >  */
> > > $
> > > 
> > > Eh...
> > > 
> > > $ git grep -w PCSPKR_PLATFORM 
> > > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > > arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
> > > drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
> > > init/Kconfig:config PCSPKR_PLATFORM
> > > sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 &&
> > > HIGH_RES_TIMERS
> > > 
> > > So the status is:
> > > 
> > >  Alpha:	There is no PCSPKR_PLATFORM so while a platform device is
> > > 		being installed no drivers will be built.  I don't know
> > > 		which Alpha platforms or even if all of Alpha should be
> > > 		doing a PCSPKR_PLATFORM so I haven't even tried to sort
> > > 		this.
> > >  ARM:		No PC speaker supported, yeah :)
> > >  PowerPC:	Should compile but the locking is wrong but only the 
> > >    		AmigaOne platforms should be affected.
> > The Kconfig dependencies cleanup patch for CHRP, PSERIES, etc. should
> > also apply to the AmigaOne. Can you resend it with a fix for the
> > AmigaOne, or should I send a patch?
> 
> I can sort that; it's easy enough.
Thanks a lot!

> > I'll check next week, if the PC speaker is still working on my
> > AmigaOne.
> 
> I can't imagine that it's going to break - the code is sorta simple ;-)
That's true, but testing the most recent Linux kernel on the AmigaOne is
never wrong. :-)

> One obscurity I noticed is this bit in the amigaone.dts:
> 
>         timer@40 {
>                 // Also adds pcspkr to platform devices.
>                 compatible = "pnpPNP,100";
>                 reg = <1 0x00000040 0x00000020>;
>         };
> 
> Shouldn't that rather be something like the following?
> 
>         pcspeaker@61 {
>                 device_type = "sound";
>                 compatible = "pnpPNP,800";
>                 reg = <1 0x61 1>;
>         };
> 
> pnpPNP,100 is the i8253 timer as I understand and pnpPNP,800 the PC
> speaker.
> If you interpret pnpPNP,100 to imply the presence of a PC speaker you
> can't express a system that has a i8253 but no PCspeaker in a DT so
> maybe amigaone.dts and arch/powerpc/kernel/setup-common.c should be
> changed to use pnpPNP,800 instead?

That would be cleaner, but I guess it would break CHRP and PSERIES.
These platforms probably only provide a pnpPNP,100 entry in the device
tree (at least that's the case on the Pegasos2 CHRP machine AFAICT).

Gerhard
-- 
NEU: FreePhone - kostenlos mobil telefonieren!			
Jetzt informieren: http://www.gmx.net/de/go/freephone

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header.
  2011-06-01 18:05   ` ralf
@ 2011-06-09  5:07     ` Benjamin Herrenschmidt
  -1 siblings, 0 replies; 60+ messages in thread
From: Benjamin Herrenschmidt @ 2011-06-09  5:07 UTC (permalink / raw)
  To: ralf
  Cc: linux-kernel, linux-arch, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha, Paul Mackerras, linuxppc-dev

On Wed, 2011-06-01 at 19:05 +0100, ralf@linux-mips.org wrote:
> plain text document attachment
> (i8253-remove-unused-8253pit.h-files.patch)
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: linux-alpha@vger.kernel.org
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> 
>  arch/alpha/include/asm/8253pit.h   |    3 ---
>  arch/powerpc/include/asm/8253pit.h |    3 ---
>  2 files changed, 6 deletions(-)

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Thanks !

Ben.

> Index: linux-mips/arch/alpha/include/asm/8253pit.h
> ===================================================================
> --- linux-mips.orig/arch/alpha/include/asm/8253pit.h
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -/*
> - * 8253/8254 Programmable Interval Timer
> - */
> Index: linux-mips/arch/powerpc/include/asm/8253pit.h
> ===================================================================
> --- linux-mips.orig/arch/powerpc/include/asm/8253pit.h
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -/*
> - * 8253/8254 Programmable Interval Timer
> - */
> 



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header.
@ 2011-06-09  5:07     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 60+ messages in thread
From: Benjamin Herrenschmidt @ 2011-06-09  5:07 UTC (permalink / raw)
  To: ralf
  Cc: linux-arch, linux-kernel, Ivan Kokshaysky, linux-alpha,
	Paul Mackerras, Matt Turner, linuxppc-dev, Richard Henderson

On Wed, 2011-06-01 at 19:05 +0100, ralf@linux-mips.org wrote:
> plain text document attachment
> (i8253-remove-unused-8253pit.h-files.patch)
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: linux-alpha@vger.kernel.org
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> 
>  arch/alpha/include/asm/8253pit.h   |    3 ---
>  arch/powerpc/include/asm/8253pit.h |    3 ---
>  2 files changed, 6 deletions(-)

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Thanks !

Ben.

> Index: linux-mips/arch/alpha/include/asm/8253pit.h
> ===================================================================
> --- linux-mips.orig/arch/alpha/include/asm/8253pit.h
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -/*
> - * 8253/8254 Programmable Interval Timer
> - */
> Index: linux-mips/arch/powerpc/include/asm/8253pit.h
> ===================================================================
> --- linux-mips.orig/arch/powerpc/include/asm/8253pit.h
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -/*
> - * 8253/8254 Programmable Interval Timer
> - */
> 

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 13/14] PCSPKR: Cleanup Kconfig dependencies
  2011-06-01 18:05   ` ralf
@ 2011-06-09  5:09     ` Benjamin Herrenschmidt
  -1 siblings, 0 replies; 60+ messages in thread
From: Benjamin Herrenschmidt @ 2011-06-09  5:09 UTC (permalink / raw)
  To: ralf
  Cc: linux-kernel, linux-arch, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Paul Mackerras, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, linux-alpha, linux-mips, linuxppc-dev

On Wed, 2011-06-01 at 19:05 +0100, ralf@linux-mips.org wrote:
> plain text document attachment
> (i8253-use-aux-symbol-for-pcspkr-config.patch)
> Lenghty lists of the kind "depends on ARCH1 || ARCH2 ... || ARCH123" are
> usually either wrong or too coarse grained.  Or plain an ugly sin.

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: linux-alpha@vger.kernel.org
> Cc: linux-mips@linux-mips.org
> Cc: linuxppc-dev@lists.ozlabs.org



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [patch 13/14] PCSPKR: Cleanup Kconfig dependencies
@ 2011-06-09  5:09     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 60+ messages in thread
From: Benjamin Herrenschmidt @ 2011-06-09  5:09 UTC (permalink / raw)
  To: ralf
  Cc: linux-arch, linux-mips, linux-alpha, x86, linux-kernel,
	Ingo Molnar, Paul Mackerras, H. Peter Anvin, Ivan Kokshaysky,
	Matt Turner, linuxppc-dev, Thomas Gleixner, Richard Henderson

On Wed, 2011-06-01 at 19:05 +0100, ralf@linux-mips.org wrote:
> plain text document attachment
> (i8253-use-aux-symbol-for-pcspkr-config.patch)
> Lenghty lists of the kind "depends on ARCH1 || ARCH2 ... || ARCH123" are
> usually either wrong or too coarse grained.  Or plain an ugly sin.

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: linux-alpha@vger.kernel.org
> Cc: linux-mips@linux-mips.org
> Cc: linuxppc-dev@lists.ozlabs.org

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Create linux/i8253.h and use it in all 8253 related files
  2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
@ 2011-06-09 11:16   ` tip-bot for Ralf Baechle
  2011-06-09 13:04   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:16 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, ralf, tglx

Commit-ID:  9e5f52db252be87dc88615c5a48f80a2c70cd2a0
Gitweb:     http://git.kernel.org/tip/9e5f52db252be87dc88615c5a48f80a2c70cd2a0
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:04:57 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:49 +0200

i8253: Create linux/i8253.h and use it in all 8253 related files

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Link: http://lkml.kernel.org/r/20110601180610.054254048@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

 arch/arm/mach-footbridge/isa-timer.c |    2 +-
 arch/mips/cobalt/time.c              |    2 +-
 arch/mips/jazz/irq.c                 |    2 +-
 arch/mips/kernel/i8253.c             |    2 +-
 arch/mips/mti-malta/malta-time.c     |    2 +-
 arch/mips/sgi-ip22/ip22-time.c       |    2 +-
 arch/mips/sni/time.c                 |    2 +-
 arch/x86/kernel/apic/apic.c          |    2 +-
 arch/x86/kernel/apm_32.c             |    2 +-
 arch/x86/kernel/hpet.c               |    2 +-
 arch/x86/kernel/i8253.c              |    2 +-
 arch/x86/kernel/time.c               |    2 +-
 drivers/block/hd.c                   |    2 +-
 drivers/clocksource/i8253.c          |    2 +-
 drivers/input/gameport/gameport.c    |    2 +-
 drivers/input/joystick/analog.c      |    2 +-
 drivers/input/misc/pcspkr.c          |    2 +-
 include/linux/i8253.h                |   11 +++++++++++
 sound/drivers/pcsp/pcsp.h            |    2 +-
 19 files changed, 29 insertions(+), 18 deletions(-)

---
 arch/arm/mach-footbridge/isa-timer.c               |    2 +-
 arch/mips/cobalt/time.c                            |    2 +-
 arch/mips/jazz/irq.c                               |    2 +-
 arch/mips/kernel/i8253.c                           |    2 +-
 arch/mips/mti-malta/malta-time.c                   |    2 +-
 arch/mips/sgi-ip22/ip22-time.c                     |    2 +-
 arch/mips/sni/time.c                               |    2 +-
 arch/x86/kernel/apic/apic.c                        |    2 +-
 arch/x86/kernel/apm_32.c                           |    2 +-
 arch/x86/kernel/hpet.c                             |    2 +-
 arch/x86/kernel/i8253.c                            |    2 +-
 arch/x86/kernel/time.c                             |    2 +-
 drivers/block/hd.c                                 |    2 +-
 drivers/clocksource/i8253.c                        |    2 +-
 drivers/input/gameport/gameport.c                  |    2 +-
 drivers/input/joystick/analog.c                    |    2 +-
 drivers/input/misc/pcspkr.c                        |    2 +-
 .../include/asm/ide.h => include/linux/i8253.h     |   10 ++++------
 sound/drivers/pcsp/pcsp.h                          |    2 +-
 19 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c
index 7020f1a..3c7367b 100644
--- a/arch/arm/mach-footbridge/isa-timer.c
+++ b/arch/arm/mach-footbridge/isa-timer.c
@@ -6,6 +6,7 @@
  */
 #include <linux/clockchips.h>
 #include <linux/clocksource.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -14,7 +15,6 @@
 #include <linux/timex.h>
 
 #include <asm/irq.h>
-#include <asm/i8253.h>
 #include <asm/mach/time.h>
 
 #include "common.h"
diff --git a/arch/mips/cobalt/time.c b/arch/mips/cobalt/time.c
index 0162f9e..3bff3b8 100644
--- a/arch/mips/cobalt/time.c
+++ b/arch/mips/cobalt/time.c
@@ -17,10 +17,10 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
+#include <linux/i8253.h>
 #include <linux/init.h>
 
 #include <asm/gt64120.h>
-#include <asm/i8253.h>
 #include <asm/time.h>
 
 #define GT641XX_BASE_CLOCK	50000000	/* 50MHz */
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index 260df47..ca9bd20 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -7,6 +7,7 @@
  * Copyright (C) 1994 - 2001, 2003, 07 Ralf Baechle
  */
 #include <linux/clockchips.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
@@ -15,7 +16,6 @@
 #include <linux/irq.h>
 
 #include <asm/irq_cpu.h>
-#include <asm/i8253.h>
 #include <asm/i8259.h>
 #include <asm/io.h>
 #include <asm/jazz.h>
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
index 391221b..82b5a9f 100644
--- a/arch/mips/kernel/i8253.c
+++ b/arch/mips/kernel/i8253.c
@@ -3,6 +3,7 @@
  *
  */
 #include <linux/clockchips.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/jiffies.h>
@@ -12,7 +13,6 @@
 #include <linux/irq.h>
 
 #include <asm/delay.h>
-#include <asm/i8253.h>
 #include <asm/io.h>
 #include <asm/time.h>
 
diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c
index 1620b83..f8ee945 100644
--- a/arch/mips/mti-malta/malta-time.c
+++ b/arch/mips/mti-malta/malta-time.c
@@ -19,6 +19,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
@@ -31,7 +32,6 @@
 #include <asm/mipsregs.h>
 #include <asm/mipsmtregs.h>
 #include <asm/hardirq.h>
-#include <asm/i8253.h>
 #include <asm/irq.h>
 #include <asm/div64.h>
 #include <asm/cpu.h>
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index 1a94c98..6071924 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -10,6 +10,7 @@
  * Copyright (C) 2003, 06 Ralf Baechle (ralf@linux-mips.org)
  */
 #include <linux/bcd.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
@@ -20,7 +21,6 @@
 
 #include <asm/cpu.h>
 #include <asm/mipsregs.h>
-#include <asm/i8253.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/time.h>
diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c
index 0904d4d..ec0be14 100644
--- a/arch/mips/sni/time.c
+++ b/arch/mips/sni/time.c
@@ -1,11 +1,11 @@
 #include <linux/types.h>
+#include <linux/i8253.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/smp.h>
 #include <linux/time.h>
 #include <linux/clockchips.h>
 
-#include <asm/i8253.h>
 #include <asm/sni.h>
 #include <asm/time.h>
 #include <asm-generic/rtc.h>
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index b961af8..f3c3784 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -27,6 +27,7 @@
 #include <linux/syscore_ops.h>
 #include <linux/delay.h>
 #include <linux/timex.h>
+#include <linux/i8253.h>
 #include <linux/dmar.h>
 #include <linux/init.h>
 #include <linux/cpu.h>
@@ -39,7 +40,6 @@
 #include <asm/pgalloc.h>
 #include <asm/atomic.h>
 #include <asm/mpspec.h>
-#include <asm/i8253.h>
 #include <asm/i8259.h>
 #include <asm/proto.h>
 #include <asm/apic.h>
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 965a766..a30740e 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -229,11 +229,11 @@
 #include <linux/jiffies.h>
 #include <linux/acpi.h>
 #include <linux/syscore_ops.h>
+#include <linux/i8253.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/desc.h>
-#include <asm/i8253.h>
 #include <asm/olpc.h>
 #include <asm/paravirt.h>
 #include <asm/reboot.h>
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 6781765..85b8a8a 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -4,6 +4,7 @@
 #include <linux/sysdev.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
+#include <linux/i8253.h>
 #include <linux/slab.h>
 #include <linux/hpet.h>
 #include <linux/init.h>
@@ -12,7 +13,6 @@
 #include <linux/io.h>
 
 #include <asm/fixmap.h>
-#include <asm/i8253.h>
 #include <asm/hpet.h>
 
 #define HPET_MASK			CLOCKSOURCE_MASK(32)
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index fb66dc9..3235550 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -9,10 +9,10 @@
 #include <linux/module.h>
 #include <linux/timex.h>
 #include <linux/delay.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/io.h>
 
-#include <asm/i8253.h>
 #include <asm/hpet.h>
 #include <asm/smp.h>
 
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
index 00cbb27..5a64d05 100644
--- a/arch/x86/kernel/time.c
+++ b/arch/x86/kernel/time.c
@@ -11,13 +11,13 @@
 
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
+#include <linux/i8253.h>
 #include <linux/time.h>
 #include <linux/mca.h>
 
 #include <asm/vsyscall.h>
 #include <asm/x86_init.h>
 #include <asm/i8259.h>
-#include <asm/i8253.h>
 #include <asm/timer.h>
 #include <asm/hpet.h>
 #include <asm/time.h>
diff --git a/drivers/block/hd.c b/drivers/block/hd.c
index 007c630..b52c9ca 100644
--- a/drivers/block/hd.c
+++ b/drivers/block/hd.c
@@ -155,7 +155,7 @@ else \
 
 #if (HD_DELAY > 0)
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 unsigned long last_req;
 
diff --git a/drivers/clocksource/i8253.c b/drivers/clocksource/i8253.c
index 225c176..33735eb 100644
--- a/drivers/clocksource/i8253.c
+++ b/drivers/clocksource/i8253.c
@@ -7,7 +7,7 @@
 #include <linux/spinlock.h>
 #include <linux/timex.h>
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 /*
  * Since the PIT overflows every tick, its not very useful
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index 5b8f59d..c351aa4 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -47,7 +47,7 @@ static void gameport_disconnect_port(struct gameport *gameport);
 
 #if defined(__i386__)
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 #define DELTA(x,y)      ((y)-(x)+((y)<(x)?1193182/HZ:0))
 #define GET_TIME(x)     do { x = get_time_pit(); } while (0)
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 4afe0a3..9882971 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -136,7 +136,7 @@ struct analog_port {
 
 #ifdef __i386__
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 #define GET_TIME(x)	do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)
 #define DELTA(x,y)	(cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0)))
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index f080dd3..2aa9d90 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -27,7 +27,7 @@ MODULE_ALIAS("platform:pcspkr");
 
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 #else
 #include <asm/8253pit.h>
 static DEFINE_RAW_SPINLOCK(i8253_lock);
diff --git a/arch/mips/include/asm/ide.h b/include/linux/i8253.h
similarity index 55%
copy from arch/mips/include/asm/ide.h
copy to include/linux/i8253.h
index bb674c3..d2cba88 100644
--- a/arch/mips/include/asm/ide.h
+++ b/include/linux/i8253.h
@@ -2,12 +2,10 @@
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
- *
- * This file contains the MIPS architecture specific IDE code.
  */
-#ifndef __ASM_IDE_H
-#define __ASM_IDE_H
+#ifndef __LINUX_I8253_H
+#define __LINUX_I8253_H
 
-#include <ide.h>
+#include <asm/i8253.h>
 
-#endif /* __ASM_IDE_H */
+#endif /* __LINUX_I8253_H */
diff --git a/sound/drivers/pcsp/pcsp.h b/sound/drivers/pcsp/pcsp.h
index 4ff6c8c..6757c30 100644
--- a/sound/drivers/pcsp/pcsp.h
+++ b/sound/drivers/pcsp/pcsp.h
@@ -13,7 +13,7 @@
 #include <linux/timex.h>
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 #else
 #include <asm/8253pit.h>
 static DEFINE_RAW_SPINLOCK(i8253_lock);

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Unify all kernel declarations of i8253_lock
  2011-06-01 18:04   ` ralf at linux-mips.org
  (?)
@ 2011-06-09 11:16   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:16 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, linux, ralf, tglx

Commit-ID:  1ff256164618afb3880137d4819ee62e9bda2d50
Gitweb:     http://git.kernel.org/tip/1ff256164618afb3880137d4819ee62e9bda2d50
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:04:58 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:49 +0200

i8253: Unify all kernel declarations of i8253_lock

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org
Link: http://lkml.kernel.org/r/20110601180610.134151920@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/arm/include/asm/i8253.h  |    9 ---------
 arch/mips/include/asm/i8253.h |   12 ------------
 arch/x86/include/asm/i8253.h  |   10 ----------
 include/linux/i8253.h         |   14 ++++++++++++++
 4 files changed, 14 insertions(+), 31 deletions(-)

diff --git a/arch/arm/include/asm/i8253.h b/arch/arm/include/asm/i8253.h
index 70656b6..5b41b92 100644
--- a/arch/arm/include/asm/i8253.h
+++ b/arch/arm/include/asm/i8253.h
@@ -1,15 +1,6 @@
 #ifndef __ASMARM_I8253_H
 #define __ASMARM_I8253_H
 
-/* i8253A PIT registers */
-#define PIT_MODE	0x43
-#define PIT_CH0		0x40
-
 #define PIT_LATCH	((PIT_TICK_RATE + HZ / 2) / HZ)
 
-extern raw_spinlock_t i8253_lock;
-
-#define outb_pit	outb_p
-#define inb_pit		inb_p
-
 #endif
diff --git a/arch/mips/include/asm/i8253.h b/arch/mips/include/asm/i8253.h
index 9ad0113..32ec1f0 100644
--- a/arch/mips/include/asm/i8253.h
+++ b/arch/mips/include/asm/i8253.h
@@ -5,20 +5,8 @@
 #ifndef __ASM_I8253_H
 #define __ASM_I8253_H
 
-#include <linux/spinlock.h>
-
-/* i8253A PIT registers */
-#define PIT_MODE		0x43
-#define PIT_CH0			0x40
-#define PIT_CH2			0x42
-
 #define PIT_LATCH		LATCH
 
-extern raw_spinlock_t i8253_lock;
-
 extern void setup_pit_timer(void);
 
-#define inb_pit inb_p
-#define outb_pit outb_p
-
 #endif /* __ASM_I8253_H */
diff --git a/arch/x86/include/asm/i8253.h b/arch/x86/include/asm/i8253.h
index 65aaa91..20480ce 100644
--- a/arch/x86/include/asm/i8253.h
+++ b/arch/x86/include/asm/i8253.h
@@ -1,20 +1,10 @@
 #ifndef _ASM_X86_I8253_H
 #define _ASM_X86_I8253_H
 
-/* i8253A PIT registers */
-#define PIT_MODE		0x43
-#define PIT_CH0			0x40
-#define PIT_CH2			0x42
-
 #define PIT_LATCH	LATCH
 
-extern raw_spinlock_t i8253_lock;
-
 extern struct clock_event_device *global_clock_event;
 
 extern void setup_pit_timer(void);
 
-#define inb_pit		inb_p
-#define outb_pit	outb_p
-
 #endif /* _ASM_X86_I8253_H */
diff --git a/include/linux/i8253.h b/include/linux/i8253.h
index d2cba88..13048d3 100644
--- a/include/linux/i8253.h
+++ b/include/linux/i8253.h
@@ -2,10 +2,24 @@
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
+ *
+ *  Machine specific IO port address definition for generic.
+ *  Written by Osamu Tomita <tomita@cinet.co.jp>
  */
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/spinlock.h>
 #include <asm/i8253.h>
 
+/* i8253A PIT registers */
+#define PIT_MODE	0x43
+#define PIT_CH0		0x40
+#define PIT_CH2		0x42
+
+#define inb_pit         inb_p
+#define outb_pit        outb_p
+
+extern raw_spinlock_t i8253_lock;
+
 #endif /* __LINUX_I8253_H */

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Consolidate all kernel definitions of i8253_lock
  2011-06-01 18:04 ` [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c ralf
@ 2011-06-09 11:17   ` tip-bot for Ralf Baechle
  2011-06-09 13:04   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:17 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, linux, ralf, tglx

Commit-ID:  78efffd9d7f2a988afecf0c281da3fac3d195120
Gitweb:     http://git.kernel.org/tip/78efffd9d7f2a988afecf0c281da3fac3d195120
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:04:59 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:49 +0200

i8253: Consolidate all kernel definitions of i8253_lock

Move them to drivers/clocksource/i8253.c and remove the
implementations in arch/

[ tglx: Avoid the extra file in lib - folded arch patches in. The
  export will become conditional in a later step ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Link: http://lkml.kernel.org/r/20110601180610.221426078@duck.linux-mips.net
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/arm/mach-footbridge/isa-timer.c |    2 --
 arch/mips/kernel/i8253.c             |    3 ---
 arch/x86/kernel/i8253.c              |    3 ---
 drivers/clocksource/Kconfig          |    6 ++++++
 drivers/clocksource/Makefile         |    2 +-
 drivers/clocksource/i8253.c          |   13 ++++++++++++-
 init/Kconfig                         |    1 +
 7 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c
index 3c7367b..71fd96d 100644
--- a/arch/arm/mach-footbridge/isa-timer.c
+++ b/arch/arm/mach-footbridge/isa-timer.c
@@ -19,8 +19,6 @@
 
 #include "common.h"
 
-DEFINE_RAW_SPINLOCK(i8253_lock);
-
 static void pit_set_mode(enum clock_event_mode mode,
 	struct clock_event_device *evt)
 {
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
index 82b5a9f..3d2ff57 100644
--- a/arch/mips/kernel/i8253.c
+++ b/arch/mips/kernel/i8253.c
@@ -16,9 +16,6 @@
 #include <asm/io.h>
 #include <asm/time.h>
 
-DEFINE_RAW_SPINLOCK(i8253_lock);
-EXPORT_SYMBOL(i8253_lock);
-
 /*
  * Initialize the PIT timer.
  *
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index 3235550..9c92b6f 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -16,9 +16,6 @@
 #include <asm/hpet.h>
 #include <asm/smp.h>
 
-DEFINE_RAW_SPINLOCK(i8253_lock);
-EXPORT_SYMBOL(i8253_lock);
-
 /*
  * HPET replaces the PIT, when enabled. So we need to know, which of
  * the two timers is used
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 96c9219..330343b 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -1,5 +1,11 @@
 config CLKSRC_I8253
 	bool
 
+config I8253_LOCK
+	bool
+
+config CLKBLD_I8253
+	def_bool y if CLKSRC_I8253 || I8253_LOCK
+
 config CLKSRC_MMIO
 	bool
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index b995942..7922a0c 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -6,5 +6,5 @@ obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC)	+= cs5535-clockevt.o
 obj-$(CONFIG_SH_TIMER_CMT)	+= sh_cmt.o
 obj-$(CONFIG_SH_TIMER_MTU2)	+= sh_mtu2.o
 obj-$(CONFIG_SH_TIMER_TMU)	+= sh_tmu.o
-obj-$(CONFIG_CLKSRC_I8253)	+= i8253.o
+obj-$(CONFIG_CLKBLD_I8253)	+= i8253.o
 obj-$(CONFIG_CLKSRC_MMIO)	+= mmio.o
diff --git a/drivers/clocksource/i8253.c b/drivers/clocksource/i8253.c
index 33735eb..e594f52 100644
--- a/drivers/clocksource/i8253.c
+++ b/drivers/clocksource/i8253.c
@@ -6,10 +6,20 @@
 #include <linux/io.h>
 #include <linux/spinlock.h>
 #include <linux/timex.h>
-
+#include <linux/module.h>
 #include <linux/i8253.h>
 
 /*
+ * Protects access to I/O ports
+ *
+ * 0040-0043 : timer0, i8253 / i8254
+ * 0061-0061 : NMI Control Register which contains two speaker control bits.
+ */
+DEFINE_RAW_SPINLOCK(i8253_lock);
+EXPORT_SYMBOL(i8253_lock);
+
+#ifdef CONFIG_CLKSRC_I8253
+/*
  * Since the PIT overflows every tick, its not very useful
  * to just read by itself. So use jiffies to emulate a free
  * running counter:
@@ -86,3 +96,4 @@ int __init clocksource_i8253_init(void)
 {
 	return clocksource_register_hz(&i8253_cs, PIT_TICK_RATE);
 }
+#endif
diff --git a/init/Kconfig b/init/Kconfig
index ebafac4..2d2ef44 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1002,6 +1002,7 @@ config ELF_CORE
 config PCSPKR_PLATFORM
 	bool "Enable PC-Speaker support" if EXPERT
 	depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
+	select I8253_LOCK
 	default y
 	help
           This option allows to disable the internal PC-Speaker

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Make pcspkr input driver use the shared i8253_lock
  2011-06-01 18:05 ` [patch 06/14] i8253: Make pcspkr input driver " ralf
@ 2011-06-09 11:17   ` tip-bot for Ralf Baechle
  2011-06-09 13:05   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:17 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, dmitry.torokhov, ralf, tglx

Commit-ID:  2133e05bd64088cffd0f5d352c055fa7c9b9239a
Gitweb:     http://git.kernel.org/tip/2133e05bd64088cffd0f5d352c055fa7c9b9239a
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:02 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:50 +0200

i8253: Make pcspkr input driver use the shared i8253_lock

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Link: http://lkml.kernel.org/r/20110601180610.453577265@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 drivers/input/misc/pcspkr.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index 2aa9d90..34f4d2e 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -14,6 +14,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/platform_device.h>
@@ -25,14 +26,6 @@ MODULE_DESCRIPTION("PC Speaker beeper driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pcspkr");
 
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
-#include <linux/i8253.h>
-#else
-#include <asm/8253pit.h>
-static DEFINE_RAW_SPINLOCK(i8253_lock);
-#endif
-
 static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
 	unsigned int count = 0;

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Make pcsp sound driver use the shared i8253_lock
  2011-06-01 18:05   ` ralf
  (?)
  (?)
@ 2011-06-09 11:18   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:18 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, ralf, tglx, tiwai, perex

Commit-ID:  1a8588c908e98c3b31a3a35595a94c655d569222
Gitweb:     http://git.kernel.org/tip/1a8588c908e98c3b31a3a35595a94c655d569222
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:03 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:50 +0200

i8253: Make pcsp sound driver use the shared i8253_lock

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Acked-by: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Link: http://lkml.kernel.org/r/20110601180610.532642190@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 sound/drivers/pcsp/pcsp.h |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/sound/drivers/pcsp/pcsp.h b/sound/drivers/pcsp/pcsp.h
index 6757c30..fc7a2dc 100644
--- a/sound/drivers/pcsp/pcsp.h
+++ b/sound/drivers/pcsp/pcsp.h
@@ -10,14 +10,8 @@
 #define __PCSP_H__
 
 #include <linux/hrtimer.h>
-#include <linux/timex.h>
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
 #include <linux/i8253.h>
-#else
-#include <asm/8253pit.h>
-static DEFINE_RAW_SPINLOCK(i8253_lock);
-#endif
+#include <linux/timex.h>
 
 #define PCSP_SOUND_VERSION 0x400	/* read 4.00 */
 #define PCSP_DEBUG 0

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] alpha: i8253: Cleanup remaining users of i8253pit.h
  2011-06-01 18:05 ` [patch 08/14] i8253: Alpha: Cleanup remaining users of i8253pit.h ralf
@ 2011-06-09 11:19   ` tip-bot for Ralf Baechle
  2011-06-09 13:06   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:19 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, ralf, mattst88, ink, tglx, rth

Commit-ID:  d49a40fb35042368fffd28c247fa82f07fa35ec4
Gitweb:     http://git.kernel.org/tip/d49a40fb35042368fffd28c247fa82f07fa35ec4
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:04 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:50 +0200

alpha: i8253: Cleanup remaining users of i8253pit.h

The Alpha <asm/i8253pit.h> header is empty so this inclusion can just be
removed.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Link: http://lkml.kernel.org/r/20110601180610.608083130@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/alpha/kernel/sys_ruffian.c |    1 -
 arch/alpha/kernel/time.c        |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c
index 8de1046..f33648e 100644
--- a/arch/alpha/kernel/sys_ruffian.c
+++ b/arch/alpha/kernel/sys_ruffian.c
@@ -26,7 +26,6 @@
 #include <asm/pgtable.h>
 #include <asm/core_cia.h>
 #include <asm/tlbflush.h>
-#include <asm/8253pit.h>
 
 #include "proto.h"
 #include "irq_impl.h"
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 818e74e..de406c7 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -46,7 +46,6 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/hwrpb.h>
-#include <asm/8253pit.h>
 #include <asm/rtc.h>
 
 #include <linux/mc146818rtc.h>

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Alpha, PowerPC: Remove unused asm/8253pit.h
  2011-06-01 18:05   ` ralf
  (?)
  (?)
@ 2011-06-09 11:19   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:19 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, paulus, hpa, mingo, benh, ralf, mattst88, ink, tglx, rth

Commit-ID:  f056955cd8f0c0aaaf311dcff5ab209beb6bd9ea
Gitweb:     http://git.kernel.org/tip/f056955cd8f0c0aaaf311dcff5ab209beb6bd9ea
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:05 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:51 +0200

i8253: Alpha, PowerPC: Remove unused asm/8253pit.h

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/20110601180610.684557757@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/alpha/include/asm/8253pit.h   |    3 ---
 arch/powerpc/include/asm/8253pit.h |    3 ---
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/arch/alpha/include/asm/8253pit.h b/arch/alpha/include/asm/8253pit.h
deleted file mode 100644
index a71c9c1..0000000
--- a/arch/alpha/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */
diff --git a/arch/powerpc/include/asm/8253pit.h b/arch/powerpc/include/asm/8253pit.h
deleted file mode 100644
index a71c9c1..0000000
--- a/arch/powerpc/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] x86: i8253: Consolidate definitions of global_clock_event
  2011-06-01 18:05 ` [patch 10/14] i8253: x86: Consolidate definitions of global_clock_event ralf
@ 2011-06-09 11:19   ` tip-bot for Ralf Baechle
  2011-06-09 13:07   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:19 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, ralf, tglx, venki

Commit-ID:  219c54629c73323ddd5281de1bb1dfe0004185dd
Gitweb:     http://git.kernel.org/tip/219c54629c73323ddd5281de1bb1dfe0004185dd
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:06 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:51 +0200

x86: i8253: Consolidate definitions of global_clock_event

There are multiple declarations of global_clock_event in header files
specific to particular clock event implementations.  Consolidate them
in <asm/time.h> and make sure all users include that header.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Venkatesh Pallipadi (Venki) <venki@google.com>
Link: http://lkml.kernel.org/r/20110601180610.762763451@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/include/asm/apb_timer.h |    1 -
 arch/x86/include/asm/i8253.h     |    2 --
 arch/x86/include/asm/time.h      |    6 ++++--
 arch/x86/kernel/apb_timer.c      |    1 +
 arch/x86/kernel/apic/apic.c      |    1 +
 arch/x86/kernel/hpet.c           |    1 +
 arch/x86/kernel/i8253.c          |    1 +
 7 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/apb_timer.h b/arch/x86/include/asm/apb_timer.h
index 2fefa50..963f7d4 100644
--- a/arch/x86/include/asm/apb_timer.h
+++ b/arch/x86/include/asm/apb_timer.h
@@ -50,7 +50,6 @@
 #define APBT_DEV_USED  1
 
 extern void apbt_time_init(void);
-extern struct clock_event_device *global_clock_event;
 extern unsigned long apbt_quick_calibrate(void);
 extern int arch_setup_apbt_irqs(int irq, int trigger, int mask, int cpu);
 extern void apbt_setup_secondary_clock(void);
diff --git a/arch/x86/include/asm/i8253.h b/arch/x86/include/asm/i8253.h
index 20480ce..3d5f5ee 100644
--- a/arch/x86/include/asm/i8253.h
+++ b/arch/x86/include/asm/i8253.h
@@ -3,8 +3,6 @@
 
 #define PIT_LATCH	LATCH
 
-extern struct clock_event_device *global_clock_event;
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
diff --git a/arch/x86/include/asm/time.h b/arch/x86/include/asm/time.h
index 7bdec4e..92b8aec 100644
--- a/arch/x86/include/asm/time.h
+++ b/arch/x86/include/asm/time.h
@@ -1,10 +1,12 @@
 #ifndef _ASM_X86_TIME_H
 #define _ASM_X86_TIME_H
 
-extern void hpet_time_init(void);
-
+#include <linux/clocksource.h>
 #include <asm/mc146818rtc.h>
 
+extern void hpet_time_init(void);
 extern void time_init(void);
 
+extern struct clock_event_device *global_clock_event;
+
 #endif /* _ASM_X86_TIME_H */
diff --git a/arch/x86/kernel/apb_timer.c b/arch/x86/kernel/apb_timer.c
index 289e928..2b6630d 100644
--- a/arch/x86/kernel/apb_timer.c
+++ b/arch/x86/kernel/apb_timer.c
@@ -44,6 +44,7 @@
 #include <asm/fixmap.h>
 #include <asm/apb_timer.h>
 #include <asm/mrst.h>
+#include <asm/time.h>
 
 #define APBT_MASK			CLOCKSOURCE_MASK(32)
 #define APBT_SHIFT			22
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index f3c3784..9da0dc0 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -48,6 +48,7 @@
 #include <asm/hpet.h>
 #include <asm/idle.h>
 #include <asm/mtrr.h>
+#include <asm/time.h>
 #include <asm/smp.h>
 #include <asm/mce.h>
 #include <asm/tsc.h>
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 85b8a8a..0f4b065 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -14,6 +14,7 @@
 
 #include <asm/fixmap.h>
 #include <asm/hpet.h>
+#include <asm/time.h>
 
 #define HPET_MASK			CLOCKSOURCE_MASK(32)
 
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index 9c92b6f..5783e6d 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -14,6 +14,7 @@
 #include <linux/io.h>
 
 #include <asm/hpet.h>
+#include <asm/time.h>
 #include <asm/smp.h>
 
 /*

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Consolidate definitions of PIT_LATCH
  2011-06-01 18:05   ` ralf
  (?)
  (?)
@ 2011-06-09 11:20   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:20 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, linux, ralf, tglx

Commit-ID:  00775d56568d925e74f8b52dddf5ba592ed69021
Gitweb:     http://git.kernel.org/tip/00775d56568d925e74f8b52dddf5ba592ed69021
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:07 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:51 +0200

i8253: Consolidate definitions of PIT_LATCH

x86 defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as PIT_TICK_RATE.

MIPS defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as 1193182.

ARM defines PITCH_LATCH as ((PIT_TICK_RATE + HZ / 2) / HZ) - and that's
the sanest thing and equivalent to above definitions so use that as the
new definition in <linux/i8253.h>.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org
Link: http://lkml.kernel.org/r/20110601180610.832810002@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/arm/include/asm/i8253.h  |    2 --
 arch/mips/include/asm/i8253.h |    2 --
 arch/x86/include/asm/i8253.h  |    2 --
 include/linux/i8253.h         |    4 ++++
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/i8253.h b/arch/arm/include/asm/i8253.h
index 5b41b92..fee59eb 100644
--- a/arch/arm/include/asm/i8253.h
+++ b/arch/arm/include/asm/i8253.h
@@ -1,6 +1,4 @@
 #ifndef __ASMARM_I8253_H
 #define __ASMARM_I8253_H
 
-#define PIT_LATCH	((PIT_TICK_RATE + HZ / 2) / HZ)
-
 #endif
diff --git a/arch/mips/include/asm/i8253.h b/arch/mips/include/asm/i8253.h
index 32ec1f0..26f4eb1 100644
--- a/arch/mips/include/asm/i8253.h
+++ b/arch/mips/include/asm/i8253.h
@@ -5,8 +5,6 @@
 #ifndef __ASM_I8253_H
 #define __ASM_I8253_H
 
-#define PIT_LATCH		LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* __ASM_I8253_H */
diff --git a/arch/x86/include/asm/i8253.h b/arch/x86/include/asm/i8253.h
index 3d5f5ee..0049dc9 100644
--- a/arch/x86/include/asm/i8253.h
+++ b/arch/x86/include/asm/i8253.h
@@ -1,8 +1,6 @@
 #ifndef _ASM_X86_I8253_H
 #define _ASM_X86_I8253_H
 
-#define PIT_LATCH	LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
diff --git a/include/linux/i8253.h b/include/linux/i8253.h
index 13048d3..1ec6323 100644
--- a/include/linux/i8253.h
+++ b/include/linux/i8253.h
@@ -9,7 +9,9 @@
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/param.h>
 #include <linux/spinlock.h>
+#include <linux/timex.h>
 #include <asm/i8253.h>
 
 /* i8253A PIT registers */
@@ -17,6 +19,8 @@
 #define PIT_CH0		0x40
 #define PIT_CH2		0x42
 
+#define PIT_LATCH	((PIT_TICK_RATE + HZ/2) / HZ)
+
 #define inb_pit         inb_p
 #define outb_pit        outb_p
 

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Move remaining content and delete asm/i8253.h
  2011-06-01 18:05   ` ralf
                     ` (2 preceding siblings ...)
  (?)
@ 2011-06-09 11:20   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:20 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, linux, ralf, tglx

Commit-ID:  4cd8483247271d007af3a1167c0d5500b084135a
Gitweb:     http://git.kernel.org/tip/4cd8483247271d007af3a1167c0d5500b084135a
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:08 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:52 +0200

i8253: Move remaining content and delete asm/i8253.h

Move setup_pit_timer() declaration to the common header file and
remove the arch specific ones.

[ tglx: Move it to linux/i8253.h instead of asm/mips and asm/x86 ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-mips@linux-mips.org
Cc: Sergei Shtylyov <sshtylyov@mvista.com
Link: http://lkml.kernel.org/r/20110601180610.913463093@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/arm/include/asm/i8253.h  |    4 ----
 arch/mips/include/asm/i8253.h |   10 ----------
 arch/x86/include/asm/i8253.h  |    6 ------
 include/linux/i8253.h         |    3 ++-
 4 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/arch/arm/include/asm/i8253.h b/arch/arm/include/asm/i8253.h
deleted file mode 100644
index fee59eb..0000000
--- a/arch/arm/include/asm/i8253.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __ASMARM_I8253_H
-#define __ASMARM_I8253_H
-
-#endif
diff --git a/arch/mips/include/asm/i8253.h b/arch/mips/include/asm/i8253.h
deleted file mode 100644
index 26f4eb1..0000000
--- a/arch/mips/include/asm/i8253.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  Machine specific IO port address definition for generic.
- *  Written by Osamu Tomita <tomita@cinet.co.jp>
- */
-#ifndef __ASM_I8253_H
-#define __ASM_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* __ASM_I8253_H */
diff --git a/arch/x86/include/asm/i8253.h b/arch/x86/include/asm/i8253.h
deleted file mode 100644
index 0049dc9..0000000
--- a/arch/x86/include/asm/i8253.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_X86_I8253_H
-#define _ASM_X86_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* _ASM_X86_I8253_H */
diff --git a/include/linux/i8253.h b/include/linux/i8253.h
index 1ec6323..76039c8 100644
--- a/include/linux/i8253.h
+++ b/include/linux/i8253.h
@@ -12,7 +12,6 @@
 #include <linux/param.h>
 #include <linux/spinlock.h>
 #include <linux/timex.h>
-#include <asm/i8253.h>
 
 /* i8253A PIT registers */
 #define PIT_MODE	0x43
@@ -26,4 +25,6 @@
 
 extern raw_spinlock_t i8253_lock;
 
+extern void setup_pit_timer(void);
+
 #endif /* __LINUX_I8253_H */

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] pcspkr: Cleanup Kconfig dependencies
  2011-06-01 18:05   ` ralf
  (?)
  (?)
@ 2011-06-09 11:21   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, paulus, hpa, mingo, gerhard_pircher, benh, ralf,
	mattst88, ink, tglx, rth

Commit-ID:  ee65d52682535ea1343acb672898ed3c362e185c
Gitweb:     http://git.kernel.org/tip/ee65d52682535ea1343acb672898ed3c362e185c
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:09 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:52 +0200

pcspkr: Cleanup Kconfig dependencies

Lenghty lists of the kind "depends on ARCH1 || ARCH2 ... || ARCH123" are
usually either wrong or too coarse grained.  Or plain an ugly sin.

[ tglx: Fixed up amigaone ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linux-alpha@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Gerhard Pircher <gerhard_pircher@gmx.net>
Link: http://lkml.kernel.org/r/20110601180610.984881988@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/alpha/Kconfig                      |    1 +
 arch/mips/Kconfig                       |    1 +
 arch/powerpc/platforms/amigaone/Kconfig |    2 +-
 arch/powerpc/platforms/chrp/Kconfig     |    1 +
 arch/powerpc/platforms/prep/Kconfig     |    1 +
 arch/powerpc/platforms/pseries/Kconfig  |    1 +
 arch/x86/Kconfig                        |    1 +
 init/Kconfig                            |    6 +++++-
 8 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 60219bf..ca2da8d 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -6,6 +6,7 @@ config ALPHA
 	select HAVE_OPROFILE
 	select HAVE_SYSCALL_WRAPPERS
 	select HAVE_IRQ_WORK
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_DMA_ATTRS
 	select HAVE_GENERIC_HARDIRQS
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 653da62..bf35bb6 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -5,6 +5,7 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
diff --git a/arch/powerpc/platforms/amigaone/Kconfig b/arch/powerpc/platforms/amigaone/Kconfig
index 0224767..128de25 100644
--- a/arch/powerpc/platforms/amigaone/Kconfig
+++ b/arch/powerpc/platforms/amigaone/Kconfig
@@ -8,7 +8,7 @@ config AMIGAONE
 	select NOT_COHERENT_CACHE
 	select CHECK_CACHE_COHERENCY
 	select DEFAULT_UIMAGE
-	select PCSPKR_PLATFORM
+	select HAVE_PCSPKR_PLATFORM
 	help
 	Select AmigaOne for the following machines:
 	- AmigaOne SE/Teron CX (G3 only)
diff --git a/arch/powerpc/platforms/chrp/Kconfig b/arch/powerpc/platforms/chrp/Kconfig
index bc0b0ef..d3cdab5 100644
--- a/arch/powerpc/platforms/chrp/Kconfig
+++ b/arch/powerpc/platforms/chrp/Kconfig
@@ -1,6 +1,7 @@
 config PPC_CHRP
 	bool "Common Hardware Reference Platform (CHRP) based machines"
 	depends on 6xx
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PPC_I8259
 	select PPC_INDIRECT_PCI
diff --git a/arch/powerpc/platforms/prep/Kconfig b/arch/powerpc/platforms/prep/Kconfig
index bf8330e..f0536c7 100644
--- a/arch/powerpc/platforms/prep/Kconfig
+++ b/arch/powerpc/platforms/prep/Kconfig
@@ -1,6 +1,7 @@
 config PPC_PREP
 	bool "PowerPC Reference Platform (PReP) based machines"
 	depends on 6xx && BROKEN
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PPC_I8259
 	select PPC_INDIRECT_PCI
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index 71af4c5..05cf476 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -1,6 +1,7 @@
 config PPC_PSERIES
 	depends on PPC64 && PPC_BOOK3S
 	bool "IBM pSeries & new (POWER5-based) iSeries"
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PCI_MSI
 	select PPC_XICS
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index da34972..c2aa5ac 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -20,6 +20,7 @@ config X86
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select HAVE_IDE
 	select HAVE_OPROFILE
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_IRQ_WORK
 	select HAVE_IOREMAP_PROT
diff --git a/init/Kconfig b/init/Kconfig
index ebafac4..68c231c 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -999,14 +999,18 @@ config ELF_CORE
 	help
 	  Enable support for generating core dumps. Disabling saves about 4k.
 
+
 config PCSPKR_PLATFORM
 	bool "Enable PC-Speaker support" if EXPERT
-	depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
+	depends on HAVE_PCSPKR_PLATFORM
 	default y
 	help
           This option allows to disable the internal PC-Speaker
           support, saving some memory.
 
+config HAVE_PCSPKR_PLATFORM
+	bool
+
 config BASE_FULL
 	default y
 	bool "Enable full-sized data structures for core" if EXPERT

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] pcpskr: MIPS: Make config dependencies finer grained
  2011-06-01 18:05 ` [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained ralf
@ 2011-06-09 11:21   ` tip-bot for Ralf Baechle
  2011-06-09 13:09   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 11:21 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, ralf, tglx

Commit-ID:  5168b2792f59b4a51806b6fc8b1df43109db0968
Gitweb:     http://git.kernel.org/tip/5168b2792f59b4a51806b6fc8b1df43109db0968
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:10 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 12:03:52 +0200

pcpskr: MIPS: Make config dependencies finer grained

Only the Siemens-Nixdorf RM series workstations and the Jazz family
workstations have PC speakers built in; Malta can connect one via the
infamous AMR connector with an AMR sound card or a little creativity.
So we don't want to offer the PC speaker driver on all MIPS systems.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Link: http://lkml.kernel.org/r/20110601180611.061710714@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/mips/Kconfig |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index bf35bb6..45f7aac 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -5,7 +5,6 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
-	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
@@ -186,6 +185,7 @@ config MACH_JAZZ
 	select CSRC_R4K
 	select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN
 	select GENERIC_ISA_DMA
+	select HAVE_PCSPKR_PLATFORM
 	select IRQ_CPU
 	select I8253
 	select I8259
@@ -267,6 +267,7 @@ config MIPS_MALTA
 	select CSRC_R4K
 	select DMA_NONCOHERENT
 	select GENERIC_ISA_DMA
+	select HAVE_PCSPKR_PLATFORM
 	select IRQ_CPU
 	select IRQ_GIC
 	select HW_HAS_PCI
@@ -641,6 +642,7 @@ config SNI_RM
 	select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN
 	select DMA_NONCOHERENT
 	select GENERIC_ISA_DMA
+	select HAVE_PCSPKR_PLATFORM
 	select HW_HAS_EISA
 	select HW_HAS_PCI
 	select IRQ_CPU

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Create linux/i8253.h and use it in all 8253 related files
  2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
  2011-06-09 11:16   ` [tip:timers/cleanup] i8253: Create linux/i8253.h and use it in all 8253 related files tip-bot for Ralf Baechle
@ 2011-06-09 13:04   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:04 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, ralf, tglx

Commit-ID:  334955ef964bee9d3b1e20966847eee28cfd05f6
Gitweb:     http://git.kernel.org/tip/334955ef964bee9d3b1e20966847eee28cfd05f6
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:04:57 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:37 +0200

i8253: Create linux/i8253.h and use it in all 8253 related files

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Link: http://lkml.kernel.org/r/20110601180610.054254048@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

 arch/arm/mach-footbridge/isa-timer.c |    2 +-
 arch/mips/cobalt/time.c              |    2 +-
 arch/mips/jazz/irq.c                 |    2 +-
 arch/mips/kernel/i8253.c             |    2 +-
 arch/mips/mti-malta/malta-time.c     |    2 +-
 arch/mips/sgi-ip22/ip22-time.c       |    2 +-
 arch/mips/sni/time.c                 |    2 +-
 arch/x86/kernel/apic/apic.c          |    2 +-
 arch/x86/kernel/apm_32.c             |    2 +-
 arch/x86/kernel/hpet.c               |    2 +-
 arch/x86/kernel/i8253.c              |    2 +-
 arch/x86/kernel/time.c               |    2 +-
 drivers/block/hd.c                   |    2 +-
 drivers/clocksource/i8253.c          |    2 +-
 drivers/input/gameport/gameport.c    |    2 +-
 drivers/input/joystick/analog.c      |    2 +-
 drivers/input/misc/pcspkr.c          |    2 +-
 include/linux/i8253.h                |   11 +++++++++++
 sound/drivers/pcsp/pcsp.h            |    2 +-
 19 files changed, 29 insertions(+), 18 deletions(-)

---
 arch/arm/mach-footbridge/isa-timer.c               |    2 +-
 arch/mips/cobalt/time.c                            |    2 +-
 arch/mips/jazz/irq.c                               |    2 +-
 arch/mips/kernel/i8253.c                           |    2 +-
 arch/mips/mti-malta/malta-time.c                   |    2 +-
 arch/mips/sgi-ip22/ip22-time.c                     |    2 +-
 arch/mips/sni/time.c                               |    2 +-
 arch/x86/kernel/apic/apic.c                        |    2 +-
 arch/x86/kernel/apm_32.c                           |    2 +-
 arch/x86/kernel/hpet.c                             |    2 +-
 arch/x86/kernel/i8253.c                            |    2 +-
 arch/x86/kernel/time.c                             |    2 +-
 drivers/block/hd.c                                 |    2 +-
 drivers/clocksource/i8253.c                        |    2 +-
 drivers/input/gameport/gameport.c                  |    2 +-
 drivers/input/joystick/analog.c                    |    2 +-
 drivers/input/misc/pcspkr.c                        |    2 +-
 .../include/asm/ide.h => include/linux/i8253.h     |   10 ++++------
 sound/drivers/pcsp/pcsp.h                          |    2 +-
 19 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c
index 7020f1a..3c7367b 100644
--- a/arch/arm/mach-footbridge/isa-timer.c
+++ b/arch/arm/mach-footbridge/isa-timer.c
@@ -6,6 +6,7 @@
  */
 #include <linux/clockchips.h>
 #include <linux/clocksource.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -14,7 +15,6 @@
 #include <linux/timex.h>
 
 #include <asm/irq.h>
-#include <asm/i8253.h>
 #include <asm/mach/time.h>
 
 #include "common.h"
diff --git a/arch/mips/cobalt/time.c b/arch/mips/cobalt/time.c
index 0162f9e..3bff3b8 100644
--- a/arch/mips/cobalt/time.c
+++ b/arch/mips/cobalt/time.c
@@ -17,10 +17,10 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
+#include <linux/i8253.h>
 #include <linux/init.h>
 
 #include <asm/gt64120.h>
-#include <asm/i8253.h>
 #include <asm/time.h>
 
 #define GT641XX_BASE_CLOCK	50000000	/* 50MHz */
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index 260df47..ca9bd20 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -7,6 +7,7 @@
  * Copyright (C) 1994 - 2001, 2003, 07 Ralf Baechle
  */
 #include <linux/clockchips.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
@@ -15,7 +16,6 @@
 #include <linux/irq.h>
 
 #include <asm/irq_cpu.h>
-#include <asm/i8253.h>
 #include <asm/i8259.h>
 #include <asm/io.h>
 #include <asm/jazz.h>
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
index 391221b..82b5a9f 100644
--- a/arch/mips/kernel/i8253.c
+++ b/arch/mips/kernel/i8253.c
@@ -3,6 +3,7 @@
  *
  */
 #include <linux/clockchips.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/jiffies.h>
@@ -12,7 +13,6 @@
 #include <linux/irq.h>
 
 #include <asm/delay.h>
-#include <asm/i8253.h>
 #include <asm/io.h>
 #include <asm/time.h>
 
diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c
index 1620b83..f8ee945 100644
--- a/arch/mips/mti-malta/malta-time.c
+++ b/arch/mips/mti-malta/malta-time.c
@@ -19,6 +19,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
@@ -31,7 +32,6 @@
 #include <asm/mipsregs.h>
 #include <asm/mipsmtregs.h>
 #include <asm/hardirq.h>
-#include <asm/i8253.h>
 #include <asm/irq.h>
 #include <asm/div64.h>
 #include <asm/cpu.h>
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index 1a94c98..6071924 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -10,6 +10,7 @@
  * Copyright (C) 2003, 06 Ralf Baechle (ralf@linux-mips.org)
  */
 #include <linux/bcd.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
@@ -20,7 +21,6 @@
 
 #include <asm/cpu.h>
 #include <asm/mipsregs.h>
-#include <asm/i8253.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/time.h>
diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c
index 0904d4d..ec0be14 100644
--- a/arch/mips/sni/time.c
+++ b/arch/mips/sni/time.c
@@ -1,11 +1,11 @@
 #include <linux/types.h>
+#include <linux/i8253.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/smp.h>
 #include <linux/time.h>
 #include <linux/clockchips.h>
 
-#include <asm/i8253.h>
 #include <asm/sni.h>
 #include <asm/time.h>
 #include <asm-generic/rtc.h>
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index b961af8..f3c3784 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -27,6 +27,7 @@
 #include <linux/syscore_ops.h>
 #include <linux/delay.h>
 #include <linux/timex.h>
+#include <linux/i8253.h>
 #include <linux/dmar.h>
 #include <linux/init.h>
 #include <linux/cpu.h>
@@ -39,7 +40,6 @@
 #include <asm/pgalloc.h>
 #include <asm/atomic.h>
 #include <asm/mpspec.h>
-#include <asm/i8253.h>
 #include <asm/i8259.h>
 #include <asm/proto.h>
 #include <asm/apic.h>
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 965a766..a30740e 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -229,11 +229,11 @@
 #include <linux/jiffies.h>
 #include <linux/acpi.h>
 #include <linux/syscore_ops.h>
+#include <linux/i8253.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/desc.h>
-#include <asm/i8253.h>
 #include <asm/olpc.h>
 #include <asm/paravirt.h>
 #include <asm/reboot.h>
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 6781765..85b8a8a 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -4,6 +4,7 @@
 #include <linux/sysdev.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
+#include <linux/i8253.h>
 #include <linux/slab.h>
 #include <linux/hpet.h>
 #include <linux/init.h>
@@ -12,7 +13,6 @@
 #include <linux/io.h>
 
 #include <asm/fixmap.h>
-#include <asm/i8253.h>
 #include <asm/hpet.h>
 
 #define HPET_MASK			CLOCKSOURCE_MASK(32)
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index fb66dc9..3235550 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -9,10 +9,10 @@
 #include <linux/module.h>
 #include <linux/timex.h>
 #include <linux/delay.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/io.h>
 
-#include <asm/i8253.h>
 #include <asm/hpet.h>
 #include <asm/smp.h>
 
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
index 00cbb27..5a64d05 100644
--- a/arch/x86/kernel/time.c
+++ b/arch/x86/kernel/time.c
@@ -11,13 +11,13 @@
 
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
+#include <linux/i8253.h>
 #include <linux/time.h>
 #include <linux/mca.h>
 
 #include <asm/vsyscall.h>
 #include <asm/x86_init.h>
 #include <asm/i8259.h>
-#include <asm/i8253.h>
 #include <asm/timer.h>
 #include <asm/hpet.h>
 #include <asm/time.h>
diff --git a/drivers/block/hd.c b/drivers/block/hd.c
index 007c630..b52c9ca 100644
--- a/drivers/block/hd.c
+++ b/drivers/block/hd.c
@@ -155,7 +155,7 @@ else \
 
 #if (HD_DELAY > 0)
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 unsigned long last_req;
 
diff --git a/drivers/clocksource/i8253.c b/drivers/clocksource/i8253.c
index 225c176..33735eb 100644
--- a/drivers/clocksource/i8253.c
+++ b/drivers/clocksource/i8253.c
@@ -7,7 +7,7 @@
 #include <linux/spinlock.h>
 #include <linux/timex.h>
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 /*
  * Since the PIT overflows every tick, its not very useful
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index 5b8f59d..c351aa4 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -47,7 +47,7 @@ static void gameport_disconnect_port(struct gameport *gameport);
 
 #if defined(__i386__)
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 #define DELTA(x,y)      ((y)-(x)+((y)<(x)?1193182/HZ:0))
 #define GET_TIME(x)     do { x = get_time_pit(); } while (0)
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 4afe0a3..9882971 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -136,7 +136,7 @@ struct analog_port {
 
 #ifdef __i386__
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 #define GET_TIME(x)	do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)
 #define DELTA(x,y)	(cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0)))
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index f080dd3..2aa9d90 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -27,7 +27,7 @@ MODULE_ALIAS("platform:pcspkr");
 
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 #else
 #include <asm/8253pit.h>
 static DEFINE_RAW_SPINLOCK(i8253_lock);
diff --git a/arch/mips/include/asm/ide.h b/include/linux/i8253.h
similarity index 55%
copy from arch/mips/include/asm/ide.h
copy to include/linux/i8253.h
index bb674c3..d2cba88 100644
--- a/arch/mips/include/asm/ide.h
+++ b/include/linux/i8253.h
@@ -2,12 +2,10 @@
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
- *
- * This file contains the MIPS architecture specific IDE code.
  */
-#ifndef __ASM_IDE_H
-#define __ASM_IDE_H
+#ifndef __LINUX_I8253_H
+#define __LINUX_I8253_H
 
-#include <ide.h>
+#include <asm/i8253.h>
 
-#endif /* __ASM_IDE_H */
+#endif /* __LINUX_I8253_H */
diff --git a/sound/drivers/pcsp/pcsp.h b/sound/drivers/pcsp/pcsp.h
index 4ff6c8c..6757c30 100644
--- a/sound/drivers/pcsp/pcsp.h
+++ b/sound/drivers/pcsp/pcsp.h
@@ -13,7 +13,7 @@
 #include <linux/timex.h>
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 #else
 #include <asm/8253pit.h>
 static DEFINE_RAW_SPINLOCK(i8253_lock);

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Unify all kernel declarations of i8253_lock
  2011-06-01 18:04   ` ralf at linux-mips.org
  (?)
  (?)
@ 2011-06-09 13:04   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:04 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, linux, ralf, tglx

Commit-ID:  cb2455aa274b780802c593fecf115240a655d809
Gitweb:     http://git.kernel.org/tip/cb2455aa274b780802c593fecf115240a655d809
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:04:58 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:38 +0200

i8253: Unify all kernel declarations of i8253_lock

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org
Link: http://lkml.kernel.org/r/20110601180610.134151920@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/arm/include/asm/i8253.h  |    9 ---------
 arch/mips/include/asm/i8253.h |   12 ------------
 arch/x86/include/asm/i8253.h  |   10 ----------
 include/linux/i8253.h         |   14 ++++++++++++++
 4 files changed, 14 insertions(+), 31 deletions(-)

diff --git a/arch/arm/include/asm/i8253.h b/arch/arm/include/asm/i8253.h
index 70656b6..5b41b92 100644
--- a/arch/arm/include/asm/i8253.h
+++ b/arch/arm/include/asm/i8253.h
@@ -1,15 +1,6 @@
 #ifndef __ASMARM_I8253_H
 #define __ASMARM_I8253_H
 
-/* i8253A PIT registers */
-#define PIT_MODE	0x43
-#define PIT_CH0		0x40
-
 #define PIT_LATCH	((PIT_TICK_RATE + HZ / 2) / HZ)
 
-extern raw_spinlock_t i8253_lock;
-
-#define outb_pit	outb_p
-#define inb_pit		inb_p
-
 #endif
diff --git a/arch/mips/include/asm/i8253.h b/arch/mips/include/asm/i8253.h
index 9ad0113..32ec1f0 100644
--- a/arch/mips/include/asm/i8253.h
+++ b/arch/mips/include/asm/i8253.h
@@ -5,20 +5,8 @@
 #ifndef __ASM_I8253_H
 #define __ASM_I8253_H
 
-#include <linux/spinlock.h>
-
-/* i8253A PIT registers */
-#define PIT_MODE		0x43
-#define PIT_CH0			0x40
-#define PIT_CH2			0x42
-
 #define PIT_LATCH		LATCH
 
-extern raw_spinlock_t i8253_lock;
-
 extern void setup_pit_timer(void);
 
-#define inb_pit inb_p
-#define outb_pit outb_p
-
 #endif /* __ASM_I8253_H */
diff --git a/arch/x86/include/asm/i8253.h b/arch/x86/include/asm/i8253.h
index 65aaa91..20480ce 100644
--- a/arch/x86/include/asm/i8253.h
+++ b/arch/x86/include/asm/i8253.h
@@ -1,20 +1,10 @@
 #ifndef _ASM_X86_I8253_H
 #define _ASM_X86_I8253_H
 
-/* i8253A PIT registers */
-#define PIT_MODE		0x43
-#define PIT_CH0			0x40
-#define PIT_CH2			0x42
-
 #define PIT_LATCH	LATCH
 
-extern raw_spinlock_t i8253_lock;
-
 extern struct clock_event_device *global_clock_event;
 
 extern void setup_pit_timer(void);
 
-#define inb_pit		inb_p
-#define outb_pit	outb_p
-
 #endif /* _ASM_X86_I8253_H */
diff --git a/include/linux/i8253.h b/include/linux/i8253.h
index d2cba88..13048d3 100644
--- a/include/linux/i8253.h
+++ b/include/linux/i8253.h
@@ -2,10 +2,24 @@
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
+ *
+ *  Machine specific IO port address definition for generic.
+ *  Written by Osamu Tomita <tomita@cinet.co.jp>
  */
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/spinlock.h>
 #include <asm/i8253.h>
 
+/* i8253A PIT registers */
+#define PIT_MODE	0x43
+#define PIT_CH0		0x40
+#define PIT_CH2		0x42
+
+#define inb_pit         inb_p
+#define outb_pit        outb_p
+
+extern raw_spinlock_t i8253_lock;
+
 #endif /* __LINUX_I8253_H */

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Consolidate all kernel definitions of i8253_lock
  2011-06-01 18:04 ` [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c ralf
  2011-06-09 11:17   ` [tip:timers/cleanup] i8253: Consolidate all kernel definitions of i8253_lock tip-bot for Ralf Baechle
@ 2011-06-09 13:04   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:04 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, linux, ralf, tglx

Commit-ID:  15f304b664c0d0a3e76ed3a9ce3615a86908babe
Gitweb:     http://git.kernel.org/tip/15f304b664c0d0a3e76ed3a9ce3615a86908babe
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:04:59 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:38 +0200

i8253: Consolidate all kernel definitions of i8253_lock

Move them to drivers/clocksource/i8253.c and remove the
implementations in arch/

[ tglx: Avoid the extra file in lib - folded arch patches in. The
  export will become conditional in a later step ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Link: http://lkml.kernel.org/r/20110601180610.221426078@duck.linux-mips.net
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/arm/mach-footbridge/isa-timer.c |    2 --
 arch/mips/kernel/i8253.c             |    3 ---
 arch/x86/Kconfig                     |    1 +
 arch/x86/kernel/i8253.c              |    3 ---
 drivers/clocksource/Kconfig          |    6 ++++++
 drivers/clocksource/Makefile         |    2 +-
 drivers/clocksource/i8253.c          |   13 ++++++++++++-
 init/Kconfig                         |    1 +
 8 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c
index 3c7367b..71fd96d 100644
--- a/arch/arm/mach-footbridge/isa-timer.c
+++ b/arch/arm/mach-footbridge/isa-timer.c
@@ -19,8 +19,6 @@
 
 #include "common.h"
 
-DEFINE_RAW_SPINLOCK(i8253_lock);
-
 static void pit_set_mode(enum clock_event_mode mode,
 	struct clock_event_device *evt)
 {
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
index 82b5a9f..3d2ff57 100644
--- a/arch/mips/kernel/i8253.c
+++ b/arch/mips/kernel/i8253.c
@@ -16,9 +16,6 @@
 #include <asm/io.h>
 #include <asm/time.h>
 
-DEFINE_RAW_SPINLOCK(i8253_lock);
-EXPORT_SYMBOL(i8253_lock);
-
 /*
  * Initialize the PIT timer.
  *
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index da34972..e6060a1 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -70,6 +70,7 @@ config X86
 	select IRQ_FORCED_THREADING
 	select USE_GENERIC_SMP_HELPERS if SMP
 	select HAVE_BPF_JIT if (X86_64 && NET)
+	select I8253_LOCK
 
 config INSTRUCTION_DECODER
 	def_bool (KPROBES || PERF_EVENTS)
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index 3235550..9c92b6f 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -16,9 +16,6 @@
 #include <asm/hpet.h>
 #include <asm/smp.h>
 
-DEFINE_RAW_SPINLOCK(i8253_lock);
-EXPORT_SYMBOL(i8253_lock);
-
 /*
  * HPET replaces the PIT, when enabled. So we need to know, which of
  * the two timers is used
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 96c9219..330343b 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -1,5 +1,11 @@
 config CLKSRC_I8253
 	bool
 
+config I8253_LOCK
+	bool
+
+config CLKBLD_I8253
+	def_bool y if CLKSRC_I8253 || I8253_LOCK
+
 config CLKSRC_MMIO
 	bool
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index b995942..7922a0c 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -6,5 +6,5 @@ obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC)	+= cs5535-clockevt.o
 obj-$(CONFIG_SH_TIMER_CMT)	+= sh_cmt.o
 obj-$(CONFIG_SH_TIMER_MTU2)	+= sh_mtu2.o
 obj-$(CONFIG_SH_TIMER_TMU)	+= sh_tmu.o
-obj-$(CONFIG_CLKSRC_I8253)	+= i8253.o
+obj-$(CONFIG_CLKBLD_I8253)	+= i8253.o
 obj-$(CONFIG_CLKSRC_MMIO)	+= mmio.o
diff --git a/drivers/clocksource/i8253.c b/drivers/clocksource/i8253.c
index 33735eb..e594f52 100644
--- a/drivers/clocksource/i8253.c
+++ b/drivers/clocksource/i8253.c
@@ -6,10 +6,20 @@
 #include <linux/io.h>
 #include <linux/spinlock.h>
 #include <linux/timex.h>
-
+#include <linux/module.h>
 #include <linux/i8253.h>
 
 /*
+ * Protects access to I/O ports
+ *
+ * 0040-0043 : timer0, i8253 / i8254
+ * 0061-0061 : NMI Control Register which contains two speaker control bits.
+ */
+DEFINE_RAW_SPINLOCK(i8253_lock);
+EXPORT_SYMBOL(i8253_lock);
+
+#ifdef CONFIG_CLKSRC_I8253
+/*
  * Since the PIT overflows every tick, its not very useful
  * to just read by itself. So use jiffies to emulate a free
  * running counter:
@@ -86,3 +96,4 @@ int __init clocksource_i8253_init(void)
 {
 	return clocksource_register_hz(&i8253_cs, PIT_TICK_RATE);
 }
+#endif
diff --git a/init/Kconfig b/init/Kconfig
index ebafac4..2d2ef44 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1002,6 +1002,7 @@ config ELF_CORE
 config PCSPKR_PLATFORM
 	bool "Enable PC-Speaker support" if EXPERT
 	depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
+	select I8253_LOCK
 	default y
 	help
           This option allows to disable the internal PC-Speaker

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Make pcspkr input driver use the shared i8253_lock
  2011-06-01 18:05 ` [patch 06/14] i8253: Make pcspkr input driver " ralf
  2011-06-09 11:17   ` [tip:timers/cleanup] " tip-bot for Ralf Baechle
@ 2011-06-09 13:05   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:05 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, dmitry.torokhov, ralf, tglx

Commit-ID:  16ba9b061223c8a58b9b2e0dd01435111c4e902a
Gitweb:     http://git.kernel.org/tip/16ba9b061223c8a58b9b2e0dd01435111c4e902a
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:02 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:38 +0200

i8253: Make pcspkr input driver use the shared i8253_lock

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Link: http://lkml.kernel.org/r/20110601180610.453577265@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 drivers/input/misc/pcspkr.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index 2aa9d90..34f4d2e 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -14,6 +14,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/platform_device.h>
@@ -25,14 +26,6 @@ MODULE_DESCRIPTION("PC Speaker beeper driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pcspkr");
 
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
-#include <linux/i8253.h>
-#else
-#include <asm/8253pit.h>
-static DEFINE_RAW_SPINLOCK(i8253_lock);
-#endif
-
 static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
 	unsigned int count = 0;

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Make pcsp sound driver use the shared i8253_lock
  2011-06-01 18:05   ` ralf
                     ` (2 preceding siblings ...)
  (?)
@ 2011-06-09 13:05   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:05 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, ralf, tglx, tiwai, perex

Commit-ID:  8e1b5adfbee97a187d3e7188a0b248619b76682e
Gitweb:     http://git.kernel.org/tip/8e1b5adfbee97a187d3e7188a0b248619b76682e
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:03 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:39 +0200

i8253: Make pcsp sound driver use the shared i8253_lock

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Acked-by: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Link: http://lkml.kernel.org/r/20110601180610.532642190@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 sound/drivers/pcsp/pcsp.h |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/sound/drivers/pcsp/pcsp.h b/sound/drivers/pcsp/pcsp.h
index 6757c30..fc7a2dc 100644
--- a/sound/drivers/pcsp/pcsp.h
+++ b/sound/drivers/pcsp/pcsp.h
@@ -10,14 +10,8 @@
 #define __PCSP_H__
 
 #include <linux/hrtimer.h>
-#include <linux/timex.h>
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
 #include <linux/i8253.h>
-#else
-#include <asm/8253pit.h>
-static DEFINE_RAW_SPINLOCK(i8253_lock);
-#endif
+#include <linux/timex.h>
 
 #define PCSP_SOUND_VERSION 0x400	/* read 4.00 */
 #define PCSP_DEBUG 0

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] alpha: i8253: Cleanup remaining users of i8253pit.h
  2011-06-01 18:05 ` [patch 08/14] i8253: Alpha: Cleanup remaining users of i8253pit.h ralf
  2011-06-09 11:19   ` [tip:timers/cleanup] alpha: i8253: " tip-bot for Ralf Baechle
@ 2011-06-09 13:06   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:06 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, ralf, mattst88, ink, tglx, rth

Commit-ID:  36af1b461293e838d6f47edd6f59f0beac222600
Gitweb:     http://git.kernel.org/tip/36af1b461293e838d6f47edd6f59f0beac222600
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:04 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:39 +0200

alpha: i8253: Cleanup remaining users of i8253pit.h

The Alpha <asm/i8253pit.h> header is empty so this inclusion can just be
removed.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Link: http://lkml.kernel.org/r/20110601180610.608083130@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/alpha/kernel/sys_ruffian.c |    1 -
 arch/alpha/kernel/time.c        |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c
index 8de1046..f33648e 100644
--- a/arch/alpha/kernel/sys_ruffian.c
+++ b/arch/alpha/kernel/sys_ruffian.c
@@ -26,7 +26,6 @@
 #include <asm/pgtable.h>
 #include <asm/core_cia.h>
 #include <asm/tlbflush.h>
-#include <asm/8253pit.h>
 
 #include "proto.h"
 #include "irq_impl.h"
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 818e74e..de406c7 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -46,7 +46,6 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/hwrpb.h>
-#include <asm/8253pit.h>
 #include <asm/rtc.h>
 
 #include <linux/mc146818rtc.h>

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Alpha, PowerPC: Remove unused asm/8253pit.h
  2011-06-01 18:05   ` ralf
                     ` (2 preceding siblings ...)
  (?)
@ 2011-06-09 13:07   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, paulus, hpa, mingo, benh, ralf, mattst88, ink, tglx, rth

Commit-ID:  75bba0143454d0fef1b42d5b35cb5bd2f9388901
Gitweb:     http://git.kernel.org/tip/75bba0143454d0fef1b42d5b35cb5bd2f9388901
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:05 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:39 +0200

i8253: Alpha, PowerPC: Remove unused asm/8253pit.h

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/20110601180610.684557757@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/alpha/include/asm/8253pit.h   |    3 ---
 arch/powerpc/include/asm/8253pit.h |    3 ---
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/arch/alpha/include/asm/8253pit.h b/arch/alpha/include/asm/8253pit.h
deleted file mode 100644
index a71c9c1..0000000
--- a/arch/alpha/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */
diff --git a/arch/powerpc/include/asm/8253pit.h b/arch/powerpc/include/asm/8253pit.h
deleted file mode 100644
index a71c9c1..0000000
--- a/arch/powerpc/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] x86: i8253: Consolidate definitions of global_clock_event
  2011-06-01 18:05 ` [patch 10/14] i8253: x86: Consolidate definitions of global_clock_event ralf
  2011-06-09 11:19   ` [tip:timers/cleanup] x86: i8253: " tip-bot for Ralf Baechle
@ 2011-06-09 13:07   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:07 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, ralf, tglx, venki

Commit-ID:  16f871bc30f86560017b9d34520593a28e08f373
Gitweb:     http://git.kernel.org/tip/16f871bc30f86560017b9d34520593a28e08f373
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:06 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:40 +0200

x86: i8253: Consolidate definitions of global_clock_event

There are multiple declarations of global_clock_event in header files
specific to particular clock event implementations.  Consolidate them
in <asm/time.h> and make sure all users include that header.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Venkatesh Pallipadi (Venki) <venki@google.com>
Link: http://lkml.kernel.org/r/20110601180610.762763451@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/include/asm/apb_timer.h |    1 -
 arch/x86/include/asm/i8253.h     |    2 --
 arch/x86/include/asm/time.h      |    6 ++++--
 arch/x86/kernel/apb_timer.c      |    1 +
 arch/x86/kernel/apic/apic.c      |    1 +
 arch/x86/kernel/hpet.c           |    1 +
 arch/x86/kernel/i8253.c          |    1 +
 7 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/apb_timer.h b/arch/x86/include/asm/apb_timer.h
index 2fefa50..963f7d4 100644
--- a/arch/x86/include/asm/apb_timer.h
+++ b/arch/x86/include/asm/apb_timer.h
@@ -50,7 +50,6 @@
 #define APBT_DEV_USED  1
 
 extern void apbt_time_init(void);
-extern struct clock_event_device *global_clock_event;
 extern unsigned long apbt_quick_calibrate(void);
 extern int arch_setup_apbt_irqs(int irq, int trigger, int mask, int cpu);
 extern void apbt_setup_secondary_clock(void);
diff --git a/arch/x86/include/asm/i8253.h b/arch/x86/include/asm/i8253.h
index 20480ce..3d5f5ee 100644
--- a/arch/x86/include/asm/i8253.h
+++ b/arch/x86/include/asm/i8253.h
@@ -3,8 +3,6 @@
 
 #define PIT_LATCH	LATCH
 
-extern struct clock_event_device *global_clock_event;
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
diff --git a/arch/x86/include/asm/time.h b/arch/x86/include/asm/time.h
index 7bdec4e..92b8aec 100644
--- a/arch/x86/include/asm/time.h
+++ b/arch/x86/include/asm/time.h
@@ -1,10 +1,12 @@
 #ifndef _ASM_X86_TIME_H
 #define _ASM_X86_TIME_H
 
-extern void hpet_time_init(void);
-
+#include <linux/clocksource.h>
 #include <asm/mc146818rtc.h>
 
+extern void hpet_time_init(void);
 extern void time_init(void);
 
+extern struct clock_event_device *global_clock_event;
+
 #endif /* _ASM_X86_TIME_H */
diff --git a/arch/x86/kernel/apb_timer.c b/arch/x86/kernel/apb_timer.c
index 289e928..2b6630d 100644
--- a/arch/x86/kernel/apb_timer.c
+++ b/arch/x86/kernel/apb_timer.c
@@ -44,6 +44,7 @@
 #include <asm/fixmap.h>
 #include <asm/apb_timer.h>
 #include <asm/mrst.h>
+#include <asm/time.h>
 
 #define APBT_MASK			CLOCKSOURCE_MASK(32)
 #define APBT_SHIFT			22
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index f3c3784..9da0dc0 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -48,6 +48,7 @@
 #include <asm/hpet.h>
 #include <asm/idle.h>
 #include <asm/mtrr.h>
+#include <asm/time.h>
 #include <asm/smp.h>
 #include <asm/mce.h>
 #include <asm/tsc.h>
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 85b8a8a..0f4b065 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -14,6 +14,7 @@
 
 #include <asm/fixmap.h>
 #include <asm/hpet.h>
+#include <asm/time.h>
 
 #define HPET_MASK			CLOCKSOURCE_MASK(32)
 
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index 9c92b6f..5783e6d 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -14,6 +14,7 @@
 #include <linux/io.h>
 
 #include <asm/hpet.h>
+#include <asm/time.h>
 #include <asm/smp.h>
 
 /*

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Consolidate definitions of PIT_LATCH
  2011-06-01 18:05   ` ralf
                     ` (2 preceding siblings ...)
  (?)
@ 2011-06-09 13:07   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:07 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, linux, ralf, tglx

Commit-ID:  49cf3f29a1ef2e59f1be823e376c1fbac586eb8d
Gitweb:     http://git.kernel.org/tip/49cf3f29a1ef2e59f1be823e376c1fbac586eb8d
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:07 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:40 +0200

i8253: Consolidate definitions of PIT_LATCH

x86 defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as PIT_TICK_RATE.

MIPS defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as 1193182.

ARM defines PITCH_LATCH as ((PIT_TICK_RATE + HZ / 2) / HZ) - and that's
the sanest thing and equivalent to above definitions so use that as the
new definition in <linux/i8253.h>.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org
Link: http://lkml.kernel.org/r/20110601180610.832810002@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/arm/include/asm/i8253.h  |    2 --
 arch/mips/include/asm/i8253.h |    2 --
 arch/x86/include/asm/i8253.h  |    2 --
 include/linux/i8253.h         |    4 ++++
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/i8253.h b/arch/arm/include/asm/i8253.h
index 5b41b92..fee59eb 100644
--- a/arch/arm/include/asm/i8253.h
+++ b/arch/arm/include/asm/i8253.h
@@ -1,6 +1,4 @@
 #ifndef __ASMARM_I8253_H
 #define __ASMARM_I8253_H
 
-#define PIT_LATCH	((PIT_TICK_RATE + HZ / 2) / HZ)
-
 #endif
diff --git a/arch/mips/include/asm/i8253.h b/arch/mips/include/asm/i8253.h
index 32ec1f0..26f4eb1 100644
--- a/arch/mips/include/asm/i8253.h
+++ b/arch/mips/include/asm/i8253.h
@@ -5,8 +5,6 @@
 #ifndef __ASM_I8253_H
 #define __ASM_I8253_H
 
-#define PIT_LATCH		LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* __ASM_I8253_H */
diff --git a/arch/x86/include/asm/i8253.h b/arch/x86/include/asm/i8253.h
index 3d5f5ee..0049dc9 100644
--- a/arch/x86/include/asm/i8253.h
+++ b/arch/x86/include/asm/i8253.h
@@ -1,8 +1,6 @@
 #ifndef _ASM_X86_I8253_H
 #define _ASM_X86_I8253_H
 
-#define PIT_LATCH	LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
diff --git a/include/linux/i8253.h b/include/linux/i8253.h
index 13048d3..1ec6323 100644
--- a/include/linux/i8253.h
+++ b/include/linux/i8253.h
@@ -9,7 +9,9 @@
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/param.h>
 #include <linux/spinlock.h>
+#include <linux/timex.h>
 #include <asm/i8253.h>
 
 /* i8253A PIT registers */
@@ -17,6 +19,8 @@
 #define PIT_CH0		0x40
 #define PIT_CH2		0x42
 
+#define PIT_LATCH	((PIT_TICK_RATE + HZ/2) / HZ)
+
 #define inb_pit         inb_p
 #define outb_pit        outb_p
 

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] i8253: Move remaining content and delete asm/i8253.h
  2011-06-01 18:05   ` ralf
                     ` (3 preceding siblings ...)
  (?)
@ 2011-06-09 13:08   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:08 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, linux, ralf, tglx

Commit-ID:  850492760cfd38d14d64a5fc6d636091464f755e
Gitweb:     http://git.kernel.org/tip/850492760cfd38d14d64a5fc6d636091464f755e
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:08 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:40 +0200

i8253: Move remaining content and delete asm/i8253.h

Move setup_pit_timer() declaration to the common header file and
remove the arch specific ones.

[ tglx: Move it to linux/i8253.h instead of asm/mips and asm/x86 ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-mips@linux-mips.org
Cc: Sergei Shtylyov <sshtylyov@mvista.com
Link: http://lkml.kernel.org/r/20110601180610.913463093@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/arm/include/asm/i8253.h  |    4 ----
 arch/mips/include/asm/i8253.h |   10 ----------
 arch/x86/include/asm/i8253.h  |    6 ------
 include/linux/i8253.h         |    3 ++-
 4 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/arch/arm/include/asm/i8253.h b/arch/arm/include/asm/i8253.h
deleted file mode 100644
index fee59eb..0000000
--- a/arch/arm/include/asm/i8253.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __ASMARM_I8253_H
-#define __ASMARM_I8253_H
-
-#endif
diff --git a/arch/mips/include/asm/i8253.h b/arch/mips/include/asm/i8253.h
deleted file mode 100644
index 26f4eb1..0000000
--- a/arch/mips/include/asm/i8253.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  Machine specific IO port address definition for generic.
- *  Written by Osamu Tomita <tomita@cinet.co.jp>
- */
-#ifndef __ASM_I8253_H
-#define __ASM_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* __ASM_I8253_H */
diff --git a/arch/x86/include/asm/i8253.h b/arch/x86/include/asm/i8253.h
deleted file mode 100644
index 0049dc9..0000000
--- a/arch/x86/include/asm/i8253.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_X86_I8253_H
-#define _ASM_X86_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* _ASM_X86_I8253_H */
diff --git a/include/linux/i8253.h b/include/linux/i8253.h
index 1ec6323..76039c8 100644
--- a/include/linux/i8253.h
+++ b/include/linux/i8253.h
@@ -12,7 +12,6 @@
 #include <linux/param.h>
 #include <linux/spinlock.h>
 #include <linux/timex.h>
-#include <asm/i8253.h>
 
 /* i8253A PIT registers */
 #define PIT_MODE	0x43
@@ -26,4 +25,6 @@
 
 extern raw_spinlock_t i8253_lock;
 
+extern void setup_pit_timer(void);
+
 #endif /* __LINUX_I8253_H */

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] pcspkr: Cleanup Kconfig dependencies
  2011-06-01 18:05   ` ralf
                     ` (2 preceding siblings ...)
  (?)
@ 2011-06-09 13:08   ` tip-bot for Ralf Baechle
  -1 siblings, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:08 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, paulus, hpa, mingo, gerhard_pircher, benh, ralf,
	mattst88, ink, tglx, rth

Commit-ID:  8761f1ab717cac0616f8cf7ec589ae021c739113
Gitweb:     http://git.kernel.org/tip/8761f1ab717cac0616f8cf7ec589ae021c739113
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:09 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:41 +0200

pcspkr: Cleanup Kconfig dependencies

Lenghty lists of the kind "depends on ARCH1 || ARCH2 ... || ARCH123" are
usually either wrong or too coarse grained.  Or plain an ugly sin.

[ tglx: Fixed up amigaone ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linux-alpha@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Gerhard Pircher <gerhard_pircher@gmx.net>
Link: http://lkml.kernel.org/r/20110601180610.984881988@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/alpha/Kconfig                      |    1 +
 arch/mips/Kconfig                       |    1 +
 arch/powerpc/platforms/amigaone/Kconfig |    2 +-
 arch/powerpc/platforms/chrp/Kconfig     |    1 +
 arch/powerpc/platforms/prep/Kconfig     |    1 +
 arch/powerpc/platforms/pseries/Kconfig  |    1 +
 arch/x86/Kconfig                        |    1 +
 init/Kconfig                            |    6 +++++-
 8 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 60219bf..ca2da8d 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -6,6 +6,7 @@ config ALPHA
 	select HAVE_OPROFILE
 	select HAVE_SYSCALL_WRAPPERS
 	select HAVE_IRQ_WORK
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_DMA_ATTRS
 	select HAVE_GENERIC_HARDIRQS
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 653da62..bf35bb6 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -5,6 +5,7 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
diff --git a/arch/powerpc/platforms/amigaone/Kconfig b/arch/powerpc/platforms/amigaone/Kconfig
index 0224767..128de25 100644
--- a/arch/powerpc/platforms/amigaone/Kconfig
+++ b/arch/powerpc/platforms/amigaone/Kconfig
@@ -8,7 +8,7 @@ config AMIGAONE
 	select NOT_COHERENT_CACHE
 	select CHECK_CACHE_COHERENCY
 	select DEFAULT_UIMAGE
-	select PCSPKR_PLATFORM
+	select HAVE_PCSPKR_PLATFORM
 	help
 	Select AmigaOne for the following machines:
 	- AmigaOne SE/Teron CX (G3 only)
diff --git a/arch/powerpc/platforms/chrp/Kconfig b/arch/powerpc/platforms/chrp/Kconfig
index bc0b0ef..d3cdab5 100644
--- a/arch/powerpc/platforms/chrp/Kconfig
+++ b/arch/powerpc/platforms/chrp/Kconfig
@@ -1,6 +1,7 @@
 config PPC_CHRP
 	bool "Common Hardware Reference Platform (CHRP) based machines"
 	depends on 6xx
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PPC_I8259
 	select PPC_INDIRECT_PCI
diff --git a/arch/powerpc/platforms/prep/Kconfig b/arch/powerpc/platforms/prep/Kconfig
index bf8330e..f0536c7 100644
--- a/arch/powerpc/platforms/prep/Kconfig
+++ b/arch/powerpc/platforms/prep/Kconfig
@@ -1,6 +1,7 @@
 config PPC_PREP
 	bool "PowerPC Reference Platform (PReP) based machines"
 	depends on 6xx && BROKEN
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PPC_I8259
 	select PPC_INDIRECT_PCI
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index 71af4c5..05cf476 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -1,6 +1,7 @@
 config PPC_PSERIES
 	depends on PPC64 && PPC_BOOK3S
 	bool "IBM pSeries & new (POWER5-based) iSeries"
+	select HAVE_PCSPKR_PLATFORM
 	select MPIC
 	select PCI_MSI
 	select PPC_XICS
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e6060a1..2dd95b5 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -20,6 +20,7 @@ config X86
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select HAVE_IDE
 	select HAVE_OPROFILE
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_IRQ_WORK
 	select HAVE_IOREMAP_PROT
diff --git a/init/Kconfig b/init/Kconfig
index 2d2ef44..6f0e9d5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -999,15 +999,19 @@ config ELF_CORE
 	help
 	  Enable support for generating core dumps. Disabling saves about 4k.
 
+
 config PCSPKR_PLATFORM
 	bool "Enable PC-Speaker support" if EXPERT
-	depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
+	depends on HAVE_PCSPKR_PLATFORM
 	select I8253_LOCK
 	default y
 	help
           This option allows to disable the internal PC-Speaker
           support, saving some memory.
 
+config HAVE_PCSPKR_PLATFORM
+	bool
+
 config BASE_FULL
 	default y
 	bool "Enable full-sized data structures for core" if EXPERT

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [tip:timers/cleanup] pcpskr: MIPS: Make config dependencies finer grained
  2011-06-01 18:05 ` [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained ralf
  2011-06-09 11:21   ` [tip:timers/cleanup] pcpskr: " tip-bot for Ralf Baechle
@ 2011-06-09 13:09   ` tip-bot for Ralf Baechle
  1 sibling, 0 replies; 60+ messages in thread
From: tip-bot for Ralf Baechle @ 2011-06-09 13:09 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, ralf, tglx

Commit-ID:  8a118c3872945d54e0cacdea06c93527cdfb8782
Gitweb:     http://git.kernel.org/tip/8a118c3872945d54e0cacdea06c93527cdfb8782
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Wed, 1 Jun 2011 19:05:10 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 9 Jun 2011 15:01:41 +0200

pcpskr: MIPS: Make config dependencies finer grained

Only the Siemens-Nixdorf RM series workstations and the Jazz family
workstations have PC speakers built in; Malta can connect one via the
infamous AMR connector with an AMR sound card or a little creativity.
So we don't want to offer the PC speaker driver on all MIPS systems.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Link: http://lkml.kernel.org/r/20110601180611.061710714@duck.linux-mips.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/mips/Kconfig |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index bf35bb6..45f7aac 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -5,7 +5,6 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
-	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
@@ -186,6 +185,7 @@ config MACH_JAZZ
 	select CSRC_R4K
 	select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN
 	select GENERIC_ISA_DMA
+	select HAVE_PCSPKR_PLATFORM
 	select IRQ_CPU
 	select I8253
 	select I8259
@@ -267,6 +267,7 @@ config MIPS_MALTA
 	select CSRC_R4K
 	select DMA_NONCOHERENT
 	select GENERIC_ISA_DMA
+	select HAVE_PCSPKR_PLATFORM
 	select IRQ_CPU
 	select IRQ_GIC
 	select HW_HAS_PCI
@@ -641,6 +642,7 @@ config SNI_RM
 	select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN
 	select DMA_NONCOHERENT
 	select GENERIC_ISA_DMA
+	select HAVE_PCSPKR_PLATFORM
 	select HW_HAS_EISA
 	select HW_HAS_PCI
 	select IRQ_CPU

^ permalink raw reply related	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2011-06-09 13:09 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
2011-06-09 11:16   ` [tip:timers/cleanup] i8253: Create linux/i8253.h and use it in all 8253 related files tip-bot for Ralf Baechle
2011-06-09 13:04   ` tip-bot for Ralf Baechle
2011-06-01 18:04 ` [patch 02/14] i8253: Unify all kernel declarations of i8253_lock in <linux/i8253.h> ralf
2011-06-01 18:04   ` ralf at linux-mips.org
2011-06-09 11:16   ` [tip:timers/cleanup] i8253: Unify all kernel declarations of i8253_lock tip-bot for Ralf Baechle
2011-06-09 13:04   ` tip-bot for Ralf Baechle
2011-06-01 18:04 ` [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c ralf
2011-06-09 11:17   ` [tip:timers/cleanup] i8253: Consolidate all kernel definitions of i8253_lock tip-bot for Ralf Baechle
2011-06-09 13:04   ` tip-bot for Ralf Baechle
2011-06-01 18:05 ` [patch 04/14] i8253: Make MIPS use the shared i8253_lock ralf
2011-06-01 18:05 ` [patch 05/14] i8253: Make x86 " ralf
2011-06-01 18:05 ` [patch 06/14] i8253: Make pcspkr input driver " ralf
2011-06-09 11:17   ` [tip:timers/cleanup] " tip-bot for Ralf Baechle
2011-06-09 13:05   ` tip-bot for Ralf Baechle
2011-06-01 18:05 ` [patch 07/14] i8253: Make pcsp sound " ralf
2011-06-01 18:05   ` ralf
2011-06-03  9:53   ` [alsa-devel] " Takashi Iwai
2011-06-03  9:53     ` Takashi Iwai
2011-06-09 11:18   ` [tip:timers/cleanup] " tip-bot for Ralf Baechle
2011-06-09 13:05   ` tip-bot for Ralf Baechle
2011-06-01 18:05 ` [patch 08/14] i8253: Alpha: Cleanup remaining users of i8253pit.h ralf
2011-06-09 11:19   ` [tip:timers/cleanup] alpha: i8253: " tip-bot for Ralf Baechle
2011-06-09 13:06   ` tip-bot for Ralf Baechle
2011-06-01 18:05 ` [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header ralf
2011-06-01 18:05   ` ralf
2011-06-09  5:07   ` Benjamin Herrenschmidt
2011-06-09  5:07     ` Benjamin Herrenschmidt
2011-06-09 11:19   ` [tip:timers/cleanup] i8253: Alpha, PowerPC: Remove unused asm/8253pit.h tip-bot for Ralf Baechle
2011-06-09 13:07   ` tip-bot for Ralf Baechle
2011-06-01 18:05 ` [patch 10/14] i8253: x86: Consolidate definitions of global_clock_event ralf
2011-06-09 11:19   ` [tip:timers/cleanup] x86: i8253: " tip-bot for Ralf Baechle
2011-06-09 13:07   ` tip-bot for Ralf Baechle
2011-06-01 18:05 ` [patch 11/14] i8253: Consolidate definitions of PIT_LATCH ralf
2011-06-01 18:05   ` ralf at linux-mips.org
2011-06-01 18:05   ` ralf
2011-06-09 11:20   ` [tip:timers/cleanup] " tip-bot for Ralf Baechle
2011-06-09 13:07   ` tip-bot for Ralf Baechle
2011-06-01 18:05 ` [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h> ralf
2011-06-01 18:05   ` ralf at linux-mips.org
2011-06-01 18:05   ` ralf
2011-06-02 11:29   ` Sergei Shtylyov
2011-06-02 11:29     ` Sergei Shtylyov
2011-06-09 11:20   ` [tip:timers/cleanup] i8253: Move remaining content and delete asm/i8253.h tip-bot for Ralf Baechle
2011-06-09 13:08   ` tip-bot for Ralf Baechle
2011-06-01 18:05 ` [patch 13/14] PCSPKR: Cleanup Kconfig dependencies ralf
2011-06-01 18:05   ` ralf
2011-06-09  5:09   ` Benjamin Herrenschmidt
2011-06-09  5:09     ` Benjamin Herrenschmidt
2011-06-09 11:21   ` [tip:timers/cleanup] pcspkr: " tip-bot for Ralf Baechle
2011-06-09 13:08   ` tip-bot for Ralf Baechle
2011-06-01 18:05 ` [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained ralf
2011-06-09 11:21   ` [tip:timers/cleanup] pcpskr: " tip-bot for Ralf Baechle
2011-06-09 13:09   ` tip-bot for Ralf Baechle
2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
2011-06-03 18:00   ` Ralf Baechle
2011-06-03 18:00     ` Ralf Baechle
2011-06-03 19:22     ` Gerhard Pircher
2011-06-03 19:22       ` Gerhard Pircher

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.