017-modular-init-bluetooth.patch 3.0 KB

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