Merge tag 'xfs-5.18-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux-block.git] / drivers / bluetooth / btbcm.h
CommitLineData
1a59d1b8 1/* SPDX-License-Identifier: GPL-2.0-or-later */
4fba30f0
MH
2/*
3 *
4 * Bluetooth support for Broadcom devices
5 *
6 * Copyright (C) 2015 Intel Corporation
4fba30f0
MH
7 */
8
61b2fc2b
FD
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
40db5f0e
IF
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;
40db5f0e 32 __u8 break_to_host;
ff875960 33 __u8 pulsed_host_wake;
40db5f0e
IF
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
4fba30f0
MH
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);
18aeb444 56int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw);
52837990
APS
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);
4fba30f0 61
1c8ba6d0
MH
62int btbcm_setup_patchram(struct hci_dev *hdev);
63int btbcm_setup_apple(struct hci_dev *hdev);
64
0287c5d8 65int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done);
0383f16a 66int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done);
75e167e6 67
4fba30f0
MH
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
5bd64c64 80static inline int btbcm_read_pcm_int_params(struct hci_dev *hdev,
52837990
APS
81 struct bcm_set_pcm_int_params *params)
82{
83 return -EOPNOTSUPP;
84}
85
5bd64c64 86static inline int btbcm_write_pcm_int_params(struct hci_dev *hdev,
52837990
APS
87 const struct bcm_set_pcm_int_params *params)
88{
89 return -EOPNOTSUPP;
90}
91
18aeb444 92static inline int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
50862ee5
MH
93{
94 return -EOPNOTSUPP;
95}
96
1c8ba6d0
MH
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
0287c5d8 107static inline int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done)
75e167e6
FD
108{
109 return 0;
110}
111
0383f16a 112static inline int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done)
75e167e6
FD
113{
114 return 0;
115}
116
4fba30f0 117#endif