btbcm.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. *
  3. * Bluetooth support for Broadcom devices
  4. *
  5. * Copyright (C) 2015 Intel Corporation
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. #define BCM_UART_CLOCK_48MHZ 0x01
  24. #define BCM_UART_CLOCK_24MHZ 0x02
  25. struct bcm_update_uart_baud_rate {
  26. __le16 zero;
  27. __le32 baud_rate;
  28. } __packed;
  29. struct bcm_write_uart_clock_setting {
  30. __u8 type;
  31. } __packed;
  32. struct bcm_set_sleep_mode {
  33. __u8 sleep_mode;
  34. __u8 idle_host;
  35. __u8 idle_dev;
  36. __u8 bt_wake_active;
  37. __u8 host_wake_active;
  38. __u8 allow_host_sleep;
  39. __u8 combine_modes;
  40. __u8 tristate_control;
  41. __u8 usb_auto_sleep;
  42. __u8 usb_resume_timeout;
  43. __u8 pulsed_host_wake;
  44. __u8 break_to_host;
  45. } __packed;
  46. struct bcm_set_pcm_int_params {
  47. __u8 routing;
  48. __u8 rate;
  49. __u8 frame_sync;
  50. __u8 sync_mode;
  51. __u8 clock_mode;
  52. } __packed;
  53. struct bcm_set_pcm_format_params {
  54. __u8 lsb_first;
  55. __u8 fill_value;
  56. __u8 fill_method;
  57. __u8 fill_num;
  58. __u8 right_justify;
  59. } __packed;
  60. #if IS_ENABLED(CONFIG_BT_BCM)
  61. int btbcm_check_bdaddr(struct hci_dev *hdev);
  62. int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
  63. int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw);
  64. int btbcm_setup_patchram(struct hci_dev *hdev);
  65. int btbcm_setup_apple(struct hci_dev *hdev);
  66. int btbcm_initialize(struct hci_dev *hdev, char *fw_name, size_t len);
  67. int btbcm_finalize(struct hci_dev *hdev);
  68. #else
  69. static inline int btbcm_check_bdaddr(struct hci_dev *hdev)
  70. {
  71. return -EOPNOTSUPP;
  72. }
  73. static inline int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
  74. {
  75. return -EOPNOTSUPP;
  76. }
  77. static inline int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
  78. {
  79. return -EOPNOTSUPP;
  80. }
  81. static inline int btbcm_setup_patchram(struct hci_dev *hdev)
  82. {
  83. return 0;
  84. }
  85. static inline int btbcm_setup_apple(struct hci_dev *hdev)
  86. {
  87. return 0;
  88. }
  89. static inline int btbcm_initialize(struct hci_dev *hdev, char *fw_name,
  90. size_t len)
  91. {
  92. return 0;
  93. }
  94. static inline int btbcm_finalize(struct hci_dev *hdev)
  95. {
  96. return 0;
  97. }
  98. #endif