btbcm.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. *
  4. * Bluetooth support for Broadcom devices
  5. *
  6. * Copyright (C) 2015 Intel Corporation
  7. */
  8. #define BCM_UART_CLOCK_48MHZ 0x01
  9. #define BCM_UART_CLOCK_24MHZ 0x02
  10. struct bcm_update_uart_baud_rate {
  11. __le16 zero;
  12. __le32 baud_rate;
  13. } __packed;
  14. struct bcm_write_uart_clock_setting {
  15. __u8 type;
  16. } __packed;
  17. struct bcm_set_sleep_mode {
  18. __u8 sleep_mode;
  19. __u8 idle_host;
  20. __u8 idle_dev;
  21. __u8 bt_wake_active;
  22. __u8 host_wake_active;
  23. __u8 allow_host_sleep;
  24. __u8 combine_modes;
  25. __u8 tristate_control;
  26. __u8 usb_auto_sleep;
  27. __u8 usb_resume_timeout;
  28. __u8 break_to_host;
  29. __u8 pulsed_host_wake;
  30. } __packed;
  31. struct bcm_set_pcm_int_params {
  32. __u8 routing;
  33. __u8 rate;
  34. __u8 frame_sync;
  35. __u8 sync_mode;
  36. __u8 clock_mode;
  37. } __packed;
  38. struct bcm_set_pcm_format_params {
  39. __u8 lsb_first;
  40. __u8 fill_value;
  41. __u8 fill_method;
  42. __u8 fill_num;
  43. __u8 right_justify;
  44. } __packed;
  45. #if IS_ENABLED(CONFIG_BT_BCM)
  46. int btbcm_check_bdaddr(struct hci_dev *hdev);
  47. int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
  48. int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw);
  49. int btbcm_read_pcm_int_params(struct hci_dev *hdev,
  50. struct bcm_set_pcm_int_params *params);
  51. int btbcm_write_pcm_int_params(struct hci_dev *hdev,
  52. const struct bcm_set_pcm_int_params *params);
  53. int btbcm_setup_patchram(struct hci_dev *hdev);
  54. int btbcm_setup_apple(struct hci_dev *hdev);
  55. int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done);
  56. int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done);
  57. #else
  58. static inline int btbcm_check_bdaddr(struct hci_dev *hdev)
  59. {
  60. return -EOPNOTSUPP;
  61. }
  62. static inline int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
  63. {
  64. return -EOPNOTSUPP;
  65. }
  66. static inline int btbcm_read_pcm_int_params(struct hci_dev *hdev,
  67. struct bcm_set_pcm_int_params *params)
  68. {
  69. return -EOPNOTSUPP;
  70. }
  71. static inline int btbcm_write_pcm_int_params(struct hci_dev *hdev,
  72. const struct bcm_set_pcm_int_params *params)
  73. {
  74. return -EOPNOTSUPP;
  75. }
  76. static inline int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
  77. {
  78. return -EOPNOTSUPP;
  79. }
  80. static inline int btbcm_setup_patchram(struct hci_dev *hdev)
  81. {
  82. return 0;
  83. }
  84. static inline int btbcm_setup_apple(struct hci_dev *hdev)
  85. {
  86. return 0;
  87. }
  88. static inline int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done)
  89. {
  90. return 0;
  91. }
  92. static inline int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done)
  93. {
  94. return 0;
  95. }
  96. #endif