Linux Audio

Check our new training course

Loading...
v6.2
  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
  9#define BCM_UART_CLOCK_48MHZ	0x01
 10#define BCM_UART_CLOCK_24MHZ	0x02
 11
 12struct bcm_update_uart_baud_rate {
 13	__le16 zero;
 14	__le32 baud_rate;
 15} __packed;
 16
 17struct bcm_write_uart_clock_setting {
 18	__u8 type;
 19} __packed;
 20
 21struct bcm_set_sleep_mode {
 22	__u8 sleep_mode;
 23	__u8 idle_host;
 24	__u8 idle_dev;
 25	__u8 bt_wake_active;
 26	__u8 host_wake_active;
 27	__u8 allow_host_sleep;
 28	__u8 combine_modes;
 29	__u8 tristate_control;
 30	__u8 usb_auto_sleep;
 31	__u8 usb_resume_timeout;
 32	__u8 break_to_host;
 33	__u8 pulsed_host_wake;
 
 34} __packed;
 35
 36struct bcm_set_pcm_int_params {
 37	__u8 routing;
 38	__u8 rate;
 39	__u8 frame_sync;
 40	__u8 sync_mode;
 41	__u8 clock_mode;
 42} __packed;
 43
 44struct bcm_set_pcm_format_params {
 45	__u8 lsb_first;
 46	__u8 fill_value;
 47	__u8 fill_method;
 48	__u8 fill_num;
 49	__u8 right_justify;
 50} __packed;
 51
 52#if IS_ENABLED(CONFIG_BT_BCM)
 53
 54int btbcm_check_bdaddr(struct hci_dev *hdev);
 55int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
 56int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw);
 57int btbcm_read_pcm_int_params(struct hci_dev *hdev,
 58			      struct bcm_set_pcm_int_params *params);
 59int btbcm_write_pcm_int_params(struct hci_dev *hdev,
 60			       const struct bcm_set_pcm_int_params *params);
 61
 62int btbcm_setup_patchram(struct hci_dev *hdev);
 63int btbcm_setup_apple(struct hci_dev *hdev);
 64
 65int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode);
 66int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode);
 67
 68#else
 69
 70static inline int btbcm_check_bdaddr(struct hci_dev *hdev)
 71{
 72	return -EOPNOTSUPP;
 73}
 74
 75static inline int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
 76{
 77	return -EOPNOTSUPP;
 78}
 79
 80static inline int btbcm_read_pcm_int_params(struct hci_dev *hdev,
 81			      struct bcm_set_pcm_int_params *params)
 82{
 83	return -EOPNOTSUPP;
 84}
 85
 86static inline int btbcm_write_pcm_int_params(struct hci_dev *hdev,
 87			       const struct bcm_set_pcm_int_params *params)
 88{
 89	return -EOPNOTSUPP;
 90}
 91
 92static inline int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
 93{
 94	return -EOPNOTSUPP;
 95}
 96
 97static inline int btbcm_setup_patchram(struct hci_dev *hdev)
 98{
 99	return 0;
100}
101
102static inline int btbcm_setup_apple(struct hci_dev *hdev)
103{
104	return 0;
105}
106
107static inline int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode)
 
108{
109	return 0;
110}
111
112static inline int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode)
113{
114	return 0;
115}
116
117#endif
v4.6
 
  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
 24#define BCM_UART_CLOCK_48MHZ	0x01
 25#define BCM_UART_CLOCK_24MHZ	0x02
 26
 27struct bcm_update_uart_baud_rate {
 28	__le16 zero;
 29	__le32 baud_rate;
 30} __packed;
 31
 32struct bcm_write_uart_clock_setting {
 33	__u8 type;
 34} __packed;
 35
 36struct bcm_set_sleep_mode {
 37	__u8 sleep_mode;
 38	__u8 idle_host;
 39	__u8 idle_dev;
 40	__u8 bt_wake_active;
 41	__u8 host_wake_active;
 42	__u8 allow_host_sleep;
 43	__u8 combine_modes;
 44	__u8 tristate_control;
 45	__u8 usb_auto_sleep;
 46	__u8 usb_resume_timeout;
 
 47	__u8 pulsed_host_wake;
 48	__u8 break_to_host;
 49} __packed;
 50
 51struct bcm_set_pcm_int_params {
 52	__u8 routing;
 53	__u8 rate;
 54	__u8 frame_sync;
 55	__u8 sync_mode;
 56	__u8 clock_mode;
 57} __packed;
 58
 59struct bcm_set_pcm_format_params {
 60	__u8 lsb_first;
 61	__u8 fill_value;
 62	__u8 fill_method;
 63	__u8 fill_num;
 64	__u8 right_justify;
 65} __packed;
 66
 67#if IS_ENABLED(CONFIG_BT_BCM)
 68
 69int btbcm_check_bdaddr(struct hci_dev *hdev);
 70int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
 71int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw);
 
 
 
 
 72
 73int btbcm_setup_patchram(struct hci_dev *hdev);
 74int btbcm_setup_apple(struct hci_dev *hdev);
 75
 76int btbcm_initialize(struct hci_dev *hdev, char *fw_name, size_t len);
 77int btbcm_finalize(struct hci_dev *hdev);
 78
 79#else
 80
 81static inline int btbcm_check_bdaddr(struct hci_dev *hdev)
 82{
 83	return -EOPNOTSUPP;
 84}
 85
 86static inline int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
 87{
 88	return -EOPNOTSUPP;
 89}
 90
 
 
 
 
 
 
 
 
 
 
 
 
 91static inline int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
 92{
 93	return -EOPNOTSUPP;
 94}
 95
 96static inline int btbcm_setup_patchram(struct hci_dev *hdev)
 97{
 98	return 0;
 99}
100
101static inline int btbcm_setup_apple(struct hci_dev *hdev)
102{
103	return 0;
104}
105
106static inline int btbcm_initialize(struct hci_dev *hdev, char *fw_name,
107				   size_t len)
108{
109	return 0;
110}
111
112static inline int btbcm_finalize(struct hci_dev *hdev)
113{
114	return 0;
115}
116
117#endif