0001
0002
0003
0004
0005
0006
0007
0008
0009 #define BCM_UART_CLOCK_48MHZ 0x01
0010 #define BCM_UART_CLOCK_24MHZ 0x02
0011
0012 struct bcm_update_uart_baud_rate {
0013 __le16 zero;
0014 __le32 baud_rate;
0015 } __packed;
0016
0017 struct bcm_write_uart_clock_setting {
0018 __u8 type;
0019 } __packed;
0020
0021 struct bcm_set_sleep_mode {
0022 __u8 sleep_mode;
0023 __u8 idle_host;
0024 __u8 idle_dev;
0025 __u8 bt_wake_active;
0026 __u8 host_wake_active;
0027 __u8 allow_host_sleep;
0028 __u8 combine_modes;
0029 __u8 tristate_control;
0030 __u8 usb_auto_sleep;
0031 __u8 usb_resume_timeout;
0032 __u8 break_to_host;
0033 __u8 pulsed_host_wake;
0034 } __packed;
0035
0036 struct bcm_set_pcm_int_params {
0037 __u8 routing;
0038 __u8 rate;
0039 __u8 frame_sync;
0040 __u8 sync_mode;
0041 __u8 clock_mode;
0042 } __packed;
0043
0044 struct bcm_set_pcm_format_params {
0045 __u8 lsb_first;
0046 __u8 fill_value;
0047 __u8 fill_method;
0048 __u8 fill_num;
0049 __u8 right_justify;
0050 } __packed;
0051
0052 #if IS_ENABLED(CONFIG_BT_BCM)
0053
0054 int btbcm_check_bdaddr(struct hci_dev *hdev);
0055 int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
0056 int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw);
0057 int btbcm_read_pcm_int_params(struct hci_dev *hdev,
0058 struct bcm_set_pcm_int_params *params);
0059 int btbcm_write_pcm_int_params(struct hci_dev *hdev,
0060 const struct bcm_set_pcm_int_params *params);
0061
0062 int btbcm_setup_patchram(struct hci_dev *hdev);
0063 int btbcm_setup_apple(struct hci_dev *hdev);
0064
0065 int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode);
0066 int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode);
0067
0068 #else
0069
0070 static inline int btbcm_check_bdaddr(struct hci_dev *hdev)
0071 {
0072 return -EOPNOTSUPP;
0073 }
0074
0075 static inline int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
0076 {
0077 return -EOPNOTSUPP;
0078 }
0079
0080 static inline int btbcm_read_pcm_int_params(struct hci_dev *hdev,
0081 struct bcm_set_pcm_int_params *params)
0082 {
0083 return -EOPNOTSUPP;
0084 }
0085
0086 static inline int btbcm_write_pcm_int_params(struct hci_dev *hdev,
0087 const struct bcm_set_pcm_int_params *params)
0088 {
0089 return -EOPNOTSUPP;
0090 }
0091
0092 static inline int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
0093 {
0094 return -EOPNOTSUPP;
0095 }
0096
0097 static inline int btbcm_setup_patchram(struct hci_dev *hdev)
0098 {
0099 return 0;
0100 }
0101
0102 static inline int btbcm_setup_apple(struct hci_dev *hdev)
0103 {
0104 return 0;
0105 }
0106
0107 static inline int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode)
0108 {
0109 return 0;
0110 }
0111
0112 static inline int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode)
0113 {
0114 return 0;
0115 }
0116
0117 #endif