Lines Matching refs:channel
221 static int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
644 static void print_irq_status_vc(int channel, u32 status) in print_irq_status_vc() argument
655 channel, in print_irq_status_vc()
1049 static int dsi_register_isr_vc(struct platform_device *dsidev, int channel, in dsi_register_isr_vc() argument
1059 dsi->isr_tables.isr_table_vc[channel], in dsi_register_isr_vc()
1060 ARRAY_SIZE(dsi->isr_tables.isr_table_vc[channel])); in dsi_register_isr_vc()
1063 _omap_dsi_set_irqs_vc(dsidev, channel); in dsi_register_isr_vc()
1070 static int dsi_unregister_isr_vc(struct platform_device *dsidev, int channel, in dsi_unregister_isr_vc() argument
1080 dsi->isr_tables.isr_table_vc[channel], in dsi_unregister_isr_vc()
1081 ARRAY_SIZE(dsi->isr_tables.isr_table_vc[channel])); in dsi_unregister_isr_vc()
1084 _omap_dsi_set_irqs_vc(dsidev, channel); in dsi_unregister_isr_vc()
2290 static bool dsi_vc_is_enabled(struct platform_device *dsidev, int channel) in dsi_vc_is_enabled() argument
2292 return REG_GET(dsidev, DSI_VC_CTRL(channel), 0, 0); in dsi_vc_is_enabled()
2300 const int channel = dsi->update_channel; in dsi_packet_sent_handler_vp() local
2303 if (REG_GET(vp_data->dsidev, DSI_VC_TE(channel), bit, bit) == 0) in dsi_packet_sent_handler_vp()
2307 static int dsi_sync_vc_vp(struct platform_device *dsidev, int channel) in dsi_sync_vc_vp() argument
2320 r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp, in dsi_sync_vc_vp()
2326 if (REG_GET(dsidev, DSI_VC_TE(channel), bit, bit)) { in dsi_sync_vc_vp()
2335 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp, in dsi_sync_vc_vp()
2340 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp, in dsi_sync_vc_vp()
2351 const int channel = dsi->update_channel; in dsi_packet_sent_handler_l4() local
2353 if (REG_GET(l4_data->dsidev, DSI_VC_CTRL(channel), 5, 5) == 0) in dsi_packet_sent_handler_l4()
2357 static int dsi_sync_vc_l4(struct platform_device *dsidev, int channel) in dsi_sync_vc_l4() argument
2366 r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, in dsi_sync_vc_l4()
2372 if (REG_GET(dsidev, DSI_VC_CTRL(channel), 5, 5)) { in dsi_sync_vc_l4()
2381 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, in dsi_sync_vc_l4()
2386 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, in dsi_sync_vc_l4()
2392 static int dsi_sync_vc(struct platform_device *dsidev, int channel) in dsi_sync_vc() argument
2400 if (!dsi_vc_is_enabled(dsidev, channel)) in dsi_sync_vc()
2403 switch (dsi->vc[channel].source) { in dsi_sync_vc()
2405 return dsi_sync_vc_vp(dsidev, channel); in dsi_sync_vc()
2407 return dsi_sync_vc_l4(dsidev, channel); in dsi_sync_vc()
2414 static int dsi_vc_enable(struct platform_device *dsidev, int channel, in dsi_vc_enable() argument
2418 channel, enable); in dsi_vc_enable()
2422 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), enable, 0, 0); in dsi_vc_enable()
2424 if (wait_for_bit_change(dsidev, DSI_VC_CTRL(channel), in dsi_vc_enable()
2433 static void dsi_vc_initial_config(struct platform_device *dsidev, int channel) in dsi_vc_initial_config() argument
2438 DSSDBG("Initial config of virtual channel %d", channel); in dsi_vc_initial_config()
2440 r = dsi_read_reg(dsidev, DSI_VC_CTRL(channel)); in dsi_vc_initial_config()
2444 channel); in dsi_vc_initial_config()
2459 dsi_write_reg(dsidev, DSI_VC_CTRL(channel), r); in dsi_vc_initial_config()
2461 dsi->vc[channel].source = DSI_VC_SOURCE_L4; in dsi_vc_initial_config()
2464 static int dsi_vc_config_source(struct platform_device *dsidev, int channel, in dsi_vc_config_source() argument
2469 if (dsi->vc[channel].source == source) in dsi_vc_config_source()
2472 DSSDBG("Source config of virtual channel %d", channel); in dsi_vc_config_source()
2474 dsi_sync_vc(dsidev, channel); in dsi_vc_config_source()
2476 dsi_vc_enable(dsidev, channel, 0); in dsi_vc_config_source()
2479 if (wait_for_bit_change(dsidev, DSI_VC_CTRL(channel), 15, 0) != 0) { in dsi_vc_config_source()
2480 DSSERR("vc(%d) busy when trying to config for VP\n", channel); in dsi_vc_config_source()
2485 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), source, 1, 1); in dsi_vc_config_source()
2490 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), enable, 30, 30); in dsi_vc_config_source()
2493 dsi_vc_enable(dsidev, channel, 1); in dsi_vc_config_source()
2495 dsi->vc[channel].source = source; in dsi_vc_config_source()
2500 static void dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, in dsi_vc_enable_hs() argument
2506 DSSDBG("dsi_vc_enable_hs(%d, %d)\n", channel, enable); in dsi_vc_enable_hs()
2510 dsi_vc_enable(dsidev, channel, 0); in dsi_vc_enable_hs()
2513 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), enable, 9, 9); in dsi_vc_enable_hs()
2515 dsi_vc_enable(dsidev, channel, 1); in dsi_vc_enable_hs()
2522 dsi_vc_send_null(dssdev, channel); in dsi_vc_enable_hs()
2525 static void dsi_vc_flush_long_data(struct platform_device *dsidev, int channel) in dsi_vc_flush_long_data() argument
2527 while (REG_GET(dsidev, DSI_VC_CTRL(channel), 20, 20)) { in dsi_vc_flush_long_data()
2529 val = dsi_read_reg(dsidev, DSI_VC_SHORT_PACKET_HEADER(channel)); in dsi_vc_flush_long_data()
2576 int channel) in dsi_vc_flush_receive_data() argument
2579 while (REG_GET(dsidev, DSI_VC_CTRL(channel), 20, 20)) { in dsi_vc_flush_receive_data()
2582 val = dsi_read_reg(dsidev, DSI_VC_SHORT_PACKET_HEADER(channel)); in dsi_vc_flush_receive_data()
2597 dsi_vc_flush_long_data(dsidev, channel); in dsi_vc_flush_receive_data()
2605 static int dsi_vc_send_bta(struct platform_device *dsidev, int channel) in dsi_vc_send_bta() argument
2610 DSSDBG("dsi_vc_send_bta %d\n", channel); in dsi_vc_send_bta()
2615 if (REG_GET(dsidev, DSI_VC_CTRL(channel), 20, 20)) { in dsi_vc_send_bta()
2617 dsi_vc_flush_receive_data(dsidev, channel); in dsi_vc_send_bta()
2620 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 1, 6, 6); /* BTA_EN */ in dsi_vc_send_bta()
2623 dsi_read_reg(dsidev, DSI_VC_CTRL(channel)); in dsi_vc_send_bta()
2628 static int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel) in dsi_vc_send_bta_sync() argument
2635 r = dsi_register_isr_vc(dsidev, channel, dsi_completion_handler, in dsi_vc_send_bta_sync()
2645 r = dsi_vc_send_bta(dsidev, channel); in dsi_vc_send_bta_sync()
2666 dsi_unregister_isr_vc(dsidev, channel, dsi_completion_handler, in dsi_vc_send_bta_sync()
2673 int channel, u8 data_type, u16 len, u8 ecc) in dsi_vc_write_long_header() argument
2681 data_id = data_type | dsi->vc[channel].vc_id << 6; in dsi_vc_write_long_header()
2686 dsi_write_reg(dsidev, DSI_VC_LONG_PACKET_HEADER(channel), val); in dsi_vc_write_long_header()
2690 int channel, u8 b1, u8 b2, u8 b3, u8 b4) in dsi_vc_write_long_payload() argument
2699 dsi_write_reg(dsidev, DSI_VC_LONG_PACKET_PAYLOAD(channel), val); in dsi_vc_write_long_payload()
2702 static int dsi_vc_send_long(struct platform_device *dsidev, int channel, in dsi_vc_send_long() argument
2716 if (dsi->vc[channel].tx_fifo_size * 32 * 4 < len + 4) { in dsi_vc_send_long()
2721 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_L4); in dsi_vc_send_long()
2723 dsi_vc_write_long_header(dsidev, channel, data_type, len, ecc); in dsi_vc_send_long()
2735 dsi_vc_write_long_payload(dsidev, channel, b1, b2, b3, b4); in dsi_vc_send_long()
2760 dsi_vc_write_long_payload(dsidev, channel, b1, b2, b3, 0); in dsi_vc_send_long()
2766 static int dsi_vc_send_short(struct platform_device *dsidev, int channel, in dsi_vc_send_short() argument
2777 channel, in dsi_vc_send_short()
2780 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_L4); in dsi_vc_send_short()
2782 if (FLD_GET(dsi_read_reg(dsidev, DSI_VC_CTRL(channel)), 16, 16)) { in dsi_vc_send_short()
2787 data_id = data_type | dsi->vc[channel].vc_id << 6; in dsi_vc_send_short()
2791 dsi_write_reg(dsidev, DSI_VC_SHORT_PACKET_HEADER(channel), r); in dsi_vc_send_short()
2796 static int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel) in dsi_vc_send_null() argument
2800 return dsi_vc_send_long(dsidev, channel, MIPI_DSI_NULL_PACKET, NULL, in dsi_vc_send_null()
2805 int channel, u8 *data, int len, enum dss_dsi_content_type type) in dsi_vc_write_nosync_common() argument
2811 r = dsi_vc_send_short(dsidev, channel, in dsi_vc_write_nosync_common()
2814 r = dsi_vc_send_short(dsidev, channel, in dsi_vc_write_nosync_common()
2819 r = dsi_vc_send_short(dsidev, channel, in dsi_vc_write_nosync_common()
2825 r = dsi_vc_send_long(dsidev, channel, in dsi_vc_write_nosync_common()
2834 static int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, in dsi_vc_dcs_write_nosync() argument
2839 return dsi_vc_write_nosync_common(dsidev, channel, data, len, in dsi_vc_dcs_write_nosync()
2843 static int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel, in dsi_vc_generic_write_nosync() argument
2848 return dsi_vc_write_nosync_common(dsidev, channel, data, len, in dsi_vc_generic_write_nosync()
2852 static int dsi_vc_write_common(struct omap_dss_device *dssdev, int channel, in dsi_vc_write_common() argument
2858 r = dsi_vc_write_nosync_common(dsidev, channel, data, len, type); in dsi_vc_write_common()
2862 r = dsi_vc_send_bta_sync(dssdev, channel); in dsi_vc_write_common()
2867 if (REG_GET(dsidev, DSI_VC_CTRL(channel), 20, 20)) { in dsi_vc_write_common()
2869 dsi_vc_flush_receive_data(dsidev, channel); in dsi_vc_write_common()
2877 channel, data[0], len); in dsi_vc_write_common()
2881 static int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, in dsi_vc_dcs_write() argument
2884 return dsi_vc_write_common(dssdev, channel, data, len, in dsi_vc_dcs_write()
2888 static int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data, in dsi_vc_generic_write() argument
2891 return dsi_vc_write_common(dssdev, channel, data, len, in dsi_vc_generic_write()
2896 int channel, u8 dcs_cmd) in dsi_vc_dcs_send_read_request() argument
2903 channel, dcs_cmd); in dsi_vc_dcs_send_read_request()
2905 r = dsi_vc_send_short(dsidev, channel, MIPI_DSI_DCS_READ, dcs_cmd, 0); in dsi_vc_dcs_send_read_request()
2908 " failed\n", channel, dcs_cmd); in dsi_vc_dcs_send_read_request()
2916 int channel, u8 *reqdata, int reqlen) in dsi_vc_generic_send_read_request() argument
2925 channel, reqlen); in dsi_vc_generic_send_read_request()
2941 r = dsi_vc_send_short(dsidev, channel, data_type, data, 0); in dsi_vc_generic_send_read_request()
2944 " failed\n", channel, reqlen); in dsi_vc_generic_send_read_request()
2951 static int dsi_vc_read_rx_fifo(struct platform_device *dsidev, int channel, in dsi_vc_read_rx_fifo() argument
2960 if (REG_GET(dsidev, DSI_VC_CTRL(channel), 20, 20) == 0) { in dsi_vc_read_rx_fifo()
2966 val = dsi_read_reg(dsidev, DSI_VC_SHORT_PACKET_HEADER(channel)); in dsi_vc_read_rx_fifo()
3030 DSI_VC_SHORT_PACKET_HEADER(channel)); in dsi_vc_read_rx_fifo()
3054 DSSERR("dsi_vc_read_rx_fifo(ch %d type %s) failed\n", channel, in dsi_vc_read_rx_fifo()
3060 static int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, in dsi_vc_dcs_read() argument
3066 r = dsi_vc_dcs_send_read_request(dsidev, channel, dcs_cmd); in dsi_vc_dcs_read()
3070 r = dsi_vc_send_bta_sync(dssdev, channel); in dsi_vc_dcs_read()
3074 r = dsi_vc_read_rx_fifo(dsidev, channel, buf, buflen, in dsi_vc_dcs_read()
3086 DSSERR("dsi_vc_dcs_read(ch %d, cmd 0x%02x) failed\n", channel, dcs_cmd); in dsi_vc_dcs_read()
3090 static int dsi_vc_generic_read(struct omap_dss_device *dssdev, int channel, in dsi_vc_generic_read() argument
3096 r = dsi_vc_generic_send_read_request(dsidev, channel, reqdata, reqlen); in dsi_vc_generic_read()
3100 r = dsi_vc_send_bta_sync(dssdev, channel); in dsi_vc_generic_read()
3104 r = dsi_vc_read_rx_fifo(dsidev, channel, buf, buflen, in dsi_vc_generic_read()
3117 static int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel, in dsi_vc_set_max_rx_packet_size() argument
3122 return dsi_vc_send_short(dsidev, channel, in dsi_vc_set_max_rx_packet_size()
3825 static int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) in dsi_enable_video_output() argument
3865 dsi_vc_enable(dsidev, channel, false); in dsi_enable_video_output()
3868 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 1, 4, 4); in dsi_enable_video_output()
3872 dsi_vc_write_long_header(dsidev, channel, data_type, in dsi_enable_video_output()
3875 dsi_vc_enable(dsidev, channel, true); in dsi_enable_video_output()
3888 dsi_vc_enable(dsidev, channel, false); in dsi_enable_video_output()
3896 static void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel) in dsi_disable_video_output() argument
3904 dsi_vc_enable(dsidev, channel, false); in dsi_disable_video_output()
3907 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 0, 4, 4); in dsi_disable_video_output()
3909 dsi_vc_enable(dsidev, channel, true); in dsi_disable_video_output()
3930 const unsigned channel = dsi->update_channel; in dsi_update_screen_dispc() local
3937 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_VP); in dsi_update_screen_dispc()
3958 dsi_write_reg(dsidev, DSI_VC_TE(channel), l); in dsi_update_screen_dispc()
3960 dsi_vc_write_long_header(dsidev, channel, MIPI_DSI_DCS_LONG_WRITE, in dsi_update_screen_dispc()
3967 dsi_write_reg(dsidev, DSI_VC_TE(channel), l); in dsi_update_screen_dispc()
3992 dsi_vc_send_bta(dsidev, channel); in dsi_update_screen_dispc()
4056 static int dsi_update(struct omap_dss_device *dssdev, int channel, in dsi_update() argument
4065 dsi->update_channel = channel; in dsi_update()
4909 static int dsi_request_vc(struct omap_dss_device *dssdev, int *channel) in dsi_request_vc() argument
4918 *channel = i; in dsi_request_vc()
4927 static int dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id) in dsi_set_vc_id() argument
4937 if (channel < 0 || channel > 3) { in dsi_set_vc_id()
4942 if (dsi->vc[channel].dssdev != dssdev) { in dsi_set_vc_id()
4948 dsi->vc[channel].vc_id = vc_id; in dsi_set_vc_id()
4953 static void dsi_release_vc(struct omap_dss_device *dssdev, int channel) in dsi_release_vc() argument
4958 if ((channel >= 0 && channel <= 3) && in dsi_release_vc()
4959 dsi->vc[channel].dssdev == dssdev) { in dsi_release_vc()
4960 dsi->vc[channel].dssdev = NULL; in dsi_release_vc()
4961 dsi->vc[channel].vc_id = 0; in dsi_release_vc()