create release branch for 8.09
[openwrt/svn-archive/archive.git] / target / linux / pxa / patches-2.6.21 / 017-modular-init-bluetooth.patch
1 Index: linux-2.6.21.7/net/bluetooth/Kconfig
2 ===================================================================
3 --- linux-2.6.21.7.orig/net/bluetooth/Kconfig
4 +++ linux-2.6.21.7/net/bluetooth/Kconfig
5 @@ -30,6 +30,12 @@ menuconfig BT
6 Bluetooth kernel modules are provided in the BlueZ packages.
7 For more information, see <http://www.bluez.org/>.
8
9 +config BT_GUMSTIX
10 + tristate
11 + default m if BT=m
12 + default y if BT=y
13 + depends on BT && ARCH_GUMSTIX
14 +
15 config BT_L2CAP
16 tristate "L2CAP protocol support"
17 depends on BT
18 Index: linux-2.6.21.7/net/bluetooth/Makefile
19 ===================================================================
20 --- linux-2.6.21.7.orig/net/bluetooth/Makefile
21 +++ linux-2.6.21.7/net/bluetooth/Makefile
22 @@ -9,5 +9,6 @@ obj-$(CONFIG_BT_RFCOMM) += rfcomm/
23 obj-$(CONFIG_BT_BNEP) += bnep/
24 obj-$(CONFIG_BT_CMTP) += cmtp/
25 obj-$(CONFIG_BT_HIDP) += hidp/
26 +obj-$(CONFIG_BT_GUMSTIX)+= gumstix_bluetooth.o
27
28 bluetooth-objs := af_bluetooth.o hci_core.o hci_conn.o hci_event.o hci_sock.o hci_sysfs.o lib.o
29 Index: linux-2.6.21.7/net/bluetooth/af_bluetooth.c
30 ===================================================================
31 --- linux-2.6.21.7.orig/net/bluetooth/af_bluetooth.c
32 +++ linux-2.6.21.7/net/bluetooth/af_bluetooth.c
33 @@ -327,12 +327,20 @@ static struct net_proto_family bt_sock_f
34 .create = bt_sock_create,
35 };
36
37 +#ifdef CONFIG_ARCH_GUMSTIX
38 +extern void gumstix_bluetooth_load(void);
39 +#endif
40 +
41 static int __init bt_init(void)
42 {
43 int err;
44
45 BT_INFO("Core ver %s", VERSION);
46
47 +#ifdef CONFIG_ARCH_GUMSTIX
48 + gumstix_bluetooth_load();
49 +#endif
50 +
51 err = bt_sysfs_init();
52 if (err < 0)
53 return err;
54 Index: linux-2.6.21.7/net/bluetooth/gumstix_bluetooth.c
55 ===================================================================
56 --- /dev/null
57 +++ linux-2.6.21.7/net/bluetooth/gumstix_bluetooth.c
58 @@ -0,0 +1,50 @@
59 +/*
60 + * Gumstix bluetooth module intialization driver
61 + *
62 + * Author: Craig Hughes
63 + * Created: December 9, 2004
64 + * Copyright: (C) 2004 Craig Hughes
65 + *
66 + * This program is free software; you can redistribute it and/or modify
67 + * it under the terms of the GNU General Public License as published by
68 + * the Free Software Foundation; either version 2 of the License, or
69 + * (at your option) any later version.
70 + *
71 + */
72 +
73 +#include <linux/module.h>
74 +
75 +#include <asm/hardware.h>
76 +#include <asm/arch/pxa-regs.h>
77 +#include <asm/delay.h>
78 +
79 +#include <asm/arch/gumstix.h>
80 +
81 +static void gumstix_bluetooth_load(void)
82 +{
83 +}
84 +
85 +EXPORT_SYMBOL(gumstix_bluetooth_load);
86 +
87 +int __init gumstix_bluetooth_init(void)
88 +{
89 + /* Set up GPIOs to use the BTUART */
90 + pxa_gpio_mode(GPIO42_HWRXD_MD);
91 + pxa_gpio_mode(GPIO43_HWTXD_MD);
92 + pxa_gpio_mode(GPIO44_HWCTS_MD);
93 + pxa_gpio_mode(GPIO45_HWRTS_MD);
94 +
95 + return 0;
96 +}
97 +
98 +void __exit gumstix_bluetooth_exit(void)
99 +{
100 +}
101 +
102 +module_init(gumstix_bluetooth_init);
103 +module_exit(gumstix_bluetooth_exit);
104 +
105 +MODULE_LICENSE("GPL");
106 +MODULE_AUTHOR("Craig Hughes <craig@gumstix.com>");
107 +MODULE_DESCRIPTION("Gumstix board bluetooth module initialization driver");
108 +MODULE_VERSION("1:0.1");