Lines Matching refs:channel

220 static int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
643 static void print_irq_status_vc(int channel, u32 status) in print_irq_status_vc() argument
654 channel, in print_irq_status_vc()
1048 static int dsi_register_isr_vc(struct platform_device *dsidev, int channel, in dsi_register_isr_vc() argument
1058 dsi->isr_tables.isr_table_vc[channel], in dsi_register_isr_vc()
1059 ARRAY_SIZE(dsi->isr_tables.isr_table_vc[channel])); in dsi_register_isr_vc()
1062 _omap_dsi_set_irqs_vc(dsidev, channel); in dsi_register_isr_vc()
1069 static int dsi_unregister_isr_vc(struct platform_device *dsidev, int channel, in dsi_unregister_isr_vc() argument
1079 dsi->isr_tables.isr_table_vc[channel], in dsi_unregister_isr_vc()
1080 ARRAY_SIZE(dsi->isr_tables.isr_table_vc[channel])); in dsi_unregister_isr_vc()
1083 _omap_dsi_set_irqs_vc(dsidev, channel); in dsi_unregister_isr_vc()
2289 static bool dsi_vc_is_enabled(struct platform_device *dsidev, int channel) in dsi_vc_is_enabled() argument
2291 return REG_GET(dsidev, DSI_VC_CTRL(channel), 0, 0); in dsi_vc_is_enabled()
2299 const int channel = dsi->update_channel; in dsi_packet_sent_handler_vp() local
2302 if (REG_GET(vp_data->dsidev, DSI_VC_TE(channel), bit, bit) == 0) in dsi_packet_sent_handler_vp()
2306 static int dsi_sync_vc_vp(struct platform_device *dsidev, int channel) in dsi_sync_vc_vp() argument
2319 r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp, in dsi_sync_vc_vp()
2325 if (REG_GET(dsidev, DSI_VC_TE(channel), bit, bit)) { in dsi_sync_vc_vp()
2334 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp, in dsi_sync_vc_vp()
2339 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp, in dsi_sync_vc_vp()
2350 const int channel = dsi->update_channel; in dsi_packet_sent_handler_l4() local
2352 if (REG_GET(l4_data->dsidev, DSI_VC_CTRL(channel), 5, 5) == 0) in dsi_packet_sent_handler_l4()
2356 static int dsi_sync_vc_l4(struct platform_device *dsidev, int channel) in dsi_sync_vc_l4() argument
2365 r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, in dsi_sync_vc_l4()
2371 if (REG_GET(dsidev, DSI_VC_CTRL(channel), 5, 5)) { in dsi_sync_vc_l4()
2380 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, in dsi_sync_vc_l4()
2385 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, in dsi_sync_vc_l4()
2391 static int dsi_sync_vc(struct platform_device *dsidev, int channel) in dsi_sync_vc() argument
2399 if (!dsi_vc_is_enabled(dsidev, channel)) in dsi_sync_vc()
2402 switch (dsi->vc[channel].source) { in dsi_sync_vc()
2404 return dsi_sync_vc_vp(dsidev, channel); in dsi_sync_vc()
2406 return dsi_sync_vc_l4(dsidev, channel); in dsi_sync_vc()
2413 static int dsi_vc_enable(struct platform_device *dsidev, int channel, in dsi_vc_enable() argument
2417 channel, enable); in dsi_vc_enable()
2421 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), enable, 0, 0); in dsi_vc_enable()
2423 if (wait_for_bit_change(dsidev, DSI_VC_CTRL(channel), in dsi_vc_enable()
2432 static void dsi_vc_initial_config(struct platform_device *dsidev, int channel) in dsi_vc_initial_config() argument
2437 DSSDBG("Initial config of virtual channel %d", channel); in dsi_vc_initial_config()
2439 r = dsi_read_reg(dsidev, DSI_VC_CTRL(channel)); in dsi_vc_initial_config()
2443 channel); in dsi_vc_initial_config()
2458 dsi_write_reg(dsidev, DSI_VC_CTRL(channel), r); in dsi_vc_initial_config()
2460 dsi->vc[channel].source = DSI_VC_SOURCE_L4; in dsi_vc_initial_config()
2463 static int dsi_vc_config_source(struct platform_device *dsidev, int channel, in dsi_vc_config_source() argument
2468 if (dsi->vc[channel].source == source) in dsi_vc_config_source()
2471 DSSDBG("Source config of virtual channel %d", channel); in dsi_vc_config_source()
2473 dsi_sync_vc(dsidev, channel); in dsi_vc_config_source()
2475 dsi_vc_enable(dsidev, channel, 0); in dsi_vc_config_source()
2478 if (wait_for_bit_change(dsidev, DSI_VC_CTRL(channel), 15, 0) != 0) { in dsi_vc_config_source()
2479 DSSERR("vc(%d) busy when trying to config for VP\n", channel); in dsi_vc_config_source()
2484 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), source, 1, 1); in dsi_vc_config_source()
2489 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), enable, 30, 30); in dsi_vc_config_source()
2492 dsi_vc_enable(dsidev, channel, 1); in dsi_vc_config_source()
2494 dsi->vc[channel].source = source; in dsi_vc_config_source()
2499 static void dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, in dsi_vc_enable_hs() argument
2505 DSSDBG("dsi_vc_enable_hs(%d, %d)\n", channel, enable); in dsi_vc_enable_hs()
2509 dsi_vc_enable(dsidev, channel, 0); in dsi_vc_enable_hs()
2512 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), enable, 9, 9); in dsi_vc_enable_hs()
2514 dsi_vc_enable(dsidev, channel, 1); in dsi_vc_enable_hs()
2521 dsi_vc_send_null(dssdev, channel); in dsi_vc_enable_hs()
2524 static void dsi_vc_flush_long_data(struct platform_device *dsidev, int channel) in dsi_vc_flush_long_data() argument
2526 while (REG_GET(dsidev, DSI_VC_CTRL(channel), 20, 20)) { in dsi_vc_flush_long_data()
2528 val = dsi_read_reg(dsidev, DSI_VC_SHORT_PACKET_HEADER(channel)); in dsi_vc_flush_long_data()
2575 int channel) in dsi_vc_flush_receive_data() argument
2578 while (REG_GET(dsidev, DSI_VC_CTRL(channel), 20, 20)) { in dsi_vc_flush_receive_data()
2581 val = dsi_read_reg(dsidev, DSI_VC_SHORT_PACKET_HEADER(channel)); in dsi_vc_flush_receive_data()
2596 dsi_vc_flush_long_data(dsidev, channel); in dsi_vc_flush_receive_data()
2604 static int dsi_vc_send_bta(struct platform_device *dsidev, int channel) in dsi_vc_send_bta() argument
2609 DSSDBG("dsi_vc_send_bta %d\n", channel); in dsi_vc_send_bta()
2614 if (REG_GET(dsidev, DSI_VC_CTRL(channel), 20, 20)) { in dsi_vc_send_bta()
2616 dsi_vc_flush_receive_data(dsidev, channel); in dsi_vc_send_bta()
2619 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 1, 6, 6); /* BTA_EN */ in dsi_vc_send_bta()
2622 dsi_read_reg(dsidev, DSI_VC_CTRL(channel)); in dsi_vc_send_bta()
2627 static int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel) in dsi_vc_send_bta_sync() argument
2634 r = dsi_register_isr_vc(dsidev, channel, dsi_completion_handler, in dsi_vc_send_bta_sync()
2644 r = dsi_vc_send_bta(dsidev, channel); in dsi_vc_send_bta_sync()
2665 dsi_unregister_isr_vc(dsidev, channel, dsi_completion_handler, in dsi_vc_send_bta_sync()
2672 int channel, u8 data_type, u16 len, u8 ecc) in dsi_vc_write_long_header() argument
2680 data_id = data_type | dsi->vc[channel].vc_id << 6; in dsi_vc_write_long_header()
2685 dsi_write_reg(dsidev, DSI_VC_LONG_PACKET_HEADER(channel), val); in dsi_vc_write_long_header()
2689 int channel, u8 b1, u8 b2, u8 b3, u8 b4) in dsi_vc_write_long_payload() argument
2698 dsi_write_reg(dsidev, DSI_VC_LONG_PACKET_PAYLOAD(channel), val); in dsi_vc_write_long_payload()
2701 static int dsi_vc_send_long(struct platform_device *dsidev, int channel, in dsi_vc_send_long() argument
2715 if (dsi->vc[channel].tx_fifo_size * 32 * 4 < len + 4) { in dsi_vc_send_long()
2720 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_L4); in dsi_vc_send_long()
2722 dsi_vc_write_long_header(dsidev, channel, data_type, len, ecc); in dsi_vc_send_long()
2734 dsi_vc_write_long_payload(dsidev, channel, b1, b2, b3, b4); in dsi_vc_send_long()
2759 dsi_vc_write_long_payload(dsidev, channel, b1, b2, b3, 0); in dsi_vc_send_long()
2765 static int dsi_vc_send_short(struct platform_device *dsidev, int channel, in dsi_vc_send_short() argument
2776 channel, in dsi_vc_send_short()
2779 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_L4); in dsi_vc_send_short()
2781 if (FLD_GET(dsi_read_reg(dsidev, DSI_VC_CTRL(channel)), 16, 16)) { in dsi_vc_send_short()
2786 data_id = data_type | dsi->vc[channel].vc_id << 6; in dsi_vc_send_short()
2790 dsi_write_reg(dsidev, DSI_VC_SHORT_PACKET_HEADER(channel), r); in dsi_vc_send_short()
2795 static int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel) in dsi_vc_send_null() argument
2799 return dsi_vc_send_long(dsidev, channel, MIPI_DSI_NULL_PACKET, NULL, in dsi_vc_send_null()
2804 int channel, u8 *data, int len, enum dss_dsi_content_type type) in dsi_vc_write_nosync_common() argument
2810 r = dsi_vc_send_short(dsidev, channel, in dsi_vc_write_nosync_common()
2813 r = dsi_vc_send_short(dsidev, channel, in dsi_vc_write_nosync_common()
2818 r = dsi_vc_send_short(dsidev, channel, in dsi_vc_write_nosync_common()
2824 r = dsi_vc_send_long(dsidev, channel, in dsi_vc_write_nosync_common()
2833 static int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, in dsi_vc_dcs_write_nosync() argument
2838 return dsi_vc_write_nosync_common(dsidev, channel, data, len, in dsi_vc_dcs_write_nosync()
2842 static int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel, in dsi_vc_generic_write_nosync() argument
2847 return dsi_vc_write_nosync_common(dsidev, channel, data, len, in dsi_vc_generic_write_nosync()
2851 static int dsi_vc_write_common(struct omap_dss_device *dssdev, int channel, in dsi_vc_write_common() argument
2857 r = dsi_vc_write_nosync_common(dsidev, channel, data, len, type); in dsi_vc_write_common()
2861 r = dsi_vc_send_bta_sync(dssdev, channel); in dsi_vc_write_common()
2866 if (REG_GET(dsidev, DSI_VC_CTRL(channel), 20, 20)) { in dsi_vc_write_common()
2868 dsi_vc_flush_receive_data(dsidev, channel); in dsi_vc_write_common()
2876 channel, data[0], len); in dsi_vc_write_common()
2880 static int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, in dsi_vc_dcs_write() argument
2883 return dsi_vc_write_common(dssdev, channel, data, len, in dsi_vc_dcs_write()
2887 static int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data, in dsi_vc_generic_write() argument
2890 return dsi_vc_write_common(dssdev, channel, data, len, in dsi_vc_generic_write()
2895 int channel, u8 dcs_cmd) in dsi_vc_dcs_send_read_request() argument
2902 channel, dcs_cmd); in dsi_vc_dcs_send_read_request()
2904 r = dsi_vc_send_short(dsidev, channel, MIPI_DSI_DCS_READ, dcs_cmd, 0); in dsi_vc_dcs_send_read_request()
2907 " failed\n", channel, dcs_cmd); in dsi_vc_dcs_send_read_request()
2915 int channel, u8 *reqdata, int reqlen) in dsi_vc_generic_send_read_request() argument
2924 channel, reqlen); in dsi_vc_generic_send_read_request()
2940 r = dsi_vc_send_short(dsidev, channel, data_type, data, 0); in dsi_vc_generic_send_read_request()
2943 " failed\n", channel, reqlen); in dsi_vc_generic_send_read_request()
2950 static int dsi_vc_read_rx_fifo(struct platform_device *dsidev, int channel, in dsi_vc_read_rx_fifo() argument
2959 if (REG_GET(dsidev, DSI_VC_CTRL(channel), 20, 20) == 0) { in dsi_vc_read_rx_fifo()
2965 val = dsi_read_reg(dsidev, DSI_VC_SHORT_PACKET_HEADER(channel)); in dsi_vc_read_rx_fifo()
3029 DSI_VC_SHORT_PACKET_HEADER(channel)); in dsi_vc_read_rx_fifo()
3053 DSSERR("dsi_vc_read_rx_fifo(ch %d type %s) failed\n", channel, in dsi_vc_read_rx_fifo()
3059 static int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, in dsi_vc_dcs_read() argument
3065 r = dsi_vc_dcs_send_read_request(dsidev, channel, dcs_cmd); in dsi_vc_dcs_read()
3069 r = dsi_vc_send_bta_sync(dssdev, channel); in dsi_vc_dcs_read()
3073 r = dsi_vc_read_rx_fifo(dsidev, channel, buf, buflen, in dsi_vc_dcs_read()
3085 DSSERR("dsi_vc_dcs_read(ch %d, cmd 0x%02x) failed\n", channel, dcs_cmd); in dsi_vc_dcs_read()
3089 static int dsi_vc_generic_read(struct omap_dss_device *dssdev, int channel, in dsi_vc_generic_read() argument
3095 r = dsi_vc_generic_send_read_request(dsidev, channel, reqdata, reqlen); in dsi_vc_generic_read()
3099 r = dsi_vc_send_bta_sync(dssdev, channel); in dsi_vc_generic_read()
3103 r = dsi_vc_read_rx_fifo(dsidev, channel, buf, buflen, in dsi_vc_generic_read()
3116 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
3121 return dsi_vc_send_short(dsidev, channel, in dsi_vc_set_max_rx_packet_size()
3824 static int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) in dsi_enable_video_output() argument
3864 dsi_vc_enable(dsidev, channel, false); in dsi_enable_video_output()
3867 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 1, 4, 4); in dsi_enable_video_output()
3871 dsi_vc_write_long_header(dsidev, channel, data_type, in dsi_enable_video_output()
3874 dsi_vc_enable(dsidev, channel, true); in dsi_enable_video_output()
3887 dsi_vc_enable(dsidev, channel, false); in dsi_enable_video_output()
3895 static void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel) in dsi_disable_video_output() argument
3903 dsi_vc_enable(dsidev, channel, false); in dsi_disable_video_output()
3906 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 0, 4, 4); in dsi_disable_video_output()
3908 dsi_vc_enable(dsidev, channel, true); in dsi_disable_video_output()
3929 const unsigned channel = dsi->update_channel; in dsi_update_screen_dispc() local
3936 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_VP); in dsi_update_screen_dispc()
3957 dsi_write_reg(dsidev, DSI_VC_TE(channel), l); in dsi_update_screen_dispc()
3959 dsi_vc_write_long_header(dsidev, channel, MIPI_DSI_DCS_LONG_WRITE, in dsi_update_screen_dispc()
3966 dsi_write_reg(dsidev, DSI_VC_TE(channel), l); in dsi_update_screen_dispc()
3991 dsi_vc_send_bta(dsidev, channel); in dsi_update_screen_dispc()
4055 static int dsi_update(struct omap_dss_device *dssdev, int channel, in dsi_update() argument
4064 dsi->update_channel = channel; in dsi_update()
4908 static int dsi_request_vc(struct omap_dss_device *dssdev, int *channel) in dsi_request_vc() argument
4917 *channel = i; in dsi_request_vc()
4926 static int dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id) in dsi_set_vc_id() argument
4936 if (channel < 0 || channel > 3) { in dsi_set_vc_id()
4941 if (dsi->vc[channel].dssdev != dssdev) { in dsi_set_vc_id()
4947 dsi->vc[channel].vc_id = vc_id; in dsi_set_vc_id()
4952 static void dsi_release_vc(struct omap_dss_device *dssdev, int channel) in dsi_release_vc() argument
4957 if ((channel >= 0 && channel <= 3) && in dsi_release_vc()
4958 dsi->vc[channel].dssdev == dssdev) { in dsi_release_vc()
4959 dsi->vc[channel].dssdev = NULL; in dsi_release_vc()
4960 dsi->vc[channel].vc_id = 0; in dsi_release_vc()