Lines Matching +full:powered +full:- +full:on
1 // SPDX-License-Identifier: GPL-2.0-or-later
53 * struct bcm_device_data - device specific data
55 * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it
65 * struct bcm_device - device driver resources
102 * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it
160 static int irq_polarity = -1;
162 MODULE_PARM_DESC(irq_polarity, "IRQ polarity 0: active-high 1: active-low");
166 if (hu->serdev) in host_set_baudrate()
167 serdev_device_set_baudrate(hu->serdev, speed); in host_set_baudrate()
174 struct hci_dev *hdev = hu->hdev; in bcm_set_baudrate()
228 if (device && device->hu && device->hu->serdev) in bcm_device_exists()
242 static int bcm_gpio_set_power(struct bcm_device *dev, bool powered) in bcm_gpio_set_power() argument
246 if (powered && !dev->res_enabled) { in bcm_gpio_set_power()
250 if (dev->supplies[0].supply) { in bcm_gpio_set_power()
252 dev->supplies); in bcm_gpio_set_power()
258 err = clk_set_rate(dev->lpo_clk, 32768); in bcm_gpio_set_power()
260 dev_err(dev->dev, "Could not set LPO clock rate\n"); in bcm_gpio_set_power()
264 err = clk_prepare_enable(dev->lpo_clk); in bcm_gpio_set_power()
268 err = clk_prepare_enable(dev->txco_clk); in bcm_gpio_set_power()
273 err = dev->set_shutdown(dev, powered); in bcm_gpio_set_power()
277 err = dev->set_device_wakeup(dev, powered); in bcm_gpio_set_power()
281 if (!powered && dev->res_enabled) { in bcm_gpio_set_power()
282 clk_disable_unprepare(dev->txco_clk); in bcm_gpio_set_power()
283 clk_disable_unprepare(dev->lpo_clk); in bcm_gpio_set_power()
288 if (dev->supplies[0].supply) in bcm_gpio_set_power()
290 dev->supplies); in bcm_gpio_set_power()
293 /* wait for device to power on and come out of reset */ in bcm_gpio_set_power()
296 dev->res_enabled = powered; in bcm_gpio_set_power()
301 dev->set_shutdown(dev, !powered); in bcm_gpio_set_power()
303 if (powered && !dev->res_enabled) in bcm_gpio_set_power()
304 clk_disable_unprepare(dev->txco_clk); in bcm_gpio_set_power()
306 if (powered && !dev->res_enabled) in bcm_gpio_set_power()
307 clk_disable_unprepare(dev->lpo_clk); in bcm_gpio_set_power()
309 if (powered && !dev->res_enabled) in bcm_gpio_set_power()
310 regulator_bulk_disable(BCM_NUM_SUPPLIES, dev->supplies); in bcm_gpio_set_power()
321 pm_runtime_get(bdev->dev); in bcm_host_wake()
322 pm_runtime_mark_last_busy(bdev->dev); in bcm_host_wake()
323 pm_runtime_put_autosuspend(bdev->dev); in bcm_host_wake()
330 struct bcm_device *bdev = bcm->dev; in bcm_request_irq()
335 err = -ENODEV; in bcm_request_irq()
339 if (bdev->irq <= 0) { in bcm_request_irq()
340 err = -EOPNOTSUPP; in bcm_request_irq()
344 err = devm_request_irq(bdev->dev, bdev->irq, bcm_host_wake, in bcm_request_irq()
345 bdev->irq_active_low ? IRQF_TRIGGER_FALLING : in bcm_request_irq()
349 bdev->irq = err; in bcm_request_irq()
353 bdev->irq_acquired = true; in bcm_request_irq()
355 device_init_wakeup(bdev->dev, true); in bcm_request_irq()
357 pm_runtime_set_autosuspend_delay(bdev->dev, in bcm_request_irq()
359 pm_runtime_use_autosuspend(bdev->dev); in bcm_request_irq()
360 pm_runtime_set_active(bdev->dev); in bcm_request_irq()
361 pm_runtime_enable(bdev->dev); in bcm_request_irq()
377 .tristate_control = 0, /* Allow tri-state control of UART tx flag */
387 struct bcm_data *bcm = hu->priv; in bcm_setup_sleep()
391 sleep_params.host_wake_active = !bcm->dev->irq_active_low; in bcm_setup_sleep()
393 skb = __hci_cmd_sync(hu->hdev, 0xfc27, sizeof(sleep_params), in bcm_setup_sleep()
397 bt_dev_err(hu->hdev, "Sleep VSC failed (%d)", err); in bcm_setup_sleep()
402 bt_dev_dbg(hu->hdev, "Set Sleep Parameters VSC succeeded"); in bcm_setup_sleep()
414 struct bcm_data *bcm = hu->priv; in bcm_set_diag()
417 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bcm_set_diag()
418 return -ENETDOWN; in bcm_set_diag()
422 return -ENOMEM; in bcm_set_diag()
428 skb_queue_tail(&bcm->txq, skb); in bcm_set_diag()
440 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_open()
443 return -EOPNOTSUPP; in bcm_open()
447 return -ENOMEM; in bcm_open()
449 skb_queue_head_init(&bcm->txq); in bcm_open()
451 hu->priv = bcm; in bcm_open()
455 if (hu->serdev) { in bcm_open()
456 bcm->dev = serdev_device_get_drvdata(hu->serdev); in bcm_open()
460 if (!hu->tty->dev) in bcm_open()
466 /* Retrieve saved bcm_device based on parent of the in bcm_open()
470 if (hu->tty->dev->parent == dev->dev->parent) { in bcm_open()
471 bcm->dev = dev; in bcm_open()
473 dev->hu = hu; in bcm_open()
480 if (bcm->dev) { in bcm_open()
481 if (bcm->dev->use_autobaud_mode) in bcm_open()
483 else if (bcm->dev->drive_rts_on_open) in bcm_open()
486 if (bcm->dev->use_autobaud_mode && bcm->dev->max_autobaud_speed) in bcm_open()
487 hu->init_speed = min(bcm->dev->oper_speed, bcm->dev->max_autobaud_speed); in bcm_open()
489 hu->init_speed = bcm->dev->init_speed; in bcm_open()
494 if (!bcm->dev->no_early_set_baudrate && !bcm->dev->use_autobaud_mode) in bcm_open()
495 hu->oper_speed = bcm->dev->oper_speed; in bcm_open()
497 err = bcm_gpio_set_power(bcm->dev, true); in bcm_open()
499 if (bcm->dev->drive_rts_on_open) in bcm_open()
511 if (!hu->serdev) in bcm_open()
512 bcm->dev->hu = NULL; in bcm_open()
515 hu->priv = NULL; in bcm_open()
522 struct bcm_data *bcm = hu->priv; in bcm_close()
526 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_close()
528 /* Protect bcm->dev against removal of the device or driver */ in bcm_close()
531 if (hu->serdev) { in bcm_close()
532 bdev = serdev_device_get_drvdata(hu->serdev); in bcm_close()
533 } else if (bcm_device_exists(bcm->dev)) { in bcm_close()
534 bdev = bcm->dev; in bcm_close()
536 bdev->hu = NULL; in bcm_close()
541 if (IS_ENABLED(CONFIG_PM) && bdev->irq_acquired) { in bcm_close()
542 devm_free_irq(bdev->dev, bdev->irq, bdev); in bcm_close()
543 device_init_wakeup(bdev->dev, false); in bcm_close()
544 pm_runtime_disable(bdev->dev); in bcm_close()
549 bt_dev_err(hu->hdev, "Failed to power down"); in bcm_close()
551 pm_runtime_set_suspended(bdev->dev); in bcm_close()
555 skb_queue_purge(&bcm->txq); in bcm_close()
556 kfree_skb(bcm->rx_skb); in bcm_close()
559 hu->priv = NULL; in bcm_close()
565 struct bcm_data *bcm = hu->priv; in bcm_flush()
567 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_flush()
569 skb_queue_purge(&bcm->txq); in bcm_flush()
576 struct bcm_data *bcm = hu->priv; in bcm_setup()
578 bool use_autobaud_mode = (bcm->dev ? bcm->dev->use_autobaud_mode : 0); in bcm_setup()
582 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_setup()
584 hu->hdev->set_diag = bcm_set_diag; in bcm_setup()
585 hu->hdev->set_bdaddr = btbcm_set_bdaddr; in bcm_setup()
587 err = btbcm_initialize(hu->hdev, &fw_load_done, use_autobaud_mode); in bcm_setup()
595 if (bcm->dev && bcm->dev->init_speed) in bcm_setup()
596 speed = bcm->dev->init_speed; in bcm_setup()
597 else if (hu->proto->init_speed) in bcm_setup()
598 speed = hu->proto->init_speed; in bcm_setup()
606 if (hu->oper_speed) in bcm_setup()
607 speed = hu->oper_speed; in bcm_setup()
608 else if (bcm->dev && bcm->dev->oper_speed) in bcm_setup()
609 speed = bcm->dev->oper_speed; in bcm_setup()
610 else if (hu->proto->oper_speed) in bcm_setup()
611 speed = hu->proto->oper_speed; in bcm_setup()
622 if (bcm->dev && bcm->dev->pcm_int_params[0] != 0xff) { in bcm_setup()
625 btbcm_read_pcm_int_params(hu->hdev, ¶ms); in bcm_setup()
627 memcpy(¶ms, bcm->dev->pcm_int_params, 5); in bcm_setup()
628 btbcm_write_pcm_int_params(hu->hdev, ¶ms); in bcm_setup()
631 err = btbcm_finalize(hu->hdev, &fw_load_done, use_autobaud_mode); in bcm_setup()
639 set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hu->hdev->quirks); in bcm_setup()
688 struct bcm_data *bcm = hu->priv; in bcm_recv()
690 if (!test_bit(HCI_UART_REGISTERED, &hu->flags)) in bcm_recv()
691 return -EUNATCH; in bcm_recv()
693 bcm->rx_skb = h4_recv_buf(hu->hdev, bcm->rx_skb, data, count, in bcm_recv()
695 if (IS_ERR(bcm->rx_skb)) { in bcm_recv()
696 int err = PTR_ERR(bcm->rx_skb); in bcm_recv()
697 bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); in bcm_recv()
698 bcm->rx_skb = NULL; in bcm_recv()
700 } else if (!bcm->rx_skb) { in bcm_recv()
701 /* Delay auto-suspend when receiving completed packet */ in bcm_recv()
703 if (bcm->dev && bcm_device_exists(bcm->dev)) { in bcm_recv()
704 pm_runtime_get(bcm->dev->dev); in bcm_recv()
705 pm_runtime_mark_last_busy(bcm->dev->dev); in bcm_recv()
706 pm_runtime_put_autosuspend(bcm->dev->dev); in bcm_recv()
716 struct bcm_data *bcm = hu->priv; in bcm_enqueue()
718 bt_dev_dbg(hu->hdev, "hu %p skb %p", hu, skb); in bcm_enqueue()
722 skb_queue_tail(&bcm->txq, skb); in bcm_enqueue()
729 struct bcm_data *bcm = hu->priv; in bcm_dequeue()
735 if (bcm_device_exists(bcm->dev)) { in bcm_dequeue()
736 bdev = bcm->dev; in bcm_dequeue()
737 pm_runtime_get_sync(bdev->dev); in bcm_dequeue()
741 skb = skb_dequeue(&bcm->txq); in bcm_dequeue()
744 pm_runtime_mark_last_busy(bdev->dev); in bcm_dequeue()
745 pm_runtime_put_autosuspend(bdev->dev); in bcm_dequeue()
761 if (!bdev->is_suspended && bdev->hu) { in bcm_suspend_device()
762 hci_uart_set_flow_control(bdev->hu, true); in bcm_suspend_device()
765 bdev->is_suspended = true; in bcm_suspend_device()
769 err = bdev->set_device_wakeup(bdev, false); in bcm_suspend_device()
771 if (bdev->is_suspended && bdev->hu) { in bcm_suspend_device()
772 bdev->is_suspended = false; in bcm_suspend_device()
773 hci_uart_set_flow_control(bdev->hu, false); in bcm_suspend_device()
775 return -EBUSY; in bcm_suspend_device()
791 err = bdev->set_device_wakeup(bdev, true); in bcm_resume_device()
801 if (bdev->is_suspended && bdev->hu) { in bcm_resume_device()
802 bdev->is_suspended = false; in bcm_resume_device()
804 hci_uart_set_flow_control(bdev->hu, false); in bcm_resume_device()
818 bt_dev_dbg(bdev, "suspend: is_suspended %d", bdev->is_suspended); in bcm_suspend()
824 * and device_wake-up GPIO. in bcm_suspend()
828 if (!bdev->hu) in bcm_suspend()
834 if (device_may_wakeup(dev) && bdev->irq > 0) { in bcm_suspend()
835 error = enable_irq_wake(bdev->irq); in bcm_suspend()
852 bt_dev_dbg(bdev, "resume: is_suspended %d", bdev->is_suspended); in bcm_resume()
858 * and device_wake-up GPIO. in bcm_resume()
862 if (!bdev->hu) in bcm_resume()
865 if (device_may_wakeup(dev) && bdev->irq > 0) { in bcm_resume()
866 disable_irq_wake(bdev->irq); in bcm_resume()
887 .dev_id = "serial0-0",
889 GPIO_LOOKUP("INT33FC:02", 17, "host-wakeup-alt", GPIO_ACTIVE_HIGH),
921 { "device-wakeup-gpios", &first_gpio, 1 },
922 { "shutdown-gpios", &second_gpio, 1 },
923 { "host-wakeup-gpios", &third_gpio, 1 },
928 { "host-wakeup-gpios", &first_gpio, 1 },
929 { "device-wakeup-gpios", &second_gpio, 1 },
930 { "shutdown-gpios", &third_gpio, 1 },
941 switch (ares->type) { in bcm_resource()
943 irq = &ares->data.extended_irq; in bcm_resource()
944 if (irq->polarity != ACPI_ACTIVE_LOW) in bcm_resource()
945 …dev_info(dev->dev, "ACPI Interrupt resource is active-high, this is usually wrong, treating the IR… in bcm_resource()
946 dev->irq_active_low = true; in bcm_resource()
950 gpio = &ares->data.gpio; in bcm_resource()
951 if (gpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT) { in bcm_resource()
952 dev->gpio_int_idx = dev->gpio_count; in bcm_resource()
953 dev->irq_active_low = gpio->polarity == ACPI_ACTIVE_LOW; in bcm_resource()
955 dev->gpio_count++; in bcm_resource()
959 sb = &ares->data.uart_serial_bus; in bcm_resource()
960 if (sb->type == ACPI_RESOURCE_SERIAL_TYPE_UART) { in bcm_resource()
961 dev->init_speed = sb->default_baud_rate; in bcm_resource()
962 dev->oper_speed = 4000000; in bcm_resource()
975 if (ACPI_FAILURE(acpi_execute_simple_method(dev->btlp, NULL, !awake))) in bcm_apple_set_device_wakeup()
976 return -EIO; in bcm_apple_set_device_wakeup()
981 static int bcm_apple_set_shutdown(struct bcm_device *dev, bool powered) in bcm_apple_set_shutdown() argument
983 if (ACPI_FAILURE(acpi_evaluate_object(powered ? dev->btpu : dev->btpd, in bcm_apple_set_shutdown()
985 return -EIO; in bcm_apple_set_shutdown()
992 struct acpi_device *adev = ACPI_COMPANION(dev->dev); in bcm_apple_get_resources()
996 ACPI_FAILURE(acpi_get_handle(adev->handle, "BTLP", &dev->btlp)) || in bcm_apple_get_resources()
997 ACPI_FAILURE(acpi_get_handle(adev->handle, "BTPU", &dev->btpu)) || in bcm_apple_get_resources()
998 ACPI_FAILURE(acpi_get_handle(adev->handle, "BTPD", &dev->btpd))) in bcm_apple_get_resources()
999 return -ENODEV; in bcm_apple_get_resources()
1002 obj->buffer.length == 8) in bcm_apple_get_resources()
1003 dev->init_speed = *(u64 *)obj->buffer.pointer; in bcm_apple_get_resources()
1005 dev->set_device_wakeup = bcm_apple_set_device_wakeup; in bcm_apple_get_resources()
1006 dev->set_shutdown = bcm_apple_set_shutdown; in bcm_apple_get_resources()
1013 return -EOPNOTSUPP; in bcm_apple_get_resources()
1019 gpiod_set_value_cansleep(dev->device_wakeup, awake); in bcm_gpio_set_device_wakeup()
1023 static int bcm_gpio_set_shutdown(struct bcm_device *dev, bool powered) in bcm_gpio_set_shutdown() argument
1025 gpiod_set_value_cansleep(dev->shutdown, powered); in bcm_gpio_set_shutdown()
1026 if (dev->reset) in bcm_gpio_set_shutdown()
1028 * The reset line is asserted on powerdown and deasserted in bcm_gpio_set_shutdown()
1029 * on poweron so the inverse of powered is used. Notice in bcm_gpio_set_shutdown()
1034 gpiod_set_value_cansleep(dev->reset, !powered); in bcm_gpio_set_shutdown()
1045 if (!IS_ERR(clk) || PTR_ERR(clk) == -EPROBE_DEFER) in bcm_get_txco()
1050 if (!IS_ERR(clk) || PTR_ERR(clk) == -EPROBE_DEFER) in bcm_get_txco()
1060 const char *irq_con_id = "host-wakeup"; in bcm_get_resources()
1063 dev->name = dev_name(dev->dev); in bcm_get_resources()
1068 dev->txco_clk = bcm_get_txco(dev->dev); in bcm_get_resources()
1071 if (dev->txco_clk == ERR_PTR(-EPROBE_DEFER)) in bcm_get_resources()
1072 return PTR_ERR(dev->txco_clk); in bcm_get_resources()
1075 if (IS_ERR(dev->txco_clk)) in bcm_get_resources()
1076 dev->txco_clk = NULL; in bcm_get_resources()
1078 dev->lpo_clk = devm_clk_get(dev->dev, "lpo"); in bcm_get_resources()
1079 if (dev->lpo_clk == ERR_PTR(-EPROBE_DEFER)) in bcm_get_resources()
1080 return PTR_ERR(dev->lpo_clk); in bcm_get_resources()
1082 if (IS_ERR(dev->lpo_clk)) in bcm_get_resources()
1083 dev->lpo_clk = NULL; in bcm_get_resources()
1086 if (dev->lpo_clk && clk_is_match(dev->lpo_clk, dev->txco_clk)) { in bcm_get_resources()
1087 devm_clk_put(dev->dev, dev->txco_clk); in bcm_get_resources()
1088 dev->txco_clk = NULL; in bcm_get_resources()
1091 dev->device_wakeup = devm_gpiod_get_optional(dev->dev, "device-wakeup", in bcm_get_resources()
1093 if (IS_ERR(dev->device_wakeup)) in bcm_get_resources()
1094 return PTR_ERR(dev->device_wakeup); in bcm_get_resources()
1096 dev->shutdown = devm_gpiod_get_optional(dev->dev, "shutdown", in bcm_get_resources()
1098 if (IS_ERR(dev->shutdown)) in bcm_get_resources()
1099 return PTR_ERR(dev->shutdown); in bcm_get_resources()
1101 dev->reset = devm_gpiod_get_optional(dev->dev, "reset", in bcm_get_resources()
1103 if (IS_ERR(dev->reset)) in bcm_get_resources()
1104 return PTR_ERR(dev->reset); in bcm_get_resources()
1106 dev->set_device_wakeup = bcm_gpio_set_device_wakeup; in bcm_get_resources()
1107 dev->set_shutdown = bcm_gpio_set_shutdown; in bcm_get_resources()
1109 dev->supplies[0].supply = "vbat"; in bcm_get_resources()
1110 dev->supplies[1].supply = "vddio"; in bcm_get_resources()
1111 err = devm_regulator_bulk_get(dev->dev, BCM_NUM_SUPPLIES, in bcm_get_resources()
1112 dev->supplies); in bcm_get_resources()
1117 if (broken_irq_dmi_id && broken_irq_dmi_id->driver_data) { in bcm_get_resources()
1118 gpiod_add_lookup_table(broken_irq_dmi_id->driver_data); in bcm_get_resources()
1119 irq_con_id = "host-wakeup-alt"; in bcm_get_resources()
1120 dev->irq_active_low = false; in bcm_get_resources()
1121 dev->irq = 0; in bcm_get_resources()
1125 if (dev->irq <= 0) { in bcm_get_resources()
1128 gpio = devm_gpiod_get_optional(dev->dev, irq_con_id, GPIOD_IN); in bcm_get_resources()
1132 dev->irq = gpiod_to_irq(gpio); in bcm_get_resources()
1136 if (broken_irq_dmi_id->driver_data) { in bcm_get_resources()
1137 gpiod_remove_lookup_table(broken_irq_dmi_id->driver_data); in bcm_get_resources()
1139 dev_info(dev->dev, "%s: Has a broken IRQ config, disabling IRQ support / runtime-pm\n", in bcm_get_resources()
1140 broken_irq_dmi_id->ident); in bcm_get_resources()
1141 dev->irq = 0; in bcm_get_resources()
1145 dev_dbg(dev->dev, "BCM irq: %d\n", dev->irq); in bcm_get_resources()
1158 dev->gpio_int_idx = -1; in bcm_acpi_probe()
1159 ret = acpi_dev_get_resources(ACPI_COMPANION(dev->dev), in bcm_acpi_probe()
1165 if (resource_type(entry->res) == IORESOURCE_IRQ) { in bcm_acpi_probe()
1166 dev->irq = entry->res->start; in bcm_acpi_probe()
1173 * only 2 GPIO resources, we use the irq-last mapping for this, since in bcm_acpi_probe()
1176 if (dev->irq) in bcm_acpi_probe()
1178 else if (dev->gpio_int_idx == 0) in bcm_acpi_probe()
1180 else if (dev->gpio_int_idx == 2) in bcm_acpi_probe()
1183 dev_warn(dev->dev, "Unexpected ACPI gpio_int_idx: %d\n", in bcm_acpi_probe()
1184 dev->gpio_int_idx); in bcm_acpi_probe()
1187 if (dev->gpio_count != (dev->irq ? 2 : 3)) in bcm_acpi_probe()
1188 dev_warn(dev->dev, "Unexpected number of ACPI GPIOs: %d\n", in bcm_acpi_probe()
1189 dev->gpio_count); in bcm_acpi_probe()
1191 ret = devm_acpi_dev_add_driver_gpios(dev->dev, gpio_mapping); in bcm_acpi_probe()
1195 if (irq_polarity != -1) { in bcm_acpi_probe()
1196 dev->irq_active_low = irq_polarity; in bcm_acpi_probe()
1197 dev_warn(dev->dev, "Overwriting IRQ polarity to active %s by module-param\n", in bcm_acpi_probe()
1198 dev->irq_active_low ? "low" : "high"); in bcm_acpi_probe()
1206 return -EINVAL; in bcm_acpi_probe()
1212 bdev->use_autobaud_mode = device_property_read_bool(bdev->dev, in bcm_of_probe()
1213 "brcm,requires-autobaud-mode"); in bcm_of_probe()
1214 device_property_read_u32(bdev->dev, "max-speed", &bdev->oper_speed); in bcm_of_probe()
1215 device_property_read_u8_array(bdev->dev, "brcm,bt-pcm-int-params", in bcm_of_probe()
1216 bdev->pcm_int_params, 5); in bcm_of_probe()
1217 bdev->irq = of_irq_get_byname(bdev->dev->of_node, "host-wakeup"); in bcm_of_probe()
1218 bdev->irq_active_low = irq_get_trigger_type(bdev->irq) in bcm_of_probe()
1228 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); in bcm_probe()
1230 return -ENOMEM; in bcm_probe()
1232 dev->dev = &pdev->dev; in bcm_probe()
1238 dev->irq = ret; in bcm_probe()
1241 dev->pcm_int_params[0] = 0xff; in bcm_probe()
1243 if (has_acpi_companion(&pdev->dev)) { in bcm_probe()
1255 dev_info(&pdev->dev, "%s device registered.\n", dev->name); in bcm_probe()
1257 /* Place this instance on the device list */ in bcm_probe()
1259 list_add_tail(&dev->list, &bcm_device_list); in bcm_probe()
1264 dev_err(&pdev->dev, "Failed to power down\n"); in bcm_probe()
1274 list_del(&dev->list); in bcm_remove()
1277 dev_info(&pdev->dev, "%s device unregistered.\n", dev->name); in bcm_remove()
1492 bcmdev = devm_kzalloc(&serdev->dev, sizeof(*bcmdev), GFP_KERNEL); in bcm_serdev_probe()
1494 return -ENOMEM; in bcm_serdev_probe()
1496 bcmdev->dev = &serdev->dev; in bcm_serdev_probe()
1498 bcmdev->hu = &bcmdev->serdev_hu; in bcm_serdev_probe()
1500 bcmdev->serdev_hu.serdev = serdev; in bcm_serdev_probe()
1504 bcmdev->pcm_int_params[0] = 0xff; in bcm_serdev_probe()
1506 if (has_acpi_companion(&serdev->dev)) in bcm_serdev_probe()
1517 if (!bcmdev->shutdown) { in bcm_serdev_probe()
1518 dev_warn(&serdev->dev, in bcm_serdev_probe()
1520 bcmdev->oper_speed = bcmdev->init_speed; in bcm_serdev_probe()
1525 dev_err(&serdev->dev, "Failed to power down\n"); in bcm_serdev_probe()
1527 data = device_get_match_data(bcmdev->dev); in bcm_serdev_probe()
1529 bcmdev->max_autobaud_speed = data->max_autobaud_speed; in bcm_serdev_probe()
1530 bcmdev->no_early_set_baudrate = data->no_early_set_baudrate; in bcm_serdev_probe()
1531 bcmdev->drive_rts_on_open = data->drive_rts_on_open; in bcm_serdev_probe()
1534 return hci_uart_register_device(&bcmdev->serdev_hu, &bcm_proto); in bcm_serdev_probe()
1541 hci_uart_unregister_device(&bcmdev->serdev_hu); in bcm_serdev_remove()
1559 { .compatible = "brcm,bcm4329-bt" },
1560 { .compatible = "brcm,bcm4330-bt" },
1561 { .compatible = "brcm,bcm4334-bt" },
1563 { .compatible = "brcm,bcm43430a0-bt" },
1564 { .compatible = "brcm,bcm43430a1-bt" },
1565 { .compatible = "brcm,bcm43438-bt", .data = &bcm43438_device_data },
1566 { .compatible = "brcm,bcm4349-bt", .data = &bcm43438_device_data },
1567 { .compatible = "brcm,bcm43540-bt", .data = &bcm4354_device_data },
1569 { .compatible = "infineon,cyw55572-bt", .data = &cyw55572_device_data },