Lines Matching refs:channel_id
233 static void gsi_irq_ch_ctrl_enable(struct gsi *gsi, u32 channel_id) in gsi_irq_ch_ctrl_enable() argument
235 u32 val = BIT(channel_id); in gsi_irq_ch_ctrl_enable()
467 u32 channel_id = gsi_channel_id(channel); in gsi_channel_state() local
471 val = ioread32(virt + GSI_CH_C_CNTXT_0_OFFSET(channel_id)); in gsi_channel_state()
480 u32 channel_id = gsi_channel_id(channel); in gsi_channel_command() local
487 gsi_irq_ch_ctrl_enable(gsi, channel_id); in gsi_channel_command()
489 val = u32_encode_bits(channel_id, CH_CHID_FMASK); in gsi_channel_command()
499 opcode, channel_id, gsi_channel_state(channel)); in gsi_channel_command()
503 static int gsi_channel_alloc_command(struct gsi *gsi, u32 channel_id) in gsi_channel_alloc_command() argument
505 struct gsi_channel *channel = &gsi->channel[channel_id]; in gsi_channel_alloc_command()
513 channel_id, state); in gsi_channel_alloc_command()
525 channel_id, state); in gsi_channel_alloc_command()
624 static void gsi_channel_de_alloc_command(struct gsi *gsi, u32 channel_id) in gsi_channel_de_alloc_command() argument
626 struct gsi_channel *channel = &gsi->channel[channel_id]; in gsi_channel_de_alloc_command()
633 channel_id, state); in gsi_channel_de_alloc_command()
644 channel_id, state); in gsi_channel_de_alloc_command()
760 u32 channel_id = gsi_channel_id(channel); in gsi_channel_program() local
773 iowrite32(val, gsi->virt + GSI_CH_C_CNTXT_0_OFFSET(channel_id)); in gsi_channel_program()
776 iowrite32(val, gsi->virt + GSI_CH_C_CNTXT_1_OFFSET(channel_id)); in gsi_channel_program()
783 iowrite32(val, gsi->virt + GSI_CH_C_CNTXT_2_OFFSET(channel_id)); in gsi_channel_program()
785 iowrite32(val, gsi->virt + GSI_CH_C_CNTXT_3_OFFSET(channel_id)); in gsi_channel_program()
813 iowrite32(val, gsi->virt + GSI_CH_C_QOS_OFFSET(channel_id)); in gsi_channel_program()
822 iowrite32(val, gsi->virt + GSI_CH_C_SCRATCH_0_OFFSET(channel_id)); in gsi_channel_program()
825 iowrite32(val, gsi->virt + GSI_CH_C_SCRATCH_1_OFFSET(channel_id)); in gsi_channel_program()
828 iowrite32(val, gsi->virt + GSI_CH_C_SCRATCH_2_OFFSET(channel_id)); in gsi_channel_program()
834 val = ioread32(gsi->virt + GSI_CH_C_SCRATCH_3_OFFSET(channel_id)); in gsi_channel_program()
836 iowrite32(val, gsi->virt + GSI_CH_C_SCRATCH_3_OFFSET(channel_id)); in gsi_channel_program()
860 int gsi_channel_start(struct gsi *gsi, u32 channel_id) in gsi_channel_start() argument
862 struct gsi_channel *channel = &gsi->channel[channel_id]; in gsi_channel_start()
915 int gsi_channel_stop(struct gsi *gsi, u32 channel_id) in gsi_channel_stop() argument
917 struct gsi_channel *channel = &gsi->channel[channel_id]; in gsi_channel_stop()
932 void gsi_channel_reset(struct gsi *gsi, u32 channel_id, bool doorbell) in gsi_channel_reset() argument
934 struct gsi_channel *channel = &gsi->channel[channel_id]; in gsi_channel_reset()
952 int gsi_channel_suspend(struct gsi *gsi, u32 channel_id) in gsi_channel_suspend() argument
954 struct gsi_channel *channel = &gsi->channel[channel_id]; in gsi_channel_suspend()
968 int gsi_channel_resume(struct gsi *gsi, u32 channel_id) in gsi_channel_resume() argument
970 struct gsi_channel *channel = &gsi->channel[channel_id]; in gsi_channel_resume()
989 struct gsi_channel *channel = &trans->gsi->channel[trans->channel_id]; in gsi_trans_tx_committed()
1000 u32 channel_id = trans->channel_id; in gsi_trans_tx_queued() local
1006 channel = &gsi->channel[channel_id]; in gsi_trans_tx_queued()
1013 ipa_gsi_channel_tx_queued(gsi, channel_id, trans_count, byte_count); in gsi_trans_tx_queued()
1033 u32 channel_id = trans->channel_id; in gsi_trans_tx_completed() local
1039 channel = &gsi->channel[channel_id]; in gsi_trans_tx_completed()
1046 ipa_gsi_channel_tx_completed(gsi, channel_id, trans_count, byte_count); in gsi_trans_tx_completed()
1058 u32 channel_id = __ffs(channel_mask); in gsi_isr_chan_ctrl() local
1060 channel_mask ^= BIT(channel_id); in gsi_isr_chan_ctrl()
1085 gsi_isr_glob_chan_err(struct gsi *gsi, u32 err_ee, u32 channel_id, u32 code) in gsi_isr_glob_chan_err() argument
1088 dev_err(gsi->dev, "channel %u out of resources\n", channel_id); in gsi_isr_glob_chan_err()
1095 channel_id, err_ee, code); in gsi_isr_glob_chan_err()
1104 u32 channel_id = gsi_channel_id(evt_ring->channel); in gsi_isr_glob_evt_err() local
1108 channel_id); in gsi_isr_glob_evt_err()
1317 u32 channel_id = event->chid; in gsi_event_trans() local
1323 channel = &gsi->channel[channel_id]; in gsi_event_trans()
1324 if (WARN(!channel->gsi, "event has bad channel %u\n", channel_id)) in gsi_event_trans()
1333 if (WARN(!trans, "channel %u event with no transaction\n", channel_id)) in gsi_event_trans()
1468 u32 channel_id = gsi_channel_id(channel); in gsi_channel_doorbell() local
1474 iowrite32(val, gsi->virt + GSI_CH_C_DOORBELL_0_OFFSET(channel_id)); in gsi_channel_doorbell()
1584 static int gsi_channel_setup_one(struct gsi *gsi, u32 channel_id) in gsi_channel_setup_one() argument
1586 struct gsi_channel *channel = &gsi->channel[channel_id]; in gsi_channel_setup_one()
1599 ret = gsi_channel_alloc_command(gsi, channel_id); in gsi_channel_setup_one()
1622 static void gsi_channel_teardown_one(struct gsi *gsi, u32 channel_id) in gsi_channel_teardown_one() argument
1624 struct gsi_channel *channel = &gsi->channel[channel_id]; in gsi_channel_teardown_one()
1632 gsi_channel_de_alloc_command(gsi, channel_id); in gsi_channel_teardown_one()
1641 static int gsi_generic_command(struct gsi *gsi, u32 channel_id, in gsi_generic_command() argument
1667 val |= u32_encode_bits(channel_id, GENERIC_CHID_FMASK); in gsi_generic_command()
1680 opcode, channel_id); in gsi_generic_command()
1685 static int gsi_modem_channel_alloc(struct gsi *gsi, u32 channel_id) in gsi_modem_channel_alloc() argument
1687 return gsi_generic_command(gsi, channel_id, in gsi_modem_channel_alloc()
1691 static void gsi_modem_channel_halt(struct gsi *gsi, u32 channel_id) in gsi_modem_channel_halt() argument
1697 ret = gsi_generic_command(gsi, channel_id, in gsi_modem_channel_halt()
1703 ret, channel_id); in gsi_modem_channel_halt()
1708 gsi_modem_channel_flow_control(struct gsi *gsi, u32 channel_id, bool enable) in gsi_modem_channel_flow_control() argument
1723 ret = gsi_generic_command(gsi, channel_id, command, 0); in gsi_modem_channel_flow_control()
1729 ret, enable ? "en" : "dis", channel_id); in gsi_modem_channel_flow_control()
1735 u32 channel_id = 0; in gsi_channel_setup() local
1744 ret = gsi_channel_setup_one(gsi, channel_id); in gsi_channel_setup()
1747 } while (++channel_id < gsi->channel_count); in gsi_channel_setup()
1750 while (channel_id < GSI_CHANNEL_COUNT_MAX) { in gsi_channel_setup()
1751 struct gsi_channel *channel = &gsi->channel[channel_id++]; in gsi_channel_setup()
1758 channel_id - 1); in gsi_channel_setup()
1759 channel_id = gsi->channel_count; in gsi_channel_setup()
1784 channel_id = __fls(mask); in gsi_channel_setup()
1786 mask ^= BIT(channel_id); in gsi_channel_setup()
1788 gsi_modem_channel_halt(gsi, channel_id); in gsi_channel_setup()
1792 while (channel_id--) in gsi_channel_setup()
1793 gsi_channel_teardown_one(gsi, channel_id); in gsi_channel_setup()
1806 u32 channel_id; in gsi_channel_teardown() local
1811 channel_id = __fls(mask); in gsi_channel_teardown()
1813 mask ^= BIT(channel_id); in gsi_channel_teardown()
1815 gsi_modem_channel_halt(gsi, channel_id); in gsi_channel_teardown()
1818 channel_id = gsi->channel_count - 1; in gsi_channel_teardown()
1820 gsi_channel_teardown_one(gsi, channel_id); in gsi_channel_teardown()
1821 while (channel_id--); in gsi_channel_teardown()
2001 u32 channel_id = data->channel_id; in gsi_channel_data_valid() local
2005 if (channel_id >= GSI_CHANNEL_COUNT_MAX) { in gsi_channel_data_valid()
2007 channel_id, GSI_CHANNEL_COUNT_MAX); in gsi_channel_data_valid()
2017 dev_err(dev, "command channel %u is not TX\n", channel_id); in gsi_channel_data_valid()
2026 channel_id, channel_data->tlv_count, GSI_TLV_MAX); in gsi_channel_data_valid()
2032 channel_id, IPA_COMMAND_TRANS_TRE_MAX, in gsi_channel_data_valid()
2044 channel_id, channel_data->tlv_count, in gsi_channel_data_valid()
2051 channel_id, channel_data->tre_count); in gsi_channel_data_valid()
2057 channel_id, channel_data->event_count); in gsi_channel_data_valid()
2080 data->channel_id, tre_count); in gsi_channel_init_one()
2085 channel = &gsi->channel[data->channel_id]; in gsi_channel_init_one()
2102 ret, data->channel_id); in gsi_channel_init_one()
2106 ret = gsi_channel_trans_init(gsi, data->channel_id); in gsi_channel_init_one()
2111 u32 tre_max = gsi_channel_tre_max(gsi, data->channel_id); in gsi_channel_init_one()
2167 BIT(data[i].channel_id); in gsi_channel_init()
2183 gsi->modem_channel_bitmap &= ~BIT(data[i].channel_id); in gsi_channel_init()
2186 gsi_channel_exit_one(&gsi->channel[data->channel_id]); in gsi_channel_init()
2195 u32 channel_id = GSI_CHANNEL_COUNT_MAX - 1; in gsi_channel_exit() local
2198 gsi_channel_exit_one(&gsi->channel[channel_id]); in gsi_channel_exit()
2199 while (channel_id--); in gsi_channel_exit()
2301 u32 gsi_channel_tre_max(struct gsi *gsi, u32 channel_id) in gsi_channel_tre_max() argument
2303 struct gsi_channel *channel = &gsi->channel[channel_id]; in gsi_channel_tre_max()