Lines Matching +full:lpm +full:- +full:gpios

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
69 * struct bcm_device - device driver resources
106 * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it
166 static int irq_polarity = -1;
168 MODULE_PARM_DESC(irq_polarity, "IRQ polarity 0: active-high 1: active-low");
172 if (hu->serdev) in host_set_baudrate()
173 serdev_device_set_baudrate(hu->serdev, speed); in host_set_baudrate()
180 struct hci_dev *hdev = hu->hdev; in bcm_set_baudrate()
181 struct bcm_data *bcm = hu->priv; in bcm_set_baudrate()
185 if (speed > 3000000 && !bcm->dev->no_uart_clock_set) { in bcm_set_baudrate()
235 if (device && device->hu && device->hu->serdev) in bcm_device_exists()
253 if (powered && !dev->res_enabled) { in bcm_gpio_set_power()
257 if (dev->supplies[0].supply) { in bcm_gpio_set_power()
259 dev->supplies); in bcm_gpio_set_power()
265 err = clk_set_rate(dev->lpo_clk, 32768); in bcm_gpio_set_power()
267 dev_err(dev->dev, "Could not set LPO clock rate\n"); in bcm_gpio_set_power()
271 err = clk_prepare_enable(dev->lpo_clk); in bcm_gpio_set_power()
275 err = clk_prepare_enable(dev->txco_clk); in bcm_gpio_set_power()
280 err = dev->set_shutdown(dev, powered); in bcm_gpio_set_power()
284 err = dev->set_device_wakeup(dev, powered); in bcm_gpio_set_power()
288 if (!powered && dev->res_enabled) { in bcm_gpio_set_power()
289 clk_disable_unprepare(dev->txco_clk); in bcm_gpio_set_power()
290 clk_disable_unprepare(dev->lpo_clk); in bcm_gpio_set_power()
295 if (dev->supplies[0].supply) in bcm_gpio_set_power()
297 dev->supplies); in bcm_gpio_set_power()
303 dev->res_enabled = powered; in bcm_gpio_set_power()
308 dev->set_shutdown(dev, !powered); in bcm_gpio_set_power()
310 if (powered && !dev->res_enabled) in bcm_gpio_set_power()
311 clk_disable_unprepare(dev->txco_clk); in bcm_gpio_set_power()
313 if (powered && !dev->res_enabled) in bcm_gpio_set_power()
314 clk_disable_unprepare(dev->lpo_clk); in bcm_gpio_set_power()
316 if (powered && !dev->res_enabled) in bcm_gpio_set_power()
317 regulator_bulk_disable(BCM_NUM_SUPPLIES, dev->supplies); in bcm_gpio_set_power()
328 pm_runtime_get(bdev->dev); in bcm_host_wake()
329 pm_runtime_mark_last_busy(bdev->dev); in bcm_host_wake()
330 pm_runtime_put_autosuspend(bdev->dev); in bcm_host_wake()
337 struct bcm_device *bdev = bcm->dev; in bcm_request_irq()
342 err = -ENODEV; in bcm_request_irq()
346 if (bdev->irq <= 0) { in bcm_request_irq()
347 err = -EOPNOTSUPP; in bcm_request_irq()
351 err = devm_request_irq(bdev->dev, bdev->irq, bcm_host_wake, in bcm_request_irq()
352 bdev->irq_active_low ? IRQF_TRIGGER_FALLING : in bcm_request_irq()
356 bdev->irq = err; in bcm_request_irq()
360 bdev->irq_acquired = true; in bcm_request_irq()
362 device_init_wakeup(bdev->dev, true); in bcm_request_irq()
364 pm_runtime_set_autosuspend_delay(bdev->dev, in bcm_request_irq()
366 pm_runtime_use_autosuspend(bdev->dev); in bcm_request_irq()
367 pm_runtime_set_active(bdev->dev); in bcm_request_irq()
368 pm_runtime_enable(bdev->dev); in bcm_request_irq()
383 .combine_modes = 1, /* Combine sleep and LPM flag */
384 .tristate_control = 0, /* Allow tri-state control of UART tx flag */
394 struct bcm_data *bcm = hu->priv; in bcm_setup_sleep()
398 sleep_params.host_wake_active = !bcm->dev->irq_active_low; in bcm_setup_sleep()
400 skb = __hci_cmd_sync(hu->hdev, 0xfc27, sizeof(sleep_params), in bcm_setup_sleep()
404 bt_dev_err(hu->hdev, "Sleep VSC failed (%d)", err); in bcm_setup_sleep()
409 bt_dev_dbg(hu->hdev, "Set Sleep Parameters VSC succeeded"); in bcm_setup_sleep()
421 struct bcm_data *bcm = hu->priv; in bcm_set_diag()
424 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bcm_set_diag()
425 return -ENETDOWN; in bcm_set_diag()
429 return -ENOMEM; in bcm_set_diag()
435 skb_queue_tail(&bcm->txq, skb); in bcm_set_diag()
447 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_open()
450 return -EOPNOTSUPP; in bcm_open()
454 return -ENOMEM; in bcm_open()
456 skb_queue_head_init(&bcm->txq); in bcm_open()
458 hu->priv = bcm; in bcm_open()
462 if (hu->serdev) { in bcm_open()
463 bcm->dev = serdev_device_get_drvdata(hu->serdev); in bcm_open()
467 if (!hu->tty->dev) in bcm_open()
477 if (hu->tty->dev->parent == dev->dev->parent) { in bcm_open()
478 bcm->dev = dev; in bcm_open()
480 dev->hu = hu; in bcm_open()
487 if (bcm->dev) { in bcm_open()
488 if (bcm->dev->use_autobaud_mode) in bcm_open()
490 else if (bcm->dev->drive_rts_on_open) in bcm_open()
493 if (bcm->dev->use_autobaud_mode && bcm->dev->max_autobaud_speed) in bcm_open()
494 hu->init_speed = min(bcm->dev->oper_speed, bcm->dev->max_autobaud_speed); in bcm_open()
496 hu->init_speed = bcm->dev->init_speed; in bcm_open()
501 if (!bcm->dev->no_early_set_baudrate && !bcm->dev->use_autobaud_mode) in bcm_open()
502 hu->oper_speed = bcm->dev->oper_speed; in bcm_open()
504 err = bcm_gpio_set_power(bcm->dev, true); in bcm_open()
506 if (bcm->dev->drive_rts_on_open) in bcm_open()
518 if (!hu->serdev) in bcm_open()
519 bcm->dev->hu = NULL; in bcm_open()
522 hu->priv = NULL; in bcm_open()
529 struct bcm_data *bcm = hu->priv; in bcm_close()
533 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_close()
535 /* Protect bcm->dev against removal of the device or driver */ in bcm_close()
538 if (hu->serdev) { in bcm_close()
539 bdev = serdev_device_get_drvdata(hu->serdev); in bcm_close()
540 } else if (bcm_device_exists(bcm->dev)) { in bcm_close()
541 bdev = bcm->dev; in bcm_close()
543 bdev->hu = NULL; in bcm_close()
548 if (IS_ENABLED(CONFIG_PM) && bdev->irq_acquired) { in bcm_close()
549 devm_free_irq(bdev->dev, bdev->irq, bdev); in bcm_close()
550 device_init_wakeup(bdev->dev, false); in bcm_close()
551 pm_runtime_disable(bdev->dev); in bcm_close()
556 bt_dev_err(hu->hdev, "Failed to power down"); in bcm_close()
558 pm_runtime_set_suspended(bdev->dev); in bcm_close()
562 skb_queue_purge(&bcm->txq); in bcm_close()
563 kfree_skb(bcm->rx_skb); in bcm_close()
566 hu->priv = NULL; in bcm_close()
572 struct bcm_data *bcm = hu->priv; in bcm_flush()
574 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_flush()
576 skb_queue_purge(&bcm->txq); in bcm_flush()
583 struct bcm_data *bcm = hu->priv; in bcm_setup()
585 bool use_autobaud_mode = (bcm->dev ? bcm->dev->use_autobaud_mode : 0); in bcm_setup()
589 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_setup()
591 hu->hdev->set_diag = bcm_set_diag; in bcm_setup()
592 hu->hdev->set_bdaddr = btbcm_set_bdaddr; in bcm_setup()
594 err = btbcm_initialize(hu->hdev, &fw_load_done, use_autobaud_mode); in bcm_setup()
602 if (bcm->dev && bcm->dev->init_speed) in bcm_setup()
603 speed = bcm->dev->init_speed; in bcm_setup()
604 else if (hu->proto->init_speed) in bcm_setup()
605 speed = hu->proto->init_speed; in bcm_setup()
613 if (hu->oper_speed) in bcm_setup()
614 speed = hu->oper_speed; in bcm_setup()
615 else if (bcm->dev && bcm->dev->oper_speed) in bcm_setup()
616 speed = bcm->dev->oper_speed; in bcm_setup()
617 else if (hu->proto->oper_speed) in bcm_setup()
618 speed = hu->proto->oper_speed; in bcm_setup()
629 if (bcm->dev && bcm->dev->pcm_int_params[0] != 0xff) { in bcm_setup()
632 btbcm_read_pcm_int_params(hu->hdev, &params); in bcm_setup()
634 memcpy(&params, bcm->dev->pcm_int_params, 5); in bcm_setup()
635 btbcm_write_pcm_int_params(hu->hdev, &params); in bcm_setup()
638 err = btbcm_finalize(hu->hdev, &fw_load_done, use_autobaud_mode); in bcm_setup()
646 if (test_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks)) in bcm_setup()
647 set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hu->hdev->quirks); in bcm_setup()
696 struct bcm_data *bcm = hu->priv; in bcm_recv()
698 if (!test_bit(HCI_UART_REGISTERED, &hu->flags)) in bcm_recv()
699 return -EUNATCH; in bcm_recv()
701 bcm->rx_skb = h4_recv_buf(hu->hdev, bcm->rx_skb, data, count, in bcm_recv()
703 if (IS_ERR(bcm->rx_skb)) { in bcm_recv()
704 int err = PTR_ERR(bcm->rx_skb); in bcm_recv()
705 bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); in bcm_recv()
706 bcm->rx_skb = NULL; in bcm_recv()
708 } else if (!bcm->rx_skb) { in bcm_recv()
709 /* Delay auto-suspend when receiving completed packet */ in bcm_recv()
711 if (bcm->dev && bcm_device_exists(bcm->dev)) { in bcm_recv()
712 pm_runtime_get(bcm->dev->dev); in bcm_recv()
713 pm_runtime_mark_last_busy(bcm->dev->dev); in bcm_recv()
714 pm_runtime_put_autosuspend(bcm->dev->dev); in bcm_recv()
724 struct bcm_data *bcm = hu->priv; in bcm_enqueue()
726 bt_dev_dbg(hu->hdev, "hu %p skb %p", hu, skb); in bcm_enqueue()
730 skb_queue_tail(&bcm->txq, skb); in bcm_enqueue()
737 struct bcm_data *bcm = hu->priv; in bcm_dequeue()
743 if (bcm_device_exists(bcm->dev)) { in bcm_dequeue()
744 bdev = bcm->dev; in bcm_dequeue()
745 pm_runtime_get_sync(bdev->dev); in bcm_dequeue()
749 skb = skb_dequeue(&bcm->txq); in bcm_dequeue()
752 pm_runtime_mark_last_busy(bdev->dev); in bcm_dequeue()
753 pm_runtime_put_autosuspend(bdev->dev); in bcm_dequeue()
769 if (!bdev->is_suspended && bdev->hu) { in bcm_suspend_device()
770 hci_uart_set_flow_control(bdev->hu, true); in bcm_suspend_device()
773 bdev->is_suspended = true; in bcm_suspend_device()
777 err = bdev->set_device_wakeup(bdev, false); in bcm_suspend_device()
779 if (bdev->is_suspended && bdev->hu) { in bcm_suspend_device()
780 bdev->is_suspended = false; in bcm_suspend_device()
781 hci_uart_set_flow_control(bdev->hu, false); in bcm_suspend_device()
783 return -EBUSY; in bcm_suspend_device()
799 err = bdev->set_device_wakeup(bdev, true); in bcm_resume_device()
809 if (bdev->is_suspended && bdev->hu) { in bcm_resume_device()
810 bdev->is_suspended = false; in bcm_resume_device()
812 hci_uart_set_flow_control(bdev->hu, false); in bcm_resume_device()
826 bt_dev_dbg(bdev, "suspend: is_suspended %d", bdev->is_suspended); in bcm_suspend()
832 * and device_wake-up GPIO. in bcm_suspend()
836 if (!bdev->hu) in bcm_suspend()
842 if (device_may_wakeup(dev) && bdev->irq > 0) { in bcm_suspend()
843 error = enable_irq_wake(bdev->irq); in bcm_suspend()
860 bt_dev_dbg(bdev, "resume: is_suspended %d", bdev->is_suspended); in bcm_resume()
866 * and device_wake-up GPIO. in bcm_resume()
870 if (!bdev->hu) in bcm_resume()
873 if (device_may_wakeup(dev) && bdev->irq > 0) { in bcm_resume()
874 disable_irq_wake(bdev->irq); in bcm_resume()
895 .dev_id = "serial0-0",
897 GPIO_LOOKUP("INT33FC:02", 17, "host-wakeup-alt", GPIO_ACTIVE_HIGH),
904 .ident = "Acer Iconia One 7 B1-750",
924 DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
948 { "device-wakeup-gpios", &first_gpio, 1 },
949 { "shutdown-gpios", &second_gpio, 1 },
950 { "host-wakeup-gpios", &third_gpio, 1 },
955 { "host-wakeup-gpios", &first_gpio, 1 },
956 { "device-wakeup-gpios", &second_gpio, 1 },
957 { "shutdown-gpios", &third_gpio, 1 },
968 switch (ares->type) { in bcm_resource()
970 irq = &ares->data.extended_irq; in bcm_resource()
971 if (irq->polarity != ACPI_ACTIVE_LOW) in bcm_resource()
972 …dev_info(dev->dev, "ACPI Interrupt resource is active-high, this is usually wrong, treating the IR… in bcm_resource()
973 dev->irq_active_low = true; in bcm_resource()
977 gpio = &ares->data.gpio; in bcm_resource()
978 if (gpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT) { in bcm_resource()
979 dev->gpio_int_idx = dev->gpio_count; in bcm_resource()
980 dev->irq_active_low = gpio->polarity == ACPI_ACTIVE_LOW; in bcm_resource()
982 dev->gpio_count++; in bcm_resource()
986 sb = &ares->data.uart_serial_bus; in bcm_resource()
987 if (sb->type == ACPI_RESOURCE_SERIAL_TYPE_UART) { in bcm_resource()
988 dev->init_speed = sb->default_baud_rate; in bcm_resource()
989 dev->oper_speed = 4000000; in bcm_resource()
1002 if (ACPI_FAILURE(acpi_execute_simple_method(dev->btlp, NULL, !awake))) in bcm_apple_set_device_wakeup()
1003 return -EIO; in bcm_apple_set_device_wakeup()
1010 if (ACPI_FAILURE(acpi_evaluate_object(powered ? dev->btpu : dev->btpd, in bcm_apple_set_shutdown()
1012 return -EIO; in bcm_apple_set_shutdown()
1019 struct acpi_device *adev = ACPI_COMPANION(dev->dev); in bcm_apple_get_resources()
1023 ACPI_FAILURE(acpi_get_handle(adev->handle, "BTLP", &dev->btlp)) || in bcm_apple_get_resources()
1024 ACPI_FAILURE(acpi_get_handle(adev->handle, "BTPU", &dev->btpu)) || in bcm_apple_get_resources()
1025 ACPI_FAILURE(acpi_get_handle(adev->handle, "BTPD", &dev->btpd))) in bcm_apple_get_resources()
1026 return -ENODEV; in bcm_apple_get_resources()
1029 obj->buffer.length == 8) in bcm_apple_get_resources()
1030 dev->init_speed = *(u64 *)obj->buffer.pointer; in bcm_apple_get_resources()
1032 dev->set_device_wakeup = bcm_apple_set_device_wakeup; in bcm_apple_get_resources()
1033 dev->set_shutdown = bcm_apple_set_shutdown; in bcm_apple_get_resources()
1040 return -EOPNOTSUPP; in bcm_apple_get_resources()
1046 gpiod_set_value_cansleep(dev->device_wakeup, awake); in bcm_gpio_set_device_wakeup()
1052 gpiod_set_value_cansleep(dev->shutdown, powered); in bcm_gpio_set_shutdown()
1053 if (dev->reset) in bcm_gpio_set_shutdown()
1061 gpiod_set_value_cansleep(dev->reset, !powered); in bcm_gpio_set_shutdown()
1072 if (!IS_ERR(clk) || PTR_ERR(clk) == -EPROBE_DEFER) in bcm_get_txco()
1077 if (!IS_ERR(clk) || PTR_ERR(clk) == -EPROBE_DEFER) in bcm_get_txco()
1087 const char *irq_con_id = "host-wakeup"; in bcm_get_resources()
1090 dev->name = dev_name(dev->dev); in bcm_get_resources()
1095 dev->txco_clk = bcm_get_txco(dev->dev); in bcm_get_resources()
1098 if (dev->txco_clk == ERR_PTR(-EPROBE_DEFER)) in bcm_get_resources()
1099 return PTR_ERR(dev->txco_clk); in bcm_get_resources()
1102 if (IS_ERR(dev->txco_clk)) in bcm_get_resources()
1103 dev->txco_clk = NULL; in bcm_get_resources()
1105 dev->lpo_clk = devm_clk_get(dev->dev, "lpo"); in bcm_get_resources()
1106 if (dev->lpo_clk == ERR_PTR(-EPROBE_DEFER)) in bcm_get_resources()
1107 return PTR_ERR(dev->lpo_clk); in bcm_get_resources()
1109 if (IS_ERR(dev->lpo_clk)) in bcm_get_resources()
1110 dev->lpo_clk = NULL; in bcm_get_resources()
1113 if (dev->lpo_clk && clk_is_match(dev->lpo_clk, dev->txco_clk)) { in bcm_get_resources()
1114 devm_clk_put(dev->dev, dev->txco_clk); in bcm_get_resources()
1115 dev->txco_clk = NULL; in bcm_get_resources()
1118 dev->device_wakeup = devm_gpiod_get_optional(dev->dev, "device-wakeup", in bcm_get_resources()
1120 if (IS_ERR(dev->device_wakeup)) in bcm_get_resources()
1121 return PTR_ERR(dev->device_wakeup); in bcm_get_resources()
1123 dev->shutdown = devm_gpiod_get_optional(dev->dev, "shutdown", in bcm_get_resources()
1125 if (IS_ERR(dev->shutdown)) in bcm_get_resources()
1126 return PTR_ERR(dev->shutdown); in bcm_get_resources()
1128 dev->reset = devm_gpiod_get_optional(dev->dev, "reset", in bcm_get_resources()
1130 if (IS_ERR(dev->reset)) in bcm_get_resources()
1131 return PTR_ERR(dev->reset); in bcm_get_resources()
1133 dev->set_device_wakeup = bcm_gpio_set_device_wakeup; in bcm_get_resources()
1134 dev->set_shutdown = bcm_gpio_set_shutdown; in bcm_get_resources()
1136 dev->supplies[0].supply = "vbat"; in bcm_get_resources()
1137 dev->supplies[1].supply = "vddio"; in bcm_get_resources()
1138 err = devm_regulator_bulk_get(dev->dev, BCM_NUM_SUPPLIES, in bcm_get_resources()
1139 dev->supplies); in bcm_get_resources()
1144 if (broken_irq_dmi_id && broken_irq_dmi_id->driver_data) { in bcm_get_resources()
1145 gpiod_add_lookup_table(broken_irq_dmi_id->driver_data); in bcm_get_resources()
1146 irq_con_id = "host-wakeup-alt"; in bcm_get_resources()
1147 dev->irq_active_low = false; in bcm_get_resources()
1148 dev->irq = 0; in bcm_get_resources()
1152 if (dev->irq <= 0) { in bcm_get_resources()
1155 gpio = devm_gpiod_get_optional(dev->dev, irq_con_id, GPIOD_IN); in bcm_get_resources()
1159 dev->irq = gpiod_to_irq(gpio); in bcm_get_resources()
1163 if (broken_irq_dmi_id->driver_data) { in bcm_get_resources()
1164 gpiod_remove_lookup_table(broken_irq_dmi_id->driver_data); in bcm_get_resources()
1166 dev_info(dev->dev, "%s: Has a broken IRQ config, disabling IRQ support / runtime-pm\n", in bcm_get_resources()
1167 broken_irq_dmi_id->ident); in bcm_get_resources()
1168 dev->irq = 0; in bcm_get_resources()
1172 dev_dbg(dev->dev, "BCM irq: %d\n", dev->irq); in bcm_get_resources()
1185 dev->gpio_int_idx = -1; in bcm_acpi_probe()
1186 ret = acpi_dev_get_resources(ACPI_COMPANION(dev->dev), in bcm_acpi_probe()
1192 if (resource_type(entry->res) == IORESOURCE_IRQ) { in bcm_acpi_probe()
1193 dev->irq = entry->res->start; in bcm_acpi_probe()
1200 * only 2 GPIO resources, we use the irq-last mapping for this, since in bcm_acpi_probe()
1203 if (dev->irq) in bcm_acpi_probe()
1205 else if (dev->gpio_int_idx == 0) in bcm_acpi_probe()
1207 else if (dev->gpio_int_idx == 2) in bcm_acpi_probe()
1210 dev_warn(dev->dev, "Unexpected ACPI gpio_int_idx: %d\n", in bcm_acpi_probe()
1211 dev->gpio_int_idx); in bcm_acpi_probe()
1214 if (dev->gpio_count != (dev->irq ? 2 : 3)) in bcm_acpi_probe()
1215 dev_warn(dev->dev, "Unexpected number of ACPI GPIOs: %d\n", in bcm_acpi_probe()
1216 dev->gpio_count); in bcm_acpi_probe()
1218 ret = devm_acpi_dev_add_driver_gpios(dev->dev, gpio_mapping); in bcm_acpi_probe()
1222 if (irq_polarity != -1) { in bcm_acpi_probe()
1223 dev->irq_active_low = irq_polarity; in bcm_acpi_probe()
1224 dev_warn(dev->dev, "Overwriting IRQ polarity to active %s by module-param\n", in bcm_acpi_probe()
1225 dev->irq_active_low ? "low" : "high"); in bcm_acpi_probe()
1233 return -EINVAL; in bcm_acpi_probe()
1239 bdev->use_autobaud_mode = device_property_read_bool(bdev->dev, in bcm_of_probe()
1240 "brcm,requires-autobaud-mode"); in bcm_of_probe()
1241 device_property_read_u32(bdev->dev, "max-speed", &bdev->oper_speed); in bcm_of_probe()
1242 device_property_read_u8_array(bdev->dev, "brcm,bt-pcm-int-params", in bcm_of_probe()
1243 bdev->pcm_int_params, 5); in bcm_of_probe()
1244 bdev->irq = of_irq_get_byname(bdev->dev->of_node, "host-wakeup"); in bcm_of_probe()
1245 bdev->irq_active_low = irq_get_trigger_type(bdev->irq) in bcm_of_probe()
1255 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); in bcm_probe()
1257 return -ENOMEM; in bcm_probe()
1259 dev->dev = &pdev->dev; in bcm_probe()
1265 dev->irq = ret; in bcm_probe()
1268 dev->pcm_int_params[0] = 0xff; in bcm_probe()
1270 if (has_acpi_companion(&pdev->dev)) { in bcm_probe()
1282 dev_info(&pdev->dev, "%s device registered.\n", dev->name); in bcm_probe()
1286 list_add_tail(&dev->list, &bcm_device_list); in bcm_probe()
1291 dev_err(&pdev->dev, "Failed to power down\n"); in bcm_probe()
1301 list_del(&dev->list); in bcm_remove()
1304 dev_info(&pdev->dev, "%s device unregistered.\n", dev->name); in bcm_remove()
1524 bcmdev = devm_kzalloc(&serdev->dev, sizeof(*bcmdev), GFP_KERNEL); in bcm_serdev_probe()
1526 return -ENOMEM; in bcm_serdev_probe()
1528 bcmdev->dev = &serdev->dev; in bcm_serdev_probe()
1530 bcmdev->hu = &bcmdev->serdev_hu; in bcm_serdev_probe()
1532 bcmdev->serdev_hu.serdev = serdev; in bcm_serdev_probe()
1536 bcmdev->pcm_int_params[0] = 0xff; in bcm_serdev_probe()
1538 if (has_acpi_companion(&serdev->dev)) in bcm_serdev_probe()
1549 if (!bcmdev->shutdown) { in bcm_serdev_probe()
1550 dev_warn(&serdev->dev, in bcm_serdev_probe()
1552 bcmdev->oper_speed = bcmdev->init_speed; in bcm_serdev_probe()
1557 dev_err(&serdev->dev, "Failed to power down\n"); in bcm_serdev_probe()
1559 data = device_get_match_data(bcmdev->dev); in bcm_serdev_probe()
1561 bcmdev->max_autobaud_speed = data->max_autobaud_speed; in bcm_serdev_probe()
1562 bcmdev->no_early_set_baudrate = data->no_early_set_baudrate; in bcm_serdev_probe()
1563 bcmdev->drive_rts_on_open = data->drive_rts_on_open; in bcm_serdev_probe()
1564 bcmdev->no_uart_clock_set = data->no_uart_clock_set; in bcm_serdev_probe()
1565 if (data->max_speed && bcmdev->oper_speed > data->max_speed) in bcm_serdev_probe()
1566 bcmdev->oper_speed = data->max_speed; in bcm_serdev_probe()
1569 return hci_uart_register_device(&bcmdev->serdev_hu, &bcm_proto); in bcm_serdev_probe()
1576 hci_uart_unregister_device(&bcmdev->serdev_hu); in bcm_serdev_remove()
1598 { .compatible = "brcm,bcm4329-bt" },
1599 { .compatible = "brcm,bcm4330-bt" },
1600 { .compatible = "brcm,bcm4334-bt" },
1602 { .compatible = "brcm,bcm43430a0-bt" },
1603 { .compatible = "brcm,bcm43430a1-bt" },
1604 { .compatible = "brcm,bcm43438-bt", .data = &bcm43438_device_data },
1605 { .compatible = "brcm,bcm4349-bt", .data = &bcm43438_device_data },
1606 { .compatible = "brcm,bcm43540-bt", .data = &bcm4354_device_data },
1608 { .compatible = "cypress,cyw4373a0-bt", .data = &cyw4373a0_device_data },
1609 { .compatible = "infineon,cyw55572-bt", .data = &cyw55572_device_data },