btdev             164 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = data;
btdev             165 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             166 drivers/bluetooth/hci_nokia.c 	int wake_state = gpiod_get_value(btdev->wakeup_host);
btdev             168 drivers/bluetooth/hci_nokia.c 	if (btdev->rx_enabled == wake_state)
btdev             176 drivers/bluetooth/hci_nokia.c 	btdev->rx_enabled = wake_state;
btdev             183 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             184 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             188 drivers/bluetooth/hci_nokia.c 	gpiod_set_value_cansleep(btdev->reset, 1);
btdev             189 drivers/bluetooth/hci_nokia.c 	gpiod_set_value_cansleep(btdev->wakeup_bt, 1);
btdev             194 drivers/bluetooth/hci_nokia.c 	err = gpiod_get_value_cansleep(btdev->wakeup_host);
btdev             201 drivers/bluetooth/hci_nokia.c 	serdev_device_write_flush(btdev->serdev);
btdev             204 drivers/bluetooth/hci_nokia.c 	nokia_flow_control(btdev->serdev, false);
btdev             205 drivers/bluetooth/hci_nokia.c 	serdev_device_set_baudrate(btdev->serdev, INIT_BAUD_RATE);
btdev             207 drivers/bluetooth/hci_nokia.c 	gpiod_set_value_cansleep(btdev->reset, 0);
btdev             210 drivers/bluetooth/hci_nokia.c 	err = serdev_device_wait_for_cts(btdev->serdev, true, 200);
btdev             216 drivers/bluetooth/hci_nokia.c 	nokia_flow_control(btdev->serdev, true);
btdev             223 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             224 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             230 drivers/bluetooth/hci_nokia.c 	init_completion(&btdev->init_completion);
btdev             250 drivers/bluetooth/hci_nokia.c 	if (!wait_for_completion_interruptible_timeout(&btdev->init_completion,
btdev             255 drivers/bluetooth/hci_nokia.c 	if (btdev->init_error < 0)
btdev             256 drivers/bluetooth/hci_nokia.c 		return btdev->init_error;
btdev             263 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             264 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             269 drivers/bluetooth/hci_nokia.c 	u16 baud = DIV_ROUND_CLOSEST(btdev->sysclk_speed * 10, SETUP_BAUD_RATE);
btdev             270 drivers/bluetooth/hci_nokia.c 	int sysclk = btdev->sysclk_speed / 1000;
btdev             290 drivers/bluetooth/hci_nokia.c 	btdev->init_error = 0;
btdev             291 drivers/bluetooth/hci_nokia.c 	init_completion(&btdev->init_completion);
btdev             298 drivers/bluetooth/hci_nokia.c 	if (!wait_for_completion_interruptible_timeout(&btdev->init_completion,
btdev             303 drivers/bluetooth/hci_nokia.c 	if (btdev->init_error < 0)
btdev             304 drivers/bluetooth/hci_nokia.c 		return btdev->init_error;
btdev             310 drivers/bluetooth/hci_nokia.c 	nokia_flow_control(btdev->serdev, false);
btdev             311 drivers/bluetooth/hci_nokia.c 	serdev_device_set_baudrate(btdev->serdev, SETUP_BAUD_RATE);
btdev             312 drivers/bluetooth/hci_nokia.c 	err = serdev_device_wait_for_cts(btdev->serdev, true, 200);
btdev             317 drivers/bluetooth/hci_nokia.c 	nokia_flow_control(btdev->serdev, true);
btdev             326 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             327 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             336 drivers/bluetooth/hci_nokia.c 	if (btdev->man_id == NOKIA_ID_BCM2048) {
btdev             338 drivers/bluetooth/hci_nokia.c 	} else if (btdev->man_id == NOKIA_ID_TI1271) {
btdev             395 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             396 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             399 drivers/bluetooth/hci_nokia.c 	btdev->initialized = false;
btdev             401 drivers/bluetooth/hci_nokia.c 	nokia_flow_control(btdev->serdev, false);
btdev             405 drivers/bluetooth/hci_nokia.c 	if (btdev->tx_enabled) {
btdev             406 drivers/bluetooth/hci_nokia.c 		gpiod_set_value_cansleep(btdev->wakeup_bt, 0);
btdev             407 drivers/bluetooth/hci_nokia.c 		pm_runtime_put(&btdev->serdev->dev);
btdev             408 drivers/bluetooth/hci_nokia.c 		btdev->tx_enabled = false;
btdev             441 drivers/bluetooth/hci_nokia.c 	nokia_flow_control(btdev->serdev, false);
btdev             442 drivers/bluetooth/hci_nokia.c 	serdev_device_set_baudrate(btdev->serdev, MAX_BAUD_RATE);
btdev             443 drivers/bluetooth/hci_nokia.c 	nokia_flow_control(btdev->serdev, true);
btdev             445 drivers/bluetooth/hci_nokia.c 	if (btdev->man_id == NOKIA_ID_BCM2048) {
btdev             453 drivers/bluetooth/hci_nokia.c 	gpiod_set_value_cansleep(btdev->wakeup_bt, 0);
btdev             455 drivers/bluetooth/hci_nokia.c 	btdev->tx_enabled = false;
btdev             456 drivers/bluetooth/hci_nokia.c 	btdev->initialized = true;
btdev             478 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             480 drivers/bluetooth/hci_nokia.c 	dev_dbg(&btdev->serdev->dev, "flush device");
btdev             482 drivers/bluetooth/hci_nokia.c 	skb_queue_purge(&btdev->txq);
btdev             489 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             490 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             494 drivers/bluetooth/hci_nokia.c 	btdev->initialized = false;
btdev             496 drivers/bluetooth/hci_nokia.c 	skb_queue_purge(&btdev->txq);
btdev             498 drivers/bluetooth/hci_nokia.c 	kfree_skb(btdev->rx_skb);
btdev             501 drivers/bluetooth/hci_nokia.c 	gpiod_set_value(btdev->reset, 1);
btdev             502 drivers/bluetooth/hci_nokia.c 	gpiod_set_value(btdev->wakeup_bt, 0);
btdev             504 drivers/bluetooth/hci_nokia.c 	pm_runtime_disable(&btdev->serdev->dev);
btdev             512 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             526 drivers/bluetooth/hci_nokia.c 	skb_queue_tail(&btdev->txq, skb);
btdev             535 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             536 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             543 drivers/bluetooth/hci_nokia.c 		btdev->init_error = -EIO;
btdev             552 drivers/bluetooth/hci_nokia.c 		btdev->init_error = -EINVAL;
btdev             557 drivers/bluetooth/hci_nokia.c 	btdev->man_id = evt->man_id;
btdev             558 drivers/bluetooth/hci_nokia.c 	btdev->ver_id = evt->ver_id;
btdev             564 drivers/bluetooth/hci_nokia.c 	complete(&btdev->init_completion);
btdev             572 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             573 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             581 drivers/bluetooth/hci_nokia.c 		btdev->init_error = -EIO;
btdev             591 drivers/bluetooth/hci_nokia.c 		btdev->init_error = -EINVAL;
btdev             599 drivers/bluetooth/hci_nokia.c 	complete(&btdev->init_completion);
btdev             625 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             626 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             632 drivers/bluetooth/hci_nokia.c 	btdev->rx_skb = h4_recv_buf(hu->hdev, btdev->rx_skb, data, count,
btdev             634 drivers/bluetooth/hci_nokia.c 	if (IS_ERR(btdev->rx_skb)) {
btdev             635 drivers/bluetooth/hci_nokia.c 		err = PTR_ERR(btdev->rx_skb);
btdev             637 drivers/bluetooth/hci_nokia.c 		btdev->rx_skb = NULL;
btdev             646 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = hu->priv;
btdev             647 drivers/bluetooth/hci_nokia.c 	struct device *dev = &btdev->serdev->dev;
btdev             648 drivers/bluetooth/hci_nokia.c 	struct sk_buff *result = skb_dequeue(&btdev->txq);
btdev             650 drivers/bluetooth/hci_nokia.c 	if (!btdev->initialized)
btdev             653 drivers/bluetooth/hci_nokia.c 	if (btdev->tx_enabled == !!result)
btdev             658 drivers/bluetooth/hci_nokia.c 		gpiod_set_value_cansleep(btdev->wakeup_bt, 1);
btdev             660 drivers/bluetooth/hci_nokia.c 		serdev_device_wait_until_sent(btdev->serdev, 0);
btdev             661 drivers/bluetooth/hci_nokia.c 		gpiod_set_value_cansleep(btdev->wakeup_bt, 0);
btdev             665 drivers/bluetooth/hci_nokia.c 	btdev->tx_enabled = !!result;
btdev             686 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev;
btdev             690 drivers/bluetooth/hci_nokia.c 	btdev = devm_kzalloc(dev, sizeof(*btdev), GFP_KERNEL);
btdev             691 drivers/bluetooth/hci_nokia.c 	if (!btdev)
btdev             694 drivers/bluetooth/hci_nokia.c 	btdev->hu.serdev = btdev->serdev = serdev;
btdev             695 drivers/bluetooth/hci_nokia.c 	serdev_device_set_drvdata(serdev, btdev);
btdev             697 drivers/bluetooth/hci_nokia.c 	btdev->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
btdev             698 drivers/bluetooth/hci_nokia.c 	if (IS_ERR(btdev->reset)) {
btdev             699 drivers/bluetooth/hci_nokia.c 		err = PTR_ERR(btdev->reset);
btdev             704 drivers/bluetooth/hci_nokia.c 	btdev->wakeup_host = devm_gpiod_get(dev, "host-wakeup", GPIOD_IN);
btdev             705 drivers/bluetooth/hci_nokia.c 	if (IS_ERR(btdev->wakeup_host)) {
btdev             706 drivers/bluetooth/hci_nokia.c 		err = PTR_ERR(btdev->wakeup_host);
btdev             711 drivers/bluetooth/hci_nokia.c 	btdev->wake_irq = gpiod_to_irq(btdev->wakeup_host);
btdev             713 drivers/bluetooth/hci_nokia.c 	err = devm_request_threaded_irq(dev, btdev->wake_irq, NULL,
btdev             716 drivers/bluetooth/hci_nokia.c 		"wakeup", btdev);
btdev             722 drivers/bluetooth/hci_nokia.c 	btdev->wakeup_bt = devm_gpiod_get(dev, "bluetooth-wakeup",
btdev             724 drivers/bluetooth/hci_nokia.c 	if (IS_ERR(btdev->wakeup_bt)) {
btdev             725 drivers/bluetooth/hci_nokia.c 		err = PTR_ERR(btdev->wakeup_bt);
btdev             738 drivers/bluetooth/hci_nokia.c 	btdev->sysclk_speed = clk_get_rate(sysclk);
btdev             741 drivers/bluetooth/hci_nokia.c 	skb_queue_head_init(&btdev->txq);
btdev             743 drivers/bluetooth/hci_nokia.c 	btdev->hu.priv = btdev;
btdev             744 drivers/bluetooth/hci_nokia.c 	btdev->hu.alignment = 2; /* Nokia H4+ is word aligned */
btdev             746 drivers/bluetooth/hci_nokia.c 	err = hci_uart_register_device(&btdev->hu, &nokia_proto);
btdev             757 drivers/bluetooth/hci_nokia.c 	struct nokia_bt_dev *btdev = serdev_device_get_drvdata(serdev);
btdev             759 drivers/bluetooth/hci_nokia.c 	hci_uart_unregister_device(&btdev->hu);