• Home
  • Raw
  • Download

Lines Matching refs:rx

136 	struct mtk_btcvsd_snd_stream *rx;  member
212 bt->tx->state, bt->rx->state, bt->irq_disabled); in mtk_btcvsd_snd_set_state()
217 bt->rx->state == BT_SCO_STATE_IDLE) { in mtk_btcvsd_snd_set_state()
247 memset(bt->rx, 0, sizeof(*bt->rx)); in mtk_btcvsd_snd_rx_init()
250 bt->rx->packet_size = BTCVSD_RX_PACKET_SIZE; in mtk_btcvsd_snd_rx_init()
251 bt->rx->buf_size = BTCVSD_RX_BUF_SIZE; in mtk_btcvsd_snd_rx_init()
252 bt->rx->timeout = 0; in mtk_btcvsd_snd_rx_init()
253 bt->rx->rw_cnt = 0; in mtk_btcvsd_snd_rx_init()
254 bt->rx->stream = SNDRV_PCM_STREAM_CAPTURE; in mtk_btcvsd_snd_rx_init()
268 ts->time_stamp_us = bt->rx->time_stamp; in get_rx_time_stamp()
269 ts->data_count_equi_time = bt->rx->buf_data_equivalent_time; in get_rx_time_stamp()
385 bt->rx->temp_packet_buf, packet_length, in mtk_btcvsd_read_from_bt()
390 packet_buf_ofs = (bt->rx->packet_w & SCO_RX_PACKET_MASK) * in mtk_btcvsd_read_from_bt()
391 bt->rx->packet_size; in mtk_btcvsd_read_from_bt()
393 bt->rx->temp_packet_buf + (SCO_RX_PLC_SIZE * i), in mtk_btcvsd_read_from_bt()
404 bt->rx->packet_w++; in mtk_btcvsd_read_from_bt()
487 if (bt->rx->state != BT_SCO_STATE_RUNNING && in mtk_btcvsd_snd_irq_handler()
488 bt->rx->state != BT_SCO_STATE_ENDING && in mtk_btcvsd_snd_irq_handler()
493 __func__, bt->rx->state, bt->tx->state); in mtk_btcvsd_snd_irq_handler()
549 bt->rx->rw_cnt++; in mtk_btcvsd_snd_irq_handler()
553 if (bt->rx->state == BT_SCO_STATE_RUNNING || in mtk_btcvsd_snd_irq_handler()
554 bt->rx->state == BT_SCO_STATE_ENDING) { in mtk_btcvsd_snd_irq_handler()
555 if (bt->rx->xrun) { in mtk_btcvsd_snd_irq_handler()
556 if (bt->rx->packet_w - bt->rx->packet_r <= in mtk_btcvsd_snd_irq_handler()
562 bt->rx->xrun = 0; in mtk_btcvsd_snd_irq_handler()
568 if (!bt->rx->xrun && in mtk_btcvsd_snd_irq_handler()
569 (bt->rx->packet_w - bt->rx->packet_r <= in mtk_btcvsd_snd_irq_handler()
577 bt->rx->rw_cnt++; in mtk_btcvsd_snd_irq_handler()
579 bt->rx->xrun = 1; in mtk_btcvsd_snd_irq_handler()
618 if (bt->rx->state == BT_SCO_STATE_RUNNING || in mtk_btcvsd_snd_irq_handler()
619 bt->rx->state == BT_SCO_STATE_ENDING) { in mtk_btcvsd_snd_irq_handler()
620 bt->rx->wait_flag = 1; in mtk_btcvsd_snd_irq_handler()
622 snd_pcm_period_elapsed(bt->rx->substream); in mtk_btcvsd_snd_irq_handler()
706 unsigned int packet_size = bt->rx->packet_size; in mtk_btcvsd_snd_read()
711 avail = (bt->rx->packet_w - bt->rx->packet_r) * packet_size; in mtk_btcvsd_snd_read()
713 cur_read_idx = (bt->rx->packet_r & SCO_RX_PACKET_MASK) * in mtk_btcvsd_snd_read()
718 int ret = wait_for_bt_irq(bt, bt->rx); in mtk_btcvsd_snd_read()
742 cont = bt->rx->buf_size - cur_read_idx; in mtk_btcvsd_snd_read()
755 bt->rx->packet_r += read_size / packet_size; in mtk_btcvsd_snd_read()
767 bt->rx->time_stamp = sched_clock(); in mtk_btcvsd_snd_read()
768 bt->rx->buf_data_equivalent_time = in mtk_btcvsd_snd_read()
769 (unsigned long long)(bt->rx->packet_w - bt->rx->packet_r) * in mtk_btcvsd_snd_read()
771 bt->rx->buf_data_equivalent_time += read_count * SCO_RX_PLC_SIZE * in mtk_btcvsd_snd_read()
774 bt->rx->buf_data_equivalent_time *= 1000; in mtk_btcvsd_snd_read()
863 return bt->rx; in get_bt_stream()
894 bt->rx->substream = substream; in mtk_pcm_btcvsd_open()
1002 bt_stream = bt->rx; in mtk_pcm_btcvsd_pointer()
1007 bt->tx->packet_r : bt->rx->packet_w; in mtk_pcm_btcvsd_pointer()
1097 mtk_btcvsd_snd_set_state(bt, bt->rx, BT_SCO_STATE_LOOPBACK); in btcvsd_loopback_set()
1100 mtk_btcvsd_snd_set_state(bt, bt->rx, BT_SCO_STATE_RUNNING); in btcvsd_loopback_set()
1139 if (!bt->rx) in btcvsd_rx_irq_received_get()
1142 ucontrol->value.integer.value[0] = bt->rx->rw_cnt ? 1 : 0; in btcvsd_rx_irq_received_get()
1152 if (!bt->rx) in btcvsd_rx_timeout_get()
1155 ucontrol->value.integer.value[0] = bt->rx->timeout; in btcvsd_rx_timeout_get()
1156 bt->rx->timeout = 0; in btcvsd_rx_timeout_get()
1296 btcvsd->rx = devm_kzalloc(btcvsd->dev, sizeof(*btcvsd->rx), GFP_KERNEL); in mtk_btcvsd_snd_probe()
1297 if (!btcvsd->rx) in mtk_btcvsd_snd_probe()
1374 mtk_btcvsd_snd_set_state(btcvsd, btcvsd->rx, BT_SCO_STATE_IDLE); in mtk_btcvsd_snd_probe()