Commit e0c1278a authored by Neil Armstrong's avatar Neil Armstrong Committed by Luiz Augusto von Dentz

Bluetooth: qca: add support for WCN7850

Add support for the WCN7850 Bluetooth chipset.

Tested on the SM8550 QRD platform.
Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent 691d54d0
...@@ -631,6 +631,10 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, ...@@ -631,6 +631,10 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
snprintf(config.fwname, sizeof(config.fwname), snprintf(config.fwname, sizeof(config.fwname),
"qca/hpbtfw%02x.tlv", rom_ver); "qca/hpbtfw%02x.tlv", rom_ver);
break; break;
case QCA_WCN7850:
snprintf(config.fwname, sizeof(config.fwname),
"qca/hmtbtfw%02x.tlv", rom_ver);
break;
default: default:
snprintf(config.fwname, sizeof(config.fwname), snprintf(config.fwname, sizeof(config.fwname),
"qca/rampatch_%08x.bin", soc_ver); "qca/rampatch_%08x.bin", soc_ver);
...@@ -679,6 +683,10 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, ...@@ -679,6 +683,10 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
snprintf(config.fwname, sizeof(config.fwname), snprintf(config.fwname, sizeof(config.fwname),
"qca/hpnv%02x.bin", rom_ver); "qca/hpnv%02x.bin", rom_ver);
break; break;
case QCA_WCN7850:
snprintf(config.fwname, sizeof(config.fwname),
"qca/hmtnv%02x.bin", rom_ver);
break;
default: default:
snprintf(config.fwname, sizeof(config.fwname), snprintf(config.fwname, sizeof(config.fwname),
...@@ -697,6 +705,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, ...@@ -697,6 +705,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
case QCA_QCA6390: case QCA_QCA6390:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
err = qca_disable_soc_logging(hdev); err = qca_disable_soc_logging(hdev);
if (err < 0) if (err < 0)
return err; return err;
...@@ -731,6 +740,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, ...@@ -731,6 +740,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
case QCA_WCN3991: case QCA_WCN3991:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
/* get fw build info */ /* get fw build info */
err = qca_read_fw_build_info(hdev); err = qca_read_fw_build_info(hdev);
if (err < 0) if (err < 0)
......
...@@ -149,6 +149,7 @@ enum qca_btsoc_type { ...@@ -149,6 +149,7 @@ enum qca_btsoc_type {
QCA_QCA6390, QCA_QCA6390,
QCA_WCN6750, QCA_WCN6750,
QCA_WCN6855, QCA_WCN6855,
QCA_WCN7850,
}; };
#if IS_ENABLED(CONFIG_BT_QCA) #if IS_ENABLED(CONFIG_BT_QCA)
......
...@@ -1357,6 +1357,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate) ...@@ -1357,6 +1357,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
case QCA_WCN3998: case QCA_WCN3998:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
usleep_range(1000, 10000); usleep_range(1000, 10000);
break; break;
...@@ -1442,6 +1443,7 @@ static int qca_check_speeds(struct hci_uart *hu) ...@@ -1442,6 +1443,7 @@ static int qca_check_speeds(struct hci_uart *hu)
case QCA_WCN3998: case QCA_WCN3998:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
if (!qca_get_speed(hu, QCA_INIT_SPEED) && if (!qca_get_speed(hu, QCA_INIT_SPEED) &&
!qca_get_speed(hu, QCA_OPER_SPEED)) !qca_get_speed(hu, QCA_OPER_SPEED))
return -EINVAL; return -EINVAL;
...@@ -1483,6 +1485,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type) ...@@ -1483,6 +1485,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
case QCA_WCN3998: case QCA_WCN3998:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
hci_uart_set_flow_control(hu, true); hci_uart_set_flow_control(hu, true);
break; break;
...@@ -1516,6 +1519,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type) ...@@ -1516,6 +1519,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
case QCA_WCN3998: case QCA_WCN3998:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
hci_uart_set_flow_control(hu, false); hci_uart_set_flow_control(hu, false);
break; break;
...@@ -1783,6 +1787,7 @@ static int qca_power_on(struct hci_dev *hdev) ...@@ -1783,6 +1787,7 @@ static int qca_power_on(struct hci_dev *hdev)
case QCA_WCN3998: case QCA_WCN3998:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
ret = qca_regulator_init(hu); ret = qca_regulator_init(hu);
break; break;
...@@ -1851,6 +1856,10 @@ static int qca_setup(struct hci_uart *hu) ...@@ -1851,6 +1856,10 @@ static int qca_setup(struct hci_uart *hu)
soc_name = "wcn6855"; soc_name = "wcn6855";
break; break;
case QCA_WCN7850:
soc_name = "wcn7850";
break;
default: default:
soc_name = "ROME/QCA6390"; soc_name = "ROME/QCA6390";
} }
...@@ -1872,6 +1881,7 @@ static int qca_setup(struct hci_uart *hu) ...@@ -1872,6 +1881,7 @@ static int qca_setup(struct hci_uart *hu)
case QCA_WCN3998: case QCA_WCN3998:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
hci_set_aosp_capable(hdev); hci_set_aosp_capable(hdev);
...@@ -1901,6 +1911,7 @@ static int qca_setup(struct hci_uart *hu) ...@@ -1901,6 +1911,7 @@ static int qca_setup(struct hci_uart *hu)
case QCA_WCN3998: case QCA_WCN3998:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
break; break;
default: default:
...@@ -2057,6 +2068,20 @@ static const struct qca_device_data qca_soc_data_wcn6855 __maybe_unused = { ...@@ -2057,6 +2068,20 @@ static const struct qca_device_data qca_soc_data_wcn6855 __maybe_unused = {
.capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES, .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES,
}; };
static const struct qca_device_data qca_soc_data_wcn7850 __maybe_unused = {
.soc_type = QCA_WCN7850,
.vregs = (struct qca_vreg []) {
{ "vddio", 5000 },
{ "vddaon", 26000 },
{ "vdddig", 126000 },
{ "vddrfa0p8", 102000 },
{ "vddrfa1p2", 257000 },
{ "vddrfa1p9", 302000 },
},
.num_vregs = 6,
.capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES,
};
static void qca_power_shutdown(struct hci_uart *hu) static void qca_power_shutdown(struct hci_uart *hu)
{ {
struct qca_serdev *qcadev; struct qca_serdev *qcadev;
...@@ -2240,6 +2265,7 @@ static int qca_serdev_probe(struct serdev_device *serdev) ...@@ -2240,6 +2265,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
case QCA_WCN3998: case QCA_WCN3998:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
qcadev->bt_power = devm_kzalloc(&serdev->dev, qcadev->bt_power = devm_kzalloc(&serdev->dev,
sizeof(struct qca_power), sizeof(struct qca_power),
GFP_KERNEL); GFP_KERNEL);
...@@ -2269,7 +2295,8 @@ static int qca_serdev_probe(struct serdev_device *serdev) ...@@ -2269,7 +2295,8 @@ static int qca_serdev_probe(struct serdev_device *serdev)
GPIOD_IN); GPIOD_IN);
if (IS_ERR_OR_NULL(qcadev->sw_ctrl) && if (IS_ERR_OR_NULL(qcadev->sw_ctrl) &&
(data->soc_type == QCA_WCN6750 || (data->soc_type == QCA_WCN6750 ||
data->soc_type == QCA_WCN6855)) data->soc_type == QCA_WCN6855 ||
data->soc_type == QCA_WCN7850))
dev_warn(&serdev->dev, "failed to acquire SW_CTRL gpio\n"); dev_warn(&serdev->dev, "failed to acquire SW_CTRL gpio\n");
qcadev->susclk = devm_clk_get_optional(&serdev->dev, NULL); qcadev->susclk = devm_clk_get_optional(&serdev->dev, NULL);
...@@ -2348,6 +2375,7 @@ static void qca_serdev_remove(struct serdev_device *serdev) ...@@ -2348,6 +2375,7 @@ static void qca_serdev_remove(struct serdev_device *serdev)
case QCA_WCN3998: case QCA_WCN3998:
case QCA_WCN6750: case QCA_WCN6750:
case QCA_WCN6855: case QCA_WCN6855:
case QCA_WCN7850:
if (power->vregs_on) { if (power->vregs_on) {
qca_power_shutdown(&qcadev->serdev_hu); qca_power_shutdown(&qcadev->serdev_hu);
break; break;
...@@ -2540,6 +2568,7 @@ static const struct of_device_id qca_bluetooth_of_match[] = { ...@@ -2540,6 +2568,7 @@ static const struct of_device_id qca_bluetooth_of_match[] = {
{ .compatible = "qcom,wcn3998-bt", .data = &qca_soc_data_wcn3998}, { .compatible = "qcom,wcn3998-bt", .data = &qca_soc_data_wcn3998},
{ .compatible = "qcom,wcn6750-bt", .data = &qca_soc_data_wcn6750}, { .compatible = "qcom,wcn6750-bt", .data = &qca_soc_data_wcn6750},
{ .compatible = "qcom,wcn6855-bt", .data = &qca_soc_data_wcn6855}, { .compatible = "qcom,wcn6855-bt", .data = &qca_soc_data_wcn6855},
{ .compatible = "qcom,wcn7850-bt", .data = &qca_soc_data_wcn7850},
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(of, qca_bluetooth_of_match); MODULE_DEVICE_TABLE(of, qca_bluetooth_of_match);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment