aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/kernel/setup.c18
-rw-r--r--arch/i386/kernel/setup.c18
-rw-r--r--arch/mips/Kconfig6
-rw-r--r--arch/mips/kernel/Makefile2
-rw-r--r--arch/mips/kernel/i8253.c28
-rw-r--r--arch/powerpc/kernel/setup-common.c24
-rw-r--r--drivers/input/misc/pcspkr.c27
7 files changed, 97 insertions, 26 deletions
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index b4e5f8ff2b25..fa3f1a354b3f 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -28,6 +28,7 @@
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/ioport.h> 30#include <linux/ioport.h>
31#include <linux/platform_device.h>
31#include <linux/bootmem.h> 32#include <linux/bootmem.h>
32#include <linux/pci.h> 33#include <linux/pci.h>
33#include <linux/seq_file.h> 34#include <linux/seq_file.h>
@@ -1484,3 +1485,20 @@ alpha_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
1484#endif 1485#endif
1485 return NOTIFY_DONE; 1486 return NOTIFY_DONE;
1486} 1487}
1488
1489static __init int add_pcspkr(void)
1490{
1491 struct platform_device *pd;
1492 int ret;
1493
1494 pd = platform_device_alloc("pcspkr", -1);
1495 if (!pd)
1496 return -ENOMEM;
1497
1498 ret = platform_device_add(pd);
1499 if (ret)
1500 platform_device_put(pd);
1501
1502 return ret;
1503}
1504device_initcall(add_pcspkr);
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index ab62a9f4701e..a0b407585679 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -34,6 +34,7 @@
34#include <linux/initrd.h> 34#include <linux/initrd.h>
35#include <linux/bootmem.h> 35#include <linux/bootmem.h>
36#include <linux/seq_file.h> 36#include <linux/seq_file.h>
37#include <linux/platform_device.h>
37#include <linux/console.h> 38#include <linux/console.h>
38#include <linux/mca.h> 39#include <linux/mca.h>
39#include <linux/root_dev.h> 40#include <linux/root_dev.h>
@@ -1634,6 +1635,23 @@ void __init setup_arch(char **cmdline_p)
1634#endif 1635#endif
1635} 1636}
1636 1637
1638static __init int add_pcspkr(void)
1639{
1640 struct platform_device *pd;
1641 int ret;
1642
1643 pd = platform_device_alloc("pcspkr", -1);
1644 if (!pd)
1645 return -ENOMEM;
1646
1647 ret = platform_device_add(pd);
1648 if (ret)
1649 platform_device_put(pd);
1650
1651 return ret;
1652}
1653device_initcall(add_pcspkr);
1654
1637#include "setup_arch_post.h" 1655#include "setup_arch_post.h"
1638/* 1656/*
1639 * Local Variables: 1657 * Local Variables:
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 3a0f89d2c8dc..6d4333776d28 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -233,6 +233,7 @@ config MACH_JAZZ
233 select ARC32 233 select ARC32
234 select ARCH_MAY_HAVE_PC_FDC 234 select ARCH_MAY_HAVE_PC_FDC
235 select GENERIC_ISA_DMA 235 select GENERIC_ISA_DMA
236 select I8253
236 select I8259 237 select I8259
237 select ISA 238 select ISA
238 select SYS_HAS_CPU_R4X00 239 select SYS_HAS_CPU_R4X00
@@ -530,6 +531,7 @@ config QEMU
530 select DMA_COHERENT 531 select DMA_COHERENT
531 select GENERIC_ISA_DMA 532 select GENERIC_ISA_DMA
532 select HAVE_STD_PC_SERIAL_PORT 533 select HAVE_STD_PC_SERIAL_PORT
534 select I8253
533 select I8259 535 select I8259
534 select ISA 536 select ISA
535 select SWAP_IO_SPACE 537 select SWAP_IO_SPACE
@@ -714,6 +716,7 @@ config SNI_RM200_PCI
714 select HAVE_STD_PC_SERIAL_PORT 716 select HAVE_STD_PC_SERIAL_PORT
715 select HW_HAS_EISA 717 select HW_HAS_EISA
716 select HW_HAS_PCI 718 select HW_HAS_PCI
719 select I8253
717 select I8259 720 select I8259
718 select ISA 721 select ISA
719 select SYS_HAS_CPU_R4X00 722 select SYS_HAS_CPU_R4X00
@@ -1711,6 +1714,9 @@ config MMU
1711 bool 1714 bool
1712 default y 1715 default y
1713 1716
1717config I8253
1718 bool
1719
1714source "drivers/pcmcia/Kconfig" 1720source "drivers/pcmcia/Kconfig"
1715 1721
1716source "drivers/pci/hotplug/Kconfig" 1722source "drivers/pci/hotplug/Kconfig"
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index f36c4f20ee8a..309d54cceda3 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -59,6 +59,8 @@ obj-$(CONFIG_PROC_FS) += proc.o
59 59
60obj-$(CONFIG_64BIT) += cpu-bugs64.o 60obj-$(CONFIG_64BIT) += cpu-bugs64.o
61 61
62obj-$(CONFIG_I8253) += i8253.o
63
62CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) 64CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
63 65
64EXTRA_AFLAGS := $(CFLAGS) 66EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
new file mode 100644
index 000000000000..475df6904219
--- /dev/null
+++ b/arch/mips/kernel/i8253.c
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2006 IBM Corporation
3 *
4 * Implements device information for i8253 timer chip
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation
9 */
10
11#include <linux/platform_device.h>
12
13static __init int add_pcspkr(void)
14{
15 struct platform_device *pd;
16 int ret;
17
18 pd = platform_device_alloc("pcspkr", -1);
19 if (!pd)
20 return -ENOMEM;
21
22 ret = platform_device_add(pd);
23 if (ret)
24 platform_device_put(pd);
25
26 return ret;
27}
28device_initcall(add_pcspkr);
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index be12041c0fc5..fc89d009d18d 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -18,6 +18,7 @@
18#include <linux/reboot.h> 18#include <linux/reboot.h>
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/initrd.h> 20#include <linux/initrd.h>
21#include <linux/platform_device.h>
21#include <linux/ide.h> 22#include <linux/ide.h>
22#include <linux/seq_file.h> 23#include <linux/seq_file.h>
23#include <linux/ioport.h> 24#include <linux/ioport.h>
@@ -469,3 +470,26 @@ static int __init early_xmon(char *p)
469} 470}
470early_param("xmon", early_xmon); 471early_param("xmon", early_xmon);
471#endif 472#endif
473
474static __init int add_pcspkr(void)
475{
476 struct device_node *np;
477 struct platform_device *pd;
478 int ret;
479
480 np = of_find_compatible_node(NULL, NULL, "pnpPNP,100");
481 of_node_put(np);
482 if (!np)
483 return -ENODEV;
484
485 pd = platform_device_alloc("pcspkr", -1);
486 if (!pd)
487 return -ENOMEM;
488
489 ret = platform_device_add(pd);
490 if (ret)
491 platform_device_put(pd);
492
493 return ret;
494}
495device_initcall(add_pcspkr);
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index 1ef477f4469c..afd322185bbf 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -24,7 +24,6 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
24MODULE_DESCRIPTION("PC Speaker beeper driver"); 24MODULE_DESCRIPTION("PC Speaker beeper driver");
25MODULE_LICENSE("GPL"); 25MODULE_LICENSE("GPL");
26 26
27static struct platform_device *pcspkr_platform_device;
28static DEFINE_SPINLOCK(i8253_beep_lock); 27static DEFINE_SPINLOCK(i8253_beep_lock);
29 28
30static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 29static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
@@ -135,35 +134,11 @@ static struct platform_driver pcspkr_platform_driver = {
135 134
136static int __init pcspkr_init(void) 135static int __init pcspkr_init(void)
137{ 136{
138 int err; 137 return platform_driver_register(&pcspkr_platform_driver);
139
140 err = platform_driver_register(&pcspkr_platform_driver);
141 if (err)
142 return err;
143
144 pcspkr_platform_device = platform_device_alloc("pcspkr", -1);
145 if (!pcspkr_platform_device) {
146 err = -ENOMEM;
147 goto err_unregister_driver;
148 }
149
150 err = platform_device_add(pcspkr_platform_device);
151 if (err)
152 goto err_free_device;
153
154 return 0;
155
156 err_free_device:
157 platform_device_put(pcspkr_platform_device);
158 err_unregister_driver:
159 platform_driver_unregister(&pcspkr_platform_driver);
160
161 return err;
162} 138}
163 139
164static void __exit pcspkr_exit(void) 140static void __exit pcspkr_exit(void)
165{ 141{
166 platform_device_unregister(pcspkr_platform_device);
167 platform_driver_unregister(&pcspkr_platform_driver); 142 platform_driver_unregister(&pcspkr_platform_driver);
168} 143}
169 144