Lines Matching +full:e +full:- +full:ddc
1 // SPDX-License-Identifier: GPL-2.0-or-later
37 if (skb->len != sizeof(*bda)) { in btintel_check_bdaddr()
40 return -EIO; in btintel_check_bdaddr()
43 bda = (struct hci_rp_read_bd_addr *)skb->data; in btintel_check_bdaddr()
46 * address 00:03:19:9E:8B:00 can be found. These controllers are in btintel_check_bdaddr()
50 if (!bacmp(&bda->bdaddr, BDADDR_INTEL)) { in btintel_check_bdaddr()
52 &bda->bdaddr); in btintel_check_bdaddr()
53 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); in btintel_check_bdaddr()
141 if (err == -ENODATA) in btintel_set_diag()
195 if (skb->len != 13) { in btintel_hw_error()
201 bt_dev_err(hdev, "Exception info %s", (char *)(skb->data + 1)); in btintel_hw_error()
211 switch (ver->fw_variant) { in btintel_version_info()
223 variant, ver->fw_revision >> 4, ver->fw_revision & 0x0f, in btintel_version_info()
224 ver->fw_build_num, ver->fw_build_ww, in btintel_version_info()
225 2000 + ver->fw_build_yy); in btintel_version_info()
246 plen -= fragment_len; in btintel_secure_send()
261 err = request_firmware_direct(&fw, ddc_name, &hdev->dev); in btintel_load_ddc_config()
263 bt_dev_err(hdev, "Failed to load Intel DDC file %s (%d)", in btintel_load_ddc_config()
268 bt_dev_info(hdev, "Found Intel DDC parameters: %s", ddc_name); in btintel_load_ddc_config()
270 fw_ptr = fw->data; in btintel_load_ddc_config()
272 /* DDC file contains one or more DDC structure which has in btintel_load_ddc_config()
273 * Length (1 byte), DDC ID (2 bytes), and DDC value (Length - 2). in btintel_load_ddc_config()
275 while (fw->size > fw_ptr - fw->data) { in btintel_load_ddc_config()
293 bt_dev_info(hdev, "Applying Intel DDC parameters completed"); in btintel_load_ddc_config()
349 if (skb->len != sizeof(*ver)) { in btintel_read_version()
352 return -EILSEQ; in btintel_read_version()
355 memcpy(ver, skb->data, sizeof(*ver)); in btintel_read_version()
363 /* ------- REGMAP IBT SUPPORT ------- */
398 return -EINVAL; in regmap_ibt_read()
411 return -EINVAL; in regmap_ibt_read()
414 /* regmap provides a little-endian formatted addr */ in regmap_ibt_read()
418 bt_dev_dbg(ctx->hdev, "Register (0x%x) read", le32_to_cpu(cp.addr)); in regmap_ibt_read()
420 skb = hci_cmd_sync(ctx->hdev, ctx->op_read, sizeof(cp), &cp, in regmap_ibt_read()
424 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error (%d)", in regmap_ibt_read()
429 if (skb->len != sizeof(*rp) + val_size) { in regmap_ibt_read()
430 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error, bad len", in regmap_ibt_read()
432 err = -EINVAL; in regmap_ibt_read()
436 rp = (struct ibt_rp_reg_access *)skb->data; in regmap_ibt_read()
438 if (rp->addr != cp.addr) { in regmap_ibt_read()
439 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error, bad addr", in regmap_ibt_read()
440 le32_to_cpu(rp->addr)); in regmap_ibt_read()
441 err = -EINVAL; in regmap_ibt_read()
445 memcpy(val, rp->data, val_size); in regmap_ibt_read()
464 return -EINVAL; in regmap_ibt_gather_write()
477 return -EINVAL; in regmap_ibt_gather_write()
482 return -ENOMEM; in regmap_ibt_gather_write()
484 /* regmap provides a little-endian formatted addr/value */ in regmap_ibt_gather_write()
485 cp->addr = *(__le32 *)addr; in regmap_ibt_gather_write()
486 cp->mode = mode; in regmap_ibt_gather_write()
487 cp->len = val_size; in regmap_ibt_gather_write()
488 memcpy(&cp->data, val, val_size); in regmap_ibt_gather_write()
490 bt_dev_dbg(ctx->hdev, "Register (0x%x) write", le32_to_cpu(cp->addr)); in regmap_ibt_gather_write()
492 skb = hci_cmd_sync(ctx->hdev, ctx->op_write, plen, cp, HCI_CMD_TIMEOUT); in regmap_ibt_gather_write()
495 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) write error (%d)", in regmap_ibt_gather_write()
496 le32_to_cpu(cp->addr), err); in regmap_ibt_gather_write()
512 return -EINVAL; in regmap_ibt_write()
514 return regmap_ibt_gather_write(context, data, 4, data + 4, count - 4); in regmap_ibt_write()
543 bt_dev_info(hdev, "regmap: Init R%x-W%x region", opcode_read, in btintel_regmap_init()
548 return ERR_PTR(-ENOMEM); in btintel_regmap_init()
550 ctx->op_read = opcode_read; in btintel_regmap_init()
551 ctx->op_write = opcode_write; in btintel_regmap_init()
552 ctx->hdev = hdev; in btintel_regmap_init()
554 return regmap_init(&hdev->dev, ®map_ibt, ctx, ®map_ibt_cfg); in btintel_regmap_init()
590 if (skb->len != sizeof(*params)) { in btintel_read_boot_params()
593 return -EILSEQ; in btintel_read_boot_params()
596 memcpy(params, skb->data, sizeof(*params)); in btintel_read_boot_params()
600 if (params->status) { in btintel_read_boot_params()
602 params->status); in btintel_read_boot_params()
603 return -bt_to_errno(params->status); in btintel_read_boot_params()
607 le16_to_cpu(params->dev_revid)); in btintel_read_boot_params()
610 params->secure_boot ? "enabled" : "disabled"); in btintel_read_boot_params()
613 params->otp_lock ? "enabled" : "disabled"); in btintel_read_boot_params()
616 params->api_lock ? "enabled" : "disabled"); in btintel_read_boot_params()
619 params->debug_lock ? "enabled" : "disabled"); in btintel_read_boot_params()
622 params->min_fw_build_nn, params->min_fw_build_cw, in btintel_read_boot_params()
623 2000 + params->min_fw_build_yy); in btintel_read_boot_params()
639 err = btintel_secure_send(hdev, 0x00, 128, fw->data); in btintel_download_firmware()
648 err = btintel_secure_send(hdev, 0x03, 256, fw->data + 128); in btintel_download_firmware()
657 err = btintel_secure_send(hdev, 0x02, 256, fw->data + 388); in btintel_download_firmware()
663 fw_ptr = fw->data + 644; in btintel_download_firmware()
666 while (fw_ptr - fw->data < fw->size) { in btintel_download_firmware()
674 if (le16_to_cpu(cmd->opcode) == 0xfc0e) { in btintel_download_firmware()
675 /* The boot parameter is the first 32-bit value in btintel_download_firmware()
683 frag_len += sizeof(*cmd) + cmd->plen; in btintel_download_firmware()
716 MODULE_FIRMWARE("intel/ibt-11-5.sfi");
717 MODULE_FIRMWARE("intel/ibt-11-5.ddc");
718 MODULE_FIRMWARE("intel/ibt-12-16.sfi");
719 MODULE_FIRMWARE("intel/ibt-12-16.ddc");