Lines Matching refs:ctx
46 static int i2c_access_workaround(struct anx7625_data *ctx, in i2c_access_workaround() argument
53 if (client == ctx->last_client) in i2c_access_workaround()
56 ctx->last_client = client; in i2c_access_workaround()
58 if (client == ctx->i2c.tcpc_client) in i2c_access_workaround()
60 else if (client == ctx->i2c.tx_p0_client) in i2c_access_workaround()
62 else if (client == ctx->i2c.tx_p1_client) in i2c_access_workaround()
64 else if (client == ctx->i2c.rx_p0_client) in i2c_access_workaround()
66 else if (client == ctx->i2c.rx_p1_client) in i2c_access_workaround()
80 static int anx7625_reg_read(struct anx7625_data *ctx, in anx7625_reg_read() argument
86 i2c_access_workaround(ctx, client); in anx7625_reg_read()
96 static int anx7625_reg_block_read(struct anx7625_data *ctx, in anx7625_reg_block_read() argument
103 i2c_access_workaround(ctx, client); in anx7625_reg_block_read()
113 static int anx7625_reg_write(struct anx7625_data *ctx, in anx7625_reg_write() argument
120 i2c_access_workaround(ctx, client); in anx7625_reg_write()
131 static int anx7625_reg_block_write(struct anx7625_data *ctx, in anx7625_reg_block_write() argument
138 i2c_access_workaround(ctx, client); in anx7625_reg_block_write()
148 static int anx7625_write_or(struct anx7625_data *ctx, in anx7625_write_or() argument
154 val = anx7625_reg_read(ctx, client, offset); in anx7625_write_or()
158 return anx7625_reg_write(ctx, client, offset, (val | (mask))); in anx7625_write_or()
161 static int anx7625_write_and(struct anx7625_data *ctx, in anx7625_write_and() argument
167 val = anx7625_reg_read(ctx, client, offset); in anx7625_write_and()
171 return anx7625_reg_write(ctx, client, offset, (val & (mask))); in anx7625_write_and()
174 static int anx7625_write_and_or(struct anx7625_data *ctx, in anx7625_write_and_or() argument
180 val = anx7625_reg_read(ctx, client, offset); in anx7625_write_and_or()
184 return anx7625_reg_write(ctx, client, in anx7625_write_and_or()
188 static int anx7625_config_bit_matrix(struct anx7625_data *ctx) in anx7625_config_bit_matrix() argument
192 ret = anx7625_write_or(ctx, ctx->i2c.tx_p2_client, in anx7625_config_bit_matrix()
195 ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, in anx7625_config_bit_matrix()
202 static int anx7625_read_ctrl_status_p0(struct anx7625_data *ctx) in anx7625_read_ctrl_status_p0() argument
204 return anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, AP_AUX_CTRL_STATUS); in anx7625_read_ctrl_status_p0()
207 static int wait_aux_op_finish(struct anx7625_data *ctx) in wait_aux_op_finish() argument
209 struct device *dev = ctx->dev; in wait_aux_op_finish()
214 ctx, val, in wait_aux_op_finish()
223 val = anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, in wait_aux_op_finish()
233 static int anx7625_aux_trans(struct anx7625_data *ctx, u8 op, u32 address, in anx7625_aux_trans() argument
236 struct device *dev = ctx->dev; in anx7625_aux_trans()
259 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_aux_trans()
263 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_aux_trans()
265 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_aux_trans()
267 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_aux_trans()
271 ret |= anx7625_reg_block_write(ctx, ctx->i2c.rx_p0_client, in anx7625_aux_trans()
274 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p0_client, in anx7625_aux_trans()
282 ret = wait_aux_op_finish(ctx); in anx7625_aux_trans()
293 ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, in anx7625_aux_trans()
303 static int anx7625_video_mute_control(struct anx7625_data *ctx, in anx7625_video_mute_control() argument
310 ret = anx7625_write_or(ctx, ctx->i2c.rx_p0_client, in anx7625_video_mute_control()
313 ret |= anx7625_write_and(ctx, ctx->i2c.rx_p0_client, in anx7625_video_mute_control()
317 ret = anx7625_write_and(ctx, ctx->i2c.rx_p0_client, in anx7625_video_mute_control()
320 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p0_client, in anx7625_video_mute_control()
425 static int anx7625_odfc_config(struct anx7625_data *ctx, in anx7625_odfc_config() argument
429 struct device *dev = ctx->dev; in anx7625_odfc_config()
432 ret = anx7625_write_and(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_16, in anx7625_odfc_config()
434 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_16, in anx7625_odfc_config()
437 ret |= anx7625_write_and(ctx, ctx->i2c.rx_p1_client, in anx7625_odfc_config()
439 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_8, in anx7625_odfc_config()
443 ret |= anx7625_write_and(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_7, in anx7625_odfc_config()
447 ret |= anx7625_write_and(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_7, in anx7625_odfc_config()
449 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_7, in anx7625_odfc_config()
465 static int anx7625_set_k_value(struct anx7625_data *ctx) in anx7625_set_k_value() argument
467 struct edid *edid = (struct edid *)ctx->slimport_edid_p.edid_raw_data; in anx7625_set_k_value()
470 return anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_set_k_value()
473 return anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_set_k_value()
477 static int anx7625_dsi_video_timing_config(struct anx7625_data *ctx) in anx7625_dsi_video_timing_config() argument
479 struct device *dev = ctx->dev; in anx7625_dsi_video_timing_config()
485 ret = anx7625_calculate_m_n(ctx->dt.pixelclock.min * 1000, in anx7625_dsi_video_timing_config()
497 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, PIXEL_CLOCK_L, in anx7625_dsi_video_timing_config()
498 (ctx->dt.pixelclock.min / 1000) & 0xFF); in anx7625_dsi_video_timing_config()
499 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, PIXEL_CLOCK_H, in anx7625_dsi_video_timing_config()
500 (ctx->dt.pixelclock.min / 1000) >> 8); in anx7625_dsi_video_timing_config()
502 ret |= anx7625_write_and(ctx, ctx->i2c.rx_p1_client, in anx7625_dsi_video_timing_config()
504 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, in anx7625_dsi_video_timing_config()
505 MIPI_LANE_CTRL_0, ctx->pdata.mipi_lanes - 1); in anx7625_dsi_video_timing_config()
508 htotal = ctx->dt.hactive.min + ctx->dt.hfront_porch.min + in anx7625_dsi_video_timing_config()
509 ctx->dt.hback_porch.min + ctx->dt.hsync_len.min; in anx7625_dsi_video_timing_config()
510 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
512 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
515 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
516 HORIZONTAL_ACTIVE_PIXELS_L, ctx->dt.hactive.min & 0xFF); in anx7625_dsi_video_timing_config()
517 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
518 HORIZONTAL_ACTIVE_PIXELS_H, ctx->dt.hactive.min >> 8); in anx7625_dsi_video_timing_config()
520 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
521 HORIZONTAL_FRONT_PORCH_L, ctx->dt.hfront_porch.min); in anx7625_dsi_video_timing_config()
522 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
524 ctx->dt.hfront_porch.min >> 8); in anx7625_dsi_video_timing_config()
526 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
527 HORIZONTAL_SYNC_WIDTH_L, ctx->dt.hsync_len.min); in anx7625_dsi_video_timing_config()
528 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
529 HORIZONTAL_SYNC_WIDTH_H, ctx->dt.hsync_len.min >> 8); in anx7625_dsi_video_timing_config()
531 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
532 HORIZONTAL_BACK_PORCH_L, ctx->dt.hback_porch.min); in anx7625_dsi_video_timing_config()
533 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
534 HORIZONTAL_BACK_PORCH_H, ctx->dt.hback_porch.min >> 8); in anx7625_dsi_video_timing_config()
536 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, ACTIVE_LINES_L, in anx7625_dsi_video_timing_config()
537 ctx->dt.vactive.min); in anx7625_dsi_video_timing_config()
538 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, ACTIVE_LINES_H, in anx7625_dsi_video_timing_config()
539 ctx->dt.vactive.min >> 8); in anx7625_dsi_video_timing_config()
541 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
542 VERTICAL_FRONT_PORCH, ctx->dt.vfront_porch.min); in anx7625_dsi_video_timing_config()
544 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
545 VERTICAL_SYNC_WIDTH, ctx->dt.vsync_len.min); in anx7625_dsi_video_timing_config()
547 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p2_client, in anx7625_dsi_video_timing_config()
548 VERTICAL_BACK_PORCH, ctx->dt.vback_porch.min); in anx7625_dsi_video_timing_config()
550 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_dsi_video_timing_config()
552 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_dsi_video_timing_config()
554 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_dsi_video_timing_config()
557 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_dsi_video_timing_config()
559 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_dsi_video_timing_config()
561 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, MIPI_PLL_N_NUM_7_0, in anx7625_dsi_video_timing_config()
564 anx7625_set_k_value(ctx); in anx7625_dsi_video_timing_config()
566 ret |= anx7625_odfc_config(ctx, post_divider - 1); in anx7625_dsi_video_timing_config()
574 static int anx7625_swap_dsi_lane3(struct anx7625_data *ctx) in anx7625_swap_dsi_lane3() argument
577 struct device *dev = ctx->dev; in anx7625_swap_dsi_lane3()
580 val = anx7625_reg_read(ctx, ctx->i2c.rx_p1_client, MIPI_SWAP); in anx7625_swap_dsi_lane3()
587 return anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, MIPI_SWAP, val); in anx7625_swap_dsi_lane3()
590 static int anx7625_api_dsi_config(struct anx7625_data *ctx) in anx7625_api_dsi_config() argument
594 struct device *dev = ctx->dev; in anx7625_api_dsi_config()
597 ret = anx7625_swap_dsi_lane3(ctx); in anx7625_api_dsi_config()
612 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_api_dsi_config()
622 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_api_dsi_config()
626 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_18, in anx7625_api_dsi_config()
629 ret |= anx7625_dsi_video_timing_config(ctx); in anx7625_api_dsi_config()
636 ret = anx7625_write_and(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_6, in anx7625_api_dsi_config()
639 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_6, in anx7625_api_dsi_config()
643 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_api_dsi_config()
646 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_api_dsi_config()
648 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_api_dsi_config()
657 static int anx7625_dsi_config(struct anx7625_data *ctx) in anx7625_dsi_config() argument
659 struct device *dev = ctx->dev; in anx7625_dsi_config()
665 ret = anx7625_write_and(ctx, ctx->i2c.rx_p0_client, in anx7625_dsi_config()
668 ret |= anx7625_api_dsi_config(ctx); in anx7625_dsi_config()
676 ret = anx7625_write_or(ctx, ctx->i2c.rx_p0_client, in anx7625_dsi_config()
679 ret |= anx7625_write_and(ctx, ctx->i2c.rx_p0_client, in anx7625_dsi_config()
689 static int anx7625_api_dpi_config(struct anx7625_data *ctx) in anx7625_api_dpi_config() argument
691 struct device *dev = ctx->dev; in anx7625_api_dpi_config()
692 u16 freq = ctx->dt.pixelclock.min / 1000; in anx7625_api_dpi_config()
696 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_api_dpi_config()
698 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_api_dpi_config()
703 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_api_dpi_config()
706 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_api_dpi_config()
709 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p1_client, in anx7625_api_dpi_config()
712 ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, in anx7625_api_dpi_config()
720 static int anx7625_dpi_config(struct anx7625_data *ctx) in anx7625_dpi_config() argument
722 struct device *dev = ctx->dev; in anx7625_dpi_config()
728 ret = anx7625_write_and(ctx, ctx->i2c.rx_p0_client, in anx7625_dpi_config()
735 ret = anx7625_config_bit_matrix(ctx); in anx7625_dpi_config()
741 ret = anx7625_api_dpi_config(ctx); in anx7625_dpi_config()
748 ret = anx7625_write_or(ctx, ctx->i2c.rx_p0_client, in anx7625_dpi_config()
751 ret |= anx7625_write_and(ctx, ctx->i2c.rx_p0_client, in anx7625_dpi_config()
759 static int anx7625_read_flash_status(struct anx7625_data *ctx) in anx7625_read_flash_status() argument
761 return anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, R_RAM_CTRL); in anx7625_read_flash_status()
764 static int anx7625_hdcp_key_probe(struct anx7625_data *ctx) in anx7625_hdcp_key_probe() argument
767 struct device *dev = ctx->dev; in anx7625_hdcp_key_probe()
770 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_probe()
772 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_probe()
779 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_probe()
781 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_probe()
788 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_probe()
791 ctx, val, in anx7625_hdcp_key_probe()
800 ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_probe()
814 static int anx7625_hdcp_key_load(struct anx7625_data *ctx) in anx7625_hdcp_key_load() argument
817 struct device *dev = ctx->dev; in anx7625_hdcp_key_load()
820 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_load()
822 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_load()
824 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_load()
826 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_load()
828 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_load()
831 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_load()
833 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_load()
836 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hdcp_key_load()
842 static int anx7625_hdcp_disable(struct anx7625_data *ctx) in anx7625_hdcp_disable() argument
845 struct device *dev = ctx->dev; in anx7625_hdcp_disable()
850 ret = anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f); in anx7625_hdcp_disable()
852 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, 0xec, 0x10); in anx7625_hdcp_disable()
854 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, 0xff, 0x01); in anx7625_hdcp_disable()
858 return anx7625_write_and(ctx, ctx->i2c.tx_p0_client, in anx7625_hdcp_disable()
862 static int anx7625_hdcp_enable(struct anx7625_data *ctx) in anx7625_hdcp_enable() argument
866 struct device *dev = ctx->dev; in anx7625_hdcp_enable()
868 ret = anx7625_hdcp_key_probe(ctx); in anx7625_hdcp_enable()
875 ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_READ, DP_AUX_HDCP_BCAPS, 1, &bcap); in anx7625_hdcp_enable()
887 ret = anx7625_reg_write(ctx, ctx->i2c.tx_p0_client, in anx7625_hdcp_enable()
892 ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p0_client, in anx7625_hdcp_enable()
897 ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p0_client, in anx7625_hdcp_enable()
900 ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p0_client, in anx7625_hdcp_enable()
902 ret |= anx7625_hdcp_key_load(ctx); in anx7625_hdcp_enable()
908 ret = anx7625_write_or(ctx, ctx->i2c.rx_p1_client, 0xee, 0x20); in anx7625_hdcp_enable()
911 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, 0xec, 0x10); in anx7625_hdcp_enable()
913 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, 0xff, 0x01); in anx7625_hdcp_enable()
917 return anx7625_write_or(ctx, ctx->i2c.tx_p0_client, in anx7625_hdcp_enable()
921 static void anx7625_dp_start(struct anx7625_data *ctx) in anx7625_dp_start() argument
924 struct device *dev = ctx->dev; in anx7625_dp_start()
927 if (!ctx->display_timing_valid) { in anx7625_dp_start()
935 ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data); in anx7625_dp_start()
940 anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f); in anx7625_dp_start()
942 if (ctx->pdata.is_dpi) in anx7625_dp_start()
943 ret = anx7625_dpi_config(ctx); in anx7625_dp_start()
945 ret = anx7625_dsi_config(ctx); in anx7625_dp_start()
950 ctx->hdcp_cp = DRM_MODE_CONTENT_PROTECTION_UNDESIRED; in anx7625_dp_start()
952 ctx->dp_en = 1; in anx7625_dp_start()
955 static void anx7625_dp_stop(struct anx7625_data *ctx) in anx7625_dp_stop() argument
957 struct device *dev = ctx->dev; in anx7625_dp_stop()
967 ret = anx7625_write_and(ctx, ctx->i2c.tx_p0_client, 0x87, 0xfe); in anx7625_dp_stop()
968 ret |= anx7625_write_and(ctx, ctx->i2c.tx_p2_client, 0x08, 0x7f); in anx7625_dp_stop()
970 ret |= anx7625_video_mute_control(ctx, 1); in anx7625_dp_stop()
975 ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data); in anx7625_dp_stop()
979 ctx->hdcp_cp = DRM_MODE_CONTENT_PROTECTION_UNDESIRED; in anx7625_dp_stop()
981 ctx->dp_en = 0; in anx7625_dp_stop()
984 static int sp_tx_rst_aux(struct anx7625_data *ctx) in sp_tx_rst_aux() argument
988 ret = anx7625_write_or(ctx, ctx->i2c.tx_p2_client, RST_CTRL2, in sp_tx_rst_aux()
990 ret |= anx7625_write_and(ctx, ctx->i2c.tx_p2_client, RST_CTRL2, in sp_tx_rst_aux()
995 static int sp_tx_aux_wr(struct anx7625_data *ctx, u8 offset) in sp_tx_aux_wr() argument
999 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in sp_tx_aux_wr()
1001 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in sp_tx_aux_wr()
1003 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p0_client, in sp_tx_aux_wr()
1005 return (ret | wait_aux_op_finish(ctx)); in sp_tx_aux_wr()
1008 static int sp_tx_aux_rd(struct anx7625_data *ctx, u8 len_cmd) in sp_tx_aux_rd() argument
1012 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in sp_tx_aux_rd()
1014 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p0_client, in sp_tx_aux_rd()
1016 return (ret | wait_aux_op_finish(ctx)); in sp_tx_aux_rd()
1019 static int sp_tx_get_edid_block(struct anx7625_data *ctx) in sp_tx_get_edid_block() argument
1022 struct device *dev = ctx->dev; in sp_tx_get_edid_block()
1024 sp_tx_aux_wr(ctx, 0x7e); in sp_tx_get_edid_block()
1025 sp_tx_aux_rd(ctx, 0x01); in sp_tx_get_edid_block()
1026 c = anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, AP_AUX_BUFF_START); in sp_tx_get_edid_block()
1040 static int edid_read(struct anx7625_data *ctx, in edid_read() argument
1044 struct device *dev = ctx->dev; in edid_read()
1047 sp_tx_aux_wr(ctx, offset); in edid_read()
1049 ret = sp_tx_aux_rd(ctx, 0xf1); in edid_read()
1052 ret = sp_tx_rst_aux(ctx); in edid_read()
1055 ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, in edid_read()
1070 static int segments_edid_read(struct anx7625_data *ctx, in segments_edid_read() argument
1075 struct device *dev = ctx->dev; in segments_edid_read()
1078 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in segments_edid_read()
1080 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in segments_edid_read()
1082 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in segments_edid_read()
1086 ret |= wait_aux_op_finish(ctx); in segments_edid_read()
1088 ret |= sp_tx_aux_wr(ctx, segment); in segments_edid_read()
1090 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in segments_edid_read()
1098 sp_tx_aux_wr(ctx, offset); in segments_edid_read()
1100 ret = sp_tx_aux_rd(ctx, 0xf1); in segments_edid_read()
1103 ret = sp_tx_rst_aux(ctx); in segments_edid_read()
1106 ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, in segments_edid_read()
1120 static int sp_tx_edid_read(struct anx7625_data *ctx, in sp_tx_edid_read() argument
1130 struct device *dev = ctx->dev; in sp_tx_edid_read()
1133 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in sp_tx_edid_read()
1135 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in sp_tx_edid_read()
1137 ret |= anx7625_write_and(ctx, ctx->i2c.rx_p0_client, in sp_tx_edid_read()
1144 blocks_num = sp_tx_get_edid_block(ctx); in sp_tx_edid_read()
1156 g_edid_break = edid_read(ctx, offset, in sp_tx_edid_read()
1178 ret = segments_edid_read(ctx, count / 2, in sp_tx_edid_read()
1199 ret = segments_edid_read(ctx, count / 2, in sp_tx_edid_read()
1226 ret = sp_tx_rst_aux(ctx); in sp_tx_edid_read()
1235 static void anx7625_power_on(struct anx7625_data *ctx) in anx7625_power_on() argument
1237 struct device *dev = ctx->dev; in anx7625_power_on()
1240 if (!ctx->pdata.low_power_mode) { in anx7625_power_on()
1245 for (i = 0; i < ARRAY_SIZE(ctx->pdata.supplies); i++) { in anx7625_power_on()
1246 ret = regulator_enable(ctx->pdata.supplies[i].consumer); in anx7625_power_on()
1258 gpiod_set_value(ctx->pdata.gpio_p_on, 1); in anx7625_power_on()
1261 gpiod_set_value(ctx->pdata.gpio_reset, 1); in anx7625_power_on()
1268 regulator_disable(ctx->pdata.supplies[i].consumer); in anx7625_power_on()
1271 static void anx7625_power_standby(struct anx7625_data *ctx) in anx7625_power_standby() argument
1273 struct device *dev = ctx->dev; in anx7625_power_standby()
1276 if (!ctx->pdata.low_power_mode) { in anx7625_power_standby()
1281 gpiod_set_value(ctx->pdata.gpio_reset, 0); in anx7625_power_standby()
1283 gpiod_set_value(ctx->pdata.gpio_p_on, 0); in anx7625_power_standby()
1286 ret = regulator_bulk_disable(ARRAY_SIZE(ctx->pdata.supplies), in anx7625_power_standby()
1287 ctx->pdata.supplies); in anx7625_power_standby()
1295 static void anx7625_config(struct anx7625_data *ctx) in anx7625_config() argument
1297 anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_config()
1301 static int anx7625_hpd_timer_config(struct anx7625_data *ctx) in anx7625_hpd_timer_config() argument
1306 ret = anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, in anx7625_hpd_timer_config()
1308 ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, in anx7625_hpd_timer_config()
1311 ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, in anx7625_hpd_timer_config()
1318 static int anx7625_read_hpd_gpio_config_status(struct anx7625_data *ctx) in anx7625_read_hpd_gpio_config_status() argument
1320 return anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, GPIO_CTRL_2); in anx7625_read_hpd_gpio_config_status()
1323 static void anx7625_disable_pd_protocol(struct anx7625_data *ctx) in anx7625_disable_pd_protocol() argument
1325 struct device *dev = ctx->dev; in anx7625_disable_pd_protocol()
1329 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, 0x88, 0x40); in anx7625_disable_pd_protocol()
1331 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_disable_pd_protocol()
1334 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, 0x88, 0x00); in anx7625_disable_pd_protocol()
1347 ctx, val, in anx7625_disable_pd_protocol()
1352 anx7625_hpd_timer_config(ctx); in anx7625_disable_pd_protocol()
1355 static int anx7625_ocm_loading_check(struct anx7625_data *ctx) in anx7625_ocm_loading_check() argument
1358 struct device *dev = ctx->dev; in anx7625_ocm_loading_check()
1361 ret = anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, in anx7625_ocm_loading_check()
1370 anx7625_disable_pd_protocol(ctx); in anx7625_ocm_loading_check()
1373 anx7625_reg_read(ctx, in anx7625_ocm_loading_check()
1374 ctx->i2c.rx_p0_client, in anx7625_ocm_loading_check()
1376 anx7625_reg_read(ctx, in anx7625_ocm_loading_check()
1377 ctx->i2c.rx_p0_client, in anx7625_ocm_loading_check()
1385 static void anx7625_power_on_init(struct anx7625_data *ctx) in anx7625_power_on_init() argument
1390 anx7625_power_on(ctx); in anx7625_power_on_init()
1391 anx7625_config(ctx); in anx7625_power_on_init()
1394 if (!anx7625_ocm_loading_check(ctx)) in anx7625_power_on_init()
1398 anx7625_power_standby(ctx); in anx7625_power_on_init()
1435 static void anx7625_stop_dp_work(struct anx7625_data *ctx) in anx7625_stop_dp_work() argument
1437 ctx->hpd_status = 0; in anx7625_stop_dp_work()
1438 ctx->hpd_high_cnt = 0; in anx7625_stop_dp_work()
1441 static void anx7625_start_dp_work(struct anx7625_data *ctx) in anx7625_start_dp_work() argument
1444 struct device *dev = ctx->dev; in anx7625_start_dp_work()
1446 if (ctx->hpd_high_cnt >= 2) { in anx7625_start_dp_work()
1451 ctx->hpd_status = 1; in anx7625_start_dp_work()
1452 ctx->hpd_high_cnt++; in anx7625_start_dp_work()
1455 ret = anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f); in anx7625_start_dp_work()
1458 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, 0xec, 0x10); in anx7625_start_dp_work()
1460 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p1_client, 0xff, 0x01); in anx7625_start_dp_work()
1466 ret = anx7625_reg_read(ctx, ctx->i2c.rx_p1_client, 0x86); in anx7625_start_dp_work()
1473 static int anx7625_read_hpd_status_p0(struct anx7625_data *ctx) in anx7625_read_hpd_status_p0() argument
1475 return anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, SYSTEM_STSTUS); in anx7625_read_hpd_status_p0()
1478 static int _anx7625_hpd_polling(struct anx7625_data *ctx, in _anx7625_hpd_polling() argument
1482 struct device *dev = ctx->dev; in _anx7625_hpd_polling()
1485 if (ctx->pdata.intp_irq) in _anx7625_hpd_polling()
1489 ctx, val, in _anx7625_hpd_polling()
1499 anx7625_reg_write(ctx, ctx->i2c.tcpc_client, in _anx7625_hpd_polling()
1501 anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in _anx7625_hpd_polling()
1504 anx7625_start_dp_work(ctx); in _anx7625_hpd_polling()
1506 if (!ctx->pdata.panel_bridge && ctx->bridge_attached) in _anx7625_hpd_polling()
1507 drm_helper_hpd_irq_event(ctx->bridge.dev); in _anx7625_hpd_polling()
1515 struct anx7625_data *ctx = container_of(aux, struct anx7625_data, aux); in anx7625_wait_hpd_asserted() local
1516 struct device *dev = ctx->dev; in anx7625_wait_hpd_asserted()
1520 ret = _anx7625_hpd_polling(ctx, wait_us); in anx7625_wait_hpd_asserted()
1527 static void anx7625_remove_edid(struct anx7625_data *ctx) in anx7625_remove_edid() argument
1529 ctx->slimport_edid_p.edid_block_num = -1; in anx7625_remove_edid()
1532 static void anx7625_dp_adjust_swing(struct anx7625_data *ctx) in anx7625_dp_adjust_swing() argument
1536 for (i = 0; i < ctx->pdata.dp_lane0_swing_reg_cnt; i++) in anx7625_dp_adjust_swing()
1537 anx7625_reg_write(ctx, ctx->i2c.tx_p1_client, in anx7625_dp_adjust_swing()
1539 ctx->pdata.lane0_reg_data[i]); in anx7625_dp_adjust_swing()
1541 for (i = 0; i < ctx->pdata.dp_lane1_swing_reg_cnt; i++) in anx7625_dp_adjust_swing()
1542 anx7625_reg_write(ctx, ctx->i2c.tx_p1_client, in anx7625_dp_adjust_swing()
1544 ctx->pdata.lane1_reg_data[i]); in anx7625_dp_adjust_swing()
1547 static void dp_hpd_change_handler(struct anx7625_data *ctx, bool on) in dp_hpd_change_handler() argument
1549 struct device *dev = ctx->dev; in dp_hpd_change_handler()
1557 anx7625_remove_edid(ctx); in dp_hpd_change_handler()
1558 anx7625_stop_dp_work(ctx); in dp_hpd_change_handler()
1561 anx7625_start_dp_work(ctx); in dp_hpd_change_handler()
1562 anx7625_dp_adjust_swing(ctx); in dp_hpd_change_handler()
1566 static int anx7625_hpd_change_detect(struct anx7625_data *ctx) in anx7625_hpd_change_detect() argument
1569 struct device *dev = ctx->dev; in anx7625_hpd_change_detect()
1571 status = anx7625_reg_write(ctx, ctx->i2c.tcpc_client, in anx7625_hpd_change_detect()
1578 intr_vector = anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, in anx7625_hpd_change_detect()
1585 status = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, in anx7625_hpd_change_detect()
1596 status = anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, in anx7625_hpd_change_detect()
1604 dp_hpd_change_handler(ctx, status & HPD_STATUS); in anx7625_hpd_change_detect()
1612 struct anx7625_data *ctx = container_of(work, in anx7625_work_func() local
1615 mutex_lock(&ctx->lock); in anx7625_work_func()
1617 if (pm_runtime_suspended(ctx->dev)) { in anx7625_work_func()
1618 mutex_unlock(&ctx->lock); in anx7625_work_func()
1622 event = anx7625_hpd_change_detect(ctx); in anx7625_work_func()
1624 mutex_unlock(&ctx->lock); in anx7625_work_func()
1629 if (ctx->bridge_attached) in anx7625_work_func()
1630 drm_helper_hpd_irq_event(ctx->bridge.dev); in anx7625_work_func()
1635 struct anx7625_data *ctx = (struct anx7625_data *)data; in anx7625_intr_hpd_isr() local
1637 queue_work(ctx->workqueue, &ctx->work); in anx7625_intr_hpd_isr()
1760 struct anx7625_data *ctx = container_of(aux, struct anx7625_data, aux); in anx7625_aux_transfer() local
1761 struct device *dev = ctx->dev; in anx7625_aux_transfer()
1765 mutex_lock(&ctx->aux_lock); in anx7625_aux_transfer()
1778 ret = anx7625_aux_trans(ctx, msg->request, msg->address, in anx7625_aux_transfer()
1782 mutex_unlock(&ctx->aux_lock); in anx7625_aux_transfer()
1787 static struct edid *anx7625_get_edid(struct anx7625_data *ctx) in anx7625_get_edid() argument
1789 struct device *dev = ctx->dev; in anx7625_get_edid()
1790 struct s_edid_data *p_edid = &ctx->slimport_edid_p; in anx7625_get_edid()
1800 if (ctx->slimport_edid_p.edid_block_num > 0) { in anx7625_get_edid()
1801 memcpy(edid, ctx->slimport_edid_p.edid_raw_data, in anx7625_get_edid()
1807 _anx7625_hpd_polling(ctx, 5000 * 100); in anx7625_get_edid()
1808 edid_num = sp_tx_edid_read(ctx, p_edid->edid_raw_data); in anx7625_get_edid()
1819 memcpy(edid, ctx->slimport_edid_p.edid_raw_data, FOUR_BLOCK_SIZE); in anx7625_get_edid()
1823 static enum drm_connector_status anx7625_sink_detect(struct anx7625_data *ctx) in anx7625_sink_detect() argument
1825 struct device *dev = ctx->dev; in anx7625_sink_detect()
1829 if (ctx->pdata.panel_bridge) in anx7625_sink_detect()
1832 return ctx->hpd_status ? connector_status_connected : in anx7625_sink_detect()
1840 struct anx7625_data *ctx = dev_get_drvdata(dev); in anx7625_audio_hw_params() local
1844 if (anx7625_sink_detect(ctx) == connector_status_disconnected) { in anx7625_audio_hw_params()
1859 ret = anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, in anx7625_audio_hw_params()
1864 ret = anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, in anx7625_audio_hw_params()
1888 ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, in anx7625_audio_hw_params()
1911 ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, in anx7625_audio_hw_params()
1914 ret |= anx7625_write_or(ctx, ctx->i2c.tx_p2_client, in anx7625_audio_hw_params()
1917 ret |= anx7625_write_and(ctx, ctx->i2c.tx_p2_client, in anx7625_audio_hw_params()
1948 ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, in anx7625_audio_hw_params()
1951 ret |= anx7625_write_or(ctx, ctx->i2c.rx_p0_client, in anx7625_audio_hw_params()
1985 anx7625_audio_update_connector_status(struct anx7625_data *ctx, in anx7625_audio_update_connector_status() argument
1988 if (ctx->plugged_cb && ctx->codec_dev) { in anx7625_audio_update_connector_status()
1989 ctx->plugged_cb(ctx->codec_dev, in anx7625_audio_update_connector_status()
1998 struct anx7625_data *ctx = data; in anx7625_audio_hook_plugged_cb() local
2000 ctx->plugged_cb = fn; in anx7625_audio_hook_plugged_cb()
2001 ctx->codec_dev = codec_dev; in anx7625_audio_hook_plugged_cb()
2002 anx7625_audio_update_connector_status(ctx, anx7625_sink_detect(ctx)); in anx7625_audio_hook_plugged_cb()
2010 struct anx7625_data *ctx = dev_get_drvdata(dev); in anx7625_audio_get_eld() local
2012 if (!ctx->connector) { in anx7625_audio_get_eld()
2017 memcpy(buf, ctx->connector->eld, in anx7625_audio_get_eld()
2018 min(sizeof(ctx->connector->eld), len)); in anx7625_audio_get_eld()
2032 static void anx7625_unregister_audio(struct anx7625_data *ctx) in anx7625_unregister_audio() argument
2034 struct device *dev = ctx->dev; in anx7625_unregister_audio()
2036 if (ctx->audio_pdev) { in anx7625_unregister_audio()
2037 platform_device_unregister(ctx->audio_pdev); in anx7625_unregister_audio()
2038 ctx->audio_pdev = NULL; in anx7625_unregister_audio()
2044 static int anx7625_register_audio(struct device *dev, struct anx7625_data *ctx) in anx7625_register_audio() argument
2050 .data = ctx, in anx7625_register_audio()
2053 ctx->audio_pdev = platform_device_register_data(dev, in anx7625_register_audio()
2059 if (IS_ERR(ctx->audio_pdev)) in anx7625_register_audio()
2060 return PTR_ERR(ctx->audio_pdev); in anx7625_register_audio()
2067 static int anx7625_setup_dsi_device(struct anx7625_data *ctx) in anx7625_setup_dsi_device() argument
2070 struct device *dev = ctx->dev; in anx7625_setup_dsi_device()
2078 host = of_find_mipi_dsi_host_by_node(ctx->pdata.mipi_host_node); in anx7625_setup_dsi_device()
2090 dsi->lanes = ctx->pdata.mipi_lanes; in anx7625_setup_dsi_device()
2097 ctx->dsi = dsi; in anx7625_setup_dsi_device()
2102 static int anx7625_attach_dsi(struct anx7625_data *ctx) in anx7625_attach_dsi() argument
2104 struct device *dev = ctx->dev; in anx7625_attach_dsi()
2109 ret = devm_mipi_dsi_attach(dev, ctx->dsi); in anx7625_attach_dsi()
2124 struct anx7625_data *ctx; in hdcp_check_work_func() local
2129 ctx = container_of(dwork, struct anx7625_data, hdcp_work); in hdcp_check_work_func()
2130 dev = ctx->dev; in hdcp_check_work_func()
2132 if (!ctx->connector) { in hdcp_check_work_func()
2137 drm_dev = ctx->connector->dev; in hdcp_check_work_func()
2139 mutex_lock(&ctx->hdcp_wq_lock); in hdcp_check_work_func()
2141 status = anx7625_reg_read(ctx, ctx->i2c.tx_p0_client, 0); in hdcp_check_work_func()
2144 ctx->hdcp_cp = DRM_MODE_CONTENT_PROTECTION_ENABLED; in hdcp_check_work_func()
2145 drm_hdcp_update_content_protection(ctx->connector, in hdcp_check_work_func()
2146 ctx->hdcp_cp); in hdcp_check_work_func()
2150 mutex_unlock(&ctx->hdcp_wq_lock); in hdcp_check_work_func()
2154 static int anx7625_connector_atomic_check(struct anx7625_data *ctx, in anx7625_connector_atomic_check() argument
2157 struct device *dev = ctx->dev; in anx7625_connector_atomic_check()
2163 if (cp == ctx->hdcp_cp) in anx7625_connector_atomic_check()
2167 if (ctx->dp_en) { in anx7625_connector_atomic_check()
2169 anx7625_hdcp_enable(ctx); in anx7625_connector_atomic_check()
2171 queue_delayed_work(ctx->hdcp_workqueue, in anx7625_connector_atomic_check()
2172 &ctx->hdcp_work, in anx7625_connector_atomic_check()
2178 if (ctx->hdcp_cp != DRM_MODE_CONTENT_PROTECTION_ENABLED) { in anx7625_connector_atomic_check()
2182 anx7625_hdcp_disable(ctx); in anx7625_connector_atomic_check()
2183 ctx->hdcp_cp = DRM_MODE_CONTENT_PROTECTION_UNDESIRED; in anx7625_connector_atomic_check()
2184 drm_hdcp_update_content_protection(ctx->connector, in anx7625_connector_atomic_check()
2185 ctx->hdcp_cp); in anx7625_connector_atomic_check()
2200 struct anx7625_data *ctx = bridge_to_anx7625(bridge); in anx7625_bridge_attach() local
2202 struct device *dev = ctx->dev; in anx7625_bridge_attach()
2213 ctx->aux.drm_dev = bridge->dev; in anx7625_bridge_attach()
2214 err = drm_dp_aux_register(&ctx->aux); in anx7625_bridge_attach()
2220 if (ctx->pdata.panel_bridge) { in anx7625_bridge_attach()
2222 ctx->pdata.panel_bridge, in anx7625_bridge_attach()
2223 &ctx->bridge, flags); in anx7625_bridge_attach()
2228 ctx->bridge_attached = 1; in anx7625_bridge_attach()
2235 struct anx7625_data *ctx = bridge_to_anx7625(bridge); in anx7625_bridge_detach() local
2237 drm_dp_aux_unregister(&ctx->aux); in anx7625_bridge_detach()
2245 struct anx7625_data *ctx = bridge_to_anx7625(bridge); in anx7625_bridge_mode_valid() local
2246 struct device *dev = ctx->dev; in anx7625_bridge_mode_valid()
2266 struct anx7625_data *ctx = bridge_to_anx7625(bridge); in anx7625_bridge_mode_set() local
2267 struct device *dev = ctx->dev; in anx7625_bridge_mode_set()
2271 ctx->dt.pixelclock.min = mode->clock; in anx7625_bridge_mode_set()
2272 ctx->dt.hactive.min = mode->hdisplay; in anx7625_bridge_mode_set()
2273 ctx->dt.hsync_len.min = mode->hsync_end - mode->hsync_start; in anx7625_bridge_mode_set()
2274 ctx->dt.hfront_porch.min = mode->hsync_start - mode->hdisplay; in anx7625_bridge_mode_set()
2275 ctx->dt.hback_porch.min = mode->htotal - mode->hsync_end; in anx7625_bridge_mode_set()
2276 ctx->dt.vactive.min = mode->vdisplay; in anx7625_bridge_mode_set()
2277 ctx->dt.vsync_len.min = mode->vsync_end - mode->vsync_start; in anx7625_bridge_mode_set()
2278 ctx->dt.vfront_porch.min = mode->vsync_start - mode->vdisplay; in anx7625_bridge_mode_set()
2279 ctx->dt.vback_porch.min = mode->vtotal - mode->vsync_end; in anx7625_bridge_mode_set()
2281 ctx->display_timing_valid = 1; in anx7625_bridge_mode_set()
2283 DRM_DEV_DEBUG_DRIVER(dev, "pixelclock(%d).\n", ctx->dt.pixelclock.min); in anx7625_bridge_mode_set()
2285 ctx->dt.hactive.min, in anx7625_bridge_mode_set()
2286 ctx->dt.hsync_len.min, in anx7625_bridge_mode_set()
2287 ctx->dt.hfront_porch.min, in anx7625_bridge_mode_set()
2288 ctx->dt.hback_porch.min); in anx7625_bridge_mode_set()
2290 ctx->dt.vactive.min, in anx7625_bridge_mode_set()
2291 ctx->dt.vsync_len.min, in anx7625_bridge_mode_set()
2292 ctx->dt.vfront_porch.min, in anx7625_bridge_mode_set()
2293 ctx->dt.vback_porch.min); in anx7625_bridge_mode_set()
2312 struct anx7625_data *ctx = bridge_to_anx7625(bridge); in anx7625_bridge_mode_fixup() local
2313 struct device *dev = ctx->dev; in anx7625_bridge_mode_fixup()
2321 if (!ctx->pdata.panel_bridge) in anx7625_bridge_mode_fixup()
2430 struct anx7625_data *ctx = bridge_to_anx7625(bridge); in anx7625_bridge_atomic_check() local
2431 struct device *dev = ctx->dev; in anx7625_bridge_atomic_check()
2438 return anx7625_connector_atomic_check(ctx, conn_state); in anx7625_bridge_atomic_check()
2444 struct anx7625_data *ctx = bridge_to_anx7625(bridge); in anx7625_bridge_atomic_enable() local
2445 struct device *dev = ctx->dev; in anx7625_bridge_atomic_enable()
2460 ctx->connector = connector; in anx7625_bridge_atomic_enable()
2463 _anx7625_hpd_polling(ctx, 5000 * 100); in anx7625_bridge_atomic_enable()
2465 anx7625_dp_start(ctx); in anx7625_bridge_atomic_enable()
2471 struct anx7625_data *ctx = bridge_to_anx7625(bridge); in anx7625_bridge_atomic_disable() local
2472 struct device *dev = ctx->dev; in anx7625_bridge_atomic_disable()
2476 ctx->connector = NULL; in anx7625_bridge_atomic_disable()
2477 anx7625_dp_stop(ctx); in anx7625_bridge_atomic_disable()
2479 mutex_lock(&ctx->aux_lock); in anx7625_bridge_atomic_disable()
2481 mutex_unlock(&ctx->aux_lock); in anx7625_bridge_atomic_disable()
2487 struct anx7625_data *ctx = bridge_to_anx7625(bridge); in anx7625_bridge_detect() local
2488 struct device *dev = ctx->dev; in anx7625_bridge_detect()
2492 return anx7625_sink_detect(ctx); in anx7625_bridge_detect()
2498 struct anx7625_data *ctx = bridge_to_anx7625(bridge); in anx7625_bridge_get_edid() local
2499 struct device *dev = ctx->dev; in anx7625_bridge_get_edid()
2503 return anx7625_get_edid(ctx); in anx7625_bridge_get_edid()
2521 static int anx7625_register_i2c_dummy_clients(struct anx7625_data *ctx, in anx7625_register_i2c_dummy_clients() argument
2524 struct device *dev = ctx->dev; in anx7625_register_i2c_dummy_clients()
2526 ctx->i2c.tx_p0_client = devm_i2c_new_dummy_device(dev, client->adapter, in anx7625_register_i2c_dummy_clients()
2528 if (IS_ERR(ctx->i2c.tx_p0_client)) in anx7625_register_i2c_dummy_clients()
2529 return PTR_ERR(ctx->i2c.tx_p0_client); in anx7625_register_i2c_dummy_clients()
2531 ctx->i2c.tx_p1_client = devm_i2c_new_dummy_device(dev, client->adapter, in anx7625_register_i2c_dummy_clients()
2533 if (IS_ERR(ctx->i2c.tx_p1_client)) in anx7625_register_i2c_dummy_clients()
2534 return PTR_ERR(ctx->i2c.tx_p1_client); in anx7625_register_i2c_dummy_clients()
2536 ctx->i2c.tx_p2_client = devm_i2c_new_dummy_device(dev, client->adapter, in anx7625_register_i2c_dummy_clients()
2538 if (IS_ERR(ctx->i2c.tx_p2_client)) in anx7625_register_i2c_dummy_clients()
2539 return PTR_ERR(ctx->i2c.tx_p2_client); in anx7625_register_i2c_dummy_clients()
2541 ctx->i2c.rx_p0_client = devm_i2c_new_dummy_device(dev, client->adapter, in anx7625_register_i2c_dummy_clients()
2543 if (IS_ERR(ctx->i2c.rx_p0_client)) in anx7625_register_i2c_dummy_clients()
2544 return PTR_ERR(ctx->i2c.rx_p0_client); in anx7625_register_i2c_dummy_clients()
2546 ctx->i2c.rx_p1_client = devm_i2c_new_dummy_device(dev, client->adapter, in anx7625_register_i2c_dummy_clients()
2548 if (IS_ERR(ctx->i2c.rx_p1_client)) in anx7625_register_i2c_dummy_clients()
2549 return PTR_ERR(ctx->i2c.rx_p1_client); in anx7625_register_i2c_dummy_clients()
2551 ctx->i2c.rx_p2_client = devm_i2c_new_dummy_device(dev, client->adapter, in anx7625_register_i2c_dummy_clients()
2553 if (IS_ERR(ctx->i2c.rx_p2_client)) in anx7625_register_i2c_dummy_clients()
2554 return PTR_ERR(ctx->i2c.rx_p2_client); in anx7625_register_i2c_dummy_clients()
2556 ctx->i2c.tcpc_client = devm_i2c_new_dummy_device(dev, client->adapter, in anx7625_register_i2c_dummy_clients()
2558 if (IS_ERR(ctx->i2c.tcpc_client)) in anx7625_register_i2c_dummy_clients()
2559 return PTR_ERR(ctx->i2c.tcpc_client); in anx7625_register_i2c_dummy_clients()
2566 struct anx7625_data *ctx = dev_get_drvdata(dev); in anx7625_runtime_pm_suspend() local
2568 mutex_lock(&ctx->lock); in anx7625_runtime_pm_suspend()
2570 anx7625_stop_dp_work(ctx); in anx7625_runtime_pm_suspend()
2571 anx7625_power_standby(ctx); in anx7625_runtime_pm_suspend()
2573 mutex_unlock(&ctx->lock); in anx7625_runtime_pm_suspend()
2580 struct anx7625_data *ctx = dev_get_drvdata(dev); in anx7625_runtime_pm_resume() local
2582 mutex_lock(&ctx->lock); in anx7625_runtime_pm_resume()
2584 anx7625_power_on_init(ctx); in anx7625_runtime_pm_resume()
2586 mutex_unlock(&ctx->lock); in anx7625_runtime_pm_resume()