Lines Matching refs:lldev

130 		struct ll_device *lldev = serdev_device_get_drvdata(hu->serdev);  in ll_open()  local
132 if (!IS_ERR(lldev->ext_clk)) in ll_open()
133 clk_prepare_enable(lldev->ext_clk); in ll_open()
165 struct ll_device *lldev = serdev_device_get_drvdata(hu->serdev); in ll_close() local
167 gpiod_set_value_cansleep(lldev->enable_gpio, 0); in ll_close()
169 clk_disable_unprepare(lldev->ext_clk); in ll_close()
486 static int send_command_from_firmware(struct ll_device *lldev, in send_command_from_firmware() argument
495 bt_dev_warn(lldev->hu.hdev, in send_command_from_firmware()
500 bt_dev_dbg(lldev->hu.hdev, "command type %d", cmd->prefix); in send_command_from_firmware()
502 skb = __hci_cmd_sync(lldev->hu.hdev, cmd->opcode, cmd->plen, in send_command_from_firmware()
505 bt_dev_err(lldev->hu.hdev, "send command failed"); in send_command_from_firmware()
517 static int download_firmware(struct ll_device *lldev) in download_firmware() argument
526 version = read_local_version(lldev->hu.hdev); in download_firmware()
540 err = request_firmware(&fw, bts_scr_name, &lldev->serdev->dev); in download_firmware()
542 bt_dev_err(lldev->hu.hdev, "request_firmware failed(errno %d) for %s", in download_firmware()
555 bt_dev_dbg(lldev->hu.hdev, " action size %d, type %d ", in download_firmware()
563 bt_dev_dbg(lldev->hu.hdev, "S"); in download_firmware()
565 err = send_command_from_firmware(lldev, cmd); in download_firmware()
571 bt_dev_dbg(lldev->hu.hdev, "W"); in download_firmware()
574 bt_dev_info(lldev->hu.hdev, "sleep command in scr"); in download_firmware()
611 struct ll_device *lldev; in ll_setup() local
618 lldev = serdev_device_get_drvdata(serdev); in ll_setup()
626 gpiod_set_value_cansleep(lldev->enable_gpio, 0); in ll_setup()
628 gpiod_set_value_cansleep(lldev->enable_gpio, 1); in ll_setup()
635 err = download_firmware(lldev); in ll_setup()
647 if (!bacmp(&lldev->bdaddr, BDADDR_NONE)) { in ll_setup()
652 } else if (bacmp(&lldev->bdaddr, BDADDR_ANY)) { in ll_setup()
653 err = ll_set_bdaddr(hu->hdev, &lldev->bdaddr); in ll_setup()
687 struct ll_device *lldev; in hci_ti_probe() local
691 lldev = devm_kzalloc(&serdev->dev, sizeof(struct ll_device), GFP_KERNEL); in hci_ti_probe()
692 if (!lldev) in hci_ti_probe()
694 hu = &lldev->hu; in hci_ti_probe()
696 serdev_device_set_drvdata(serdev, lldev); in hci_ti_probe()
697 lldev->serdev = hu->serdev = serdev; in hci_ti_probe()
699 lldev->enable_gpio = devm_gpiod_get_optional(&serdev->dev, in hci_ti_probe()
702 if (IS_ERR(lldev->enable_gpio)) in hci_ti_probe()
703 return PTR_ERR(lldev->enable_gpio); in hci_ti_probe()
705 lldev->ext_clk = devm_clk_get(&serdev->dev, "ext_clock"); in hci_ti_probe()
706 if (IS_ERR(lldev->ext_clk) && PTR_ERR(lldev->ext_clk) != -ENOENT) in hci_ti_probe()
707 return PTR_ERR(lldev->ext_clk); in hci_ti_probe()
732 bacpy(&lldev->bdaddr, BDADDR_NONE); in hci_ti_probe()
754 baswap(&lldev->bdaddr, bdaddr); in hci_ti_probe()
763 struct ll_device *lldev = serdev_device_get_drvdata(serdev); in hci_ti_remove() local
765 hci_uart_unregister_device(&lldev->hu); in hci_ti_remove()