Lines Matching refs:it6616
466 struct it6616 { struct
936 static struct it6616 *g_it6616;
942 static inline struct it6616 *to_it6616(struct v4l2_subdev *sd) in to_it6616()
944 return container_of(sd, struct it6616, sd); in to_it6616()
1011 static bool it6616_mipi_tx_get_video_stable(struct it6616 *it6616) in it6616_mipi_tx_get_video_stable() argument
1013 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_get_video_stable()
1021 static void it6616_mipitx_init_bus_para(struct it6616 *it6616) in it6616_mipitx_init_bus_para() argument
1023 struct bus_para *bus_para = &it6616->mipi.bus_para_config; in it6616_mipitx_init_bus_para()
1031 it6616->mipi_tx_enable_manual_adjusted_d_phy ? MIPI_TX_LPX : lpx; in it6616_mipitx_init_bus_para()
1033 it6616->mipi_tx_enable_manual_adjusted_d_phy ? in it6616_mipitx_init_bus_para()
1165 static enum mipi_packet_size it6616_mipi_tx_get_packet_size(struct it6616 *it6616, in it6616_mipi_tx_get_packet_size() argument
1169 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipi_tx_get_packet_size()
1191 static void it6616_mipi_tx_get_packet_fire_state(struct it6616 *it6616) in it6616_mipi_tx_get_packet_fire_state() argument
1193 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_get_packet_fire_state()
1194 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipi_tx_get_packet_fire_state()
1210 static void it6616_mipi_tx_setup_packet(struct it6616 *it6616, struct mipi_packet *pheader, in it6616_mipi_tx_setup_packet() argument
1214 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipi_tx_setup_packet()
1219 packet_size = it6616_mipi_tx_get_packet_size(it6616, dcs_setting_table, cmd_name); in it6616_mipi_tx_setup_packet()
1238 static inline void it6616_mipi_tx_fire_packet(struct it6616 *it6616, in it6616_mipi_tx_fire_packet() argument
1242 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_fire_packet()
1247 static void it6616_mipi_tx_setup_packet_process(struct it6616 *it6616, in it6616_mipi_tx_setup_packet_process() argument
1252 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_setup_packet_process()
1253 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipi_tx_setup_packet_process()
1254 struct v4l2_subdev *sd = &it6616->sd; in it6616_mipi_tx_setup_packet_process()
1272 it6616_mipi_tx_setup_packet(it6616, &packet, dcs_setting_table, cmd_name); in it6616_mipi_tx_setup_packet_process()
1273 packet_size = it6616_mipi_tx_get_packet_size(it6616, dcs_setting_table, cmd_name); in it6616_mipi_tx_setup_packet_process()
1309 it6616_mipi_tx_write(mipi, 0x74, (it6616->mipi_tx_enable_h_fire_packet << 7) | data_count); in it6616_mipi_tx_setup_packet_process()
1312 static void it6616_mipi_tx_write_lp_cmds(struct it6616 *it6616, in it6616_mipi_tx_write_lp_cmds() argument
1317 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_write_lp_cmds()
1318 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipi_tx_write_lp_cmds()
1320 u8 enable_force_lp_mode = !it6616_mipi_tx_get_video_stable(it6616); in it6616_mipi_tx_write_lp_cmds()
1346 ((it6616_mipi_tx_get_packet_size(it6616, dcs_setting_table, i) == in it6616_mipi_tx_write_lp_cmds()
1355 it6616_mipi_tx_setup_packet_process(it6616, dcs_setting_table, i, header_select); in it6616_mipi_tx_write_lp_cmds()
1356 it6616_mipi_tx_fire_packet(it6616, dcs_setting_table, i); in it6616_mipi_tx_write_lp_cmds()
1359 it6616_mipi_tx_get_packet_fire_state(it6616); in it6616_mipi_tx_write_lp_cmds()
1375 it6616_mipi_tx_get_packet_fire_state(it6616); in it6616_mipi_tx_write_lp_cmds()
1378 static void it6616_enter_bus_turn_around(struct it6616 *it6616) in it6616_enter_bus_turn_around() argument
1380 struct regmap *mipi = it6616->mipi_regmap; in it6616_enter_bus_turn_around()
1381 u8 enable_force_lp_mode = !it6616_mipi_tx_get_video_stable(it6616); in it6616_enter_bus_turn_around()
1389 it6616_mipi_tx_write(mipi, 0x74, it6616->mipi_tx_enable_h_fire_packet << 7); in it6616_enter_bus_turn_around()
1396 static __maybe_unused void it6616_mipi_read_panel(struct it6616 *it6616, in it6616_mipi_read_panel() argument
1400 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_read_panel()
1403 it6616_mipi_tx_write_lp_cmds(it6616, dcs_setting_table, in it6616_mipi_read_panel()
1405 it6616_enter_bus_turn_around(it6616); in it6616_mipi_read_panel()
1413 static int it6616_mipitx_get_bus_config(struct it6616 *it6616) in it6616_mipitx_get_bus_config() argument
1415 struct mipi_bus *bus = &it6616->mipi; in it6616_mipitx_get_bus_config()
1418 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipitx_get_bus_config()
1447 static void it6616_mipitx_setup_dsi(struct it6616 *it6616) in it6616_mipitx_setup_dsi() argument
1449 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipitx_setup_dsi()
1450 struct bus_para *bus = &it6616->mipi.bus_para_config; in it6616_mipitx_setup_dsi()
1452 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipitx_setup_dsi()
1459 u32 mclk_ps = it6616->tx_mclk_ps, tx_mclk_mhz = it6616->tx_mclk / 1000; in it6616_mipitx_setup_dsi()
1470 if (!it6616->mipi_tx_enable_manual_adjusted_d_phy) { in it6616_mipitx_setup_dsi()
1525 static void it6616_mipitx_setup_csi(struct it6616 *it6616)//set_mptx in it6616_mipitx_setup_csi() argument
1527 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_mipitx_setup_csi()
1528 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipitx_setup_csi()
1529 struct bus_para *bus = &it6616->mipi.bus_para_config; in it6616_mipitx_setup_csi()
1531 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipitx_setup_csi()
1535 u32 mclk_ps = it6616->tx_mclk_ps, tx_mclk_mhz = it6616->tx_mclk / 1000; in it6616_mipitx_setup_csi()
1546 if (!it6616->mipi_tx_enable_manual_adjusted_d_phy) { in it6616_mipitx_setup_csi()
1584 static u8 it6616_mipi_tx_find_color_space_name_index(struct it6616 *it6616) in it6616_mipi_tx_find_color_space_name_index() argument
1586 u8 i, csi_dsi_index = (it6616->mipi.bus_type == MIPI_CSI) ? 0 : 1; in it6616_mipi_tx_find_color_space_name_index()
1589 if (it6616->mipi.data_type == mipi_color_space[csi_dsi_index][i]) in it6616_mipi_tx_find_color_space_name_index()
1596 static void it6616_mipitx_output_disable(struct it6616 *it6616) in it6616_mipitx_output_disable() argument
1598 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipitx_output_disable()
1603 static void it6616_mipi_tx_output_enable(struct it6616 *it6616) in it6616_mipi_tx_output_enable() argument
1605 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_output_enable()
1611 static void it6616_mipi_tx_non_continuous_clock_setup(struct it6616 *it6616) in it6616_mipi_tx_non_continuous_clock_setup() argument
1613 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_non_continuous_clock_setup()
1614 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipi_tx_non_continuous_clock_setup()
1622 static void it6616_mipitx_output_setup(struct it6616 *it6616) in it6616_mipitx_output_setup() argument
1624 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipitx_output_setup()
1625 struct bus_para *bus = &it6616->mipi.bus_para_config; in it6616_mipitx_output_setup()
1627 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipitx_output_setup()
1628 u8 color_space_name_index = it6616_mipi_tx_find_color_space_name_index(it6616); in it6616_mipitx_output_setup()
1629 u8 bus_type_index = ((it6616->mipi.bus_type == MIPI_CSI) ? 0 : 1); in it6616_mipitx_output_setup()
1632 u32 pclk = it6616->vinfo.pclk / 1000; in it6616_mipitx_output_setup()
1634 if (it6616->mipi_tx_enable_auto_adjust_lane_count) in it6616_mipitx_output_setup()
1635 it6616->mipi.lane_cnt = it6616->csi_lanes_in_use; in it6616_mipitx_output_setup()
1641 dev_info(dev, "lan_num: %d, swap_pn: %d", it6616->mipi.lane_cnt, bus->swap_pn); in it6616_mipitx_output_setup()
1645 it6616_mipitx_get_bus_config(it6616); in it6616_mipitx_output_setup()
1661 it6616->tx_mclk = mclk_MHz * 1000; in it6616_mipitx_output_setup()
1662 it6616->tx_mclk_ps = (2000 * (mprediv + 1) * 1000) / ((pclk) * (mplldiv + 1)); in it6616_mipitx_output_setup()
1665 it6616->tx_mclk_ps / 1000, it6616->tx_mclk_ps % 1000, in it6616_mipitx_output_setup()
1666 it6616->tx_mclk / 1000, pclk); in it6616_mipitx_output_setup()
1668 if (it6616->mipi_tx_enable_auto_adjust_lane_count) { in it6616_mipitx_output_setup()
1670 it6616->mipi.lane_cnt = (it6616->mipi.lane_cnt == 4) ? 2 : 1; in it6616_mipitx_output_setup()
1672 MIPI_TX_LANE_ADJUST_THRESHOLD, it6616->mipi.lane_cnt); in it6616_mipitx_output_setup()
1677 if (it6616->tx_mclk > 310000) in it6616_mipitx_output_setup()
1694 it6616_mipi_tx_set_bits(mipi, 0x21, 0x30, (it6616->mipi.lane_cnt - 1) << 4); in it6616_mipitx_output_setup()
1703 if (it6616->mipi.bus_type == MIPI_CSI) { in it6616_mipitx_output_setup()
1714 it6616_mipitx_setup_csi(it6616); in it6616_mipitx_output_setup()
1726 it6616_mipitx_setup_dsi(it6616); in it6616_mipitx_output_setup()
1729 if (!it6616->mipi_tx_enable_continuous_clock) in it6616_mipitx_output_setup()
1730 it6616_mipi_tx_non_continuous_clock_setup(it6616); in it6616_mipitx_output_setup()
1738 static void it6616_enable_mipi(struct it6616 *it6616) in it6616_enable_mipi() argument
1740 it6616_mipitx_output_setup(it6616); in it6616_enable_mipi()
1741 it6616_mipi_tx_output_enable(it6616); in it6616_enable_mipi()
1742 it6616->mipi_tx_enable_mipi_output = 1; in it6616_enable_mipi()
1745 static void it6616_disable_mipi(struct it6616 *it6616) in it6616_disable_mipi() argument
1747 it6616_mipitx_output_disable(it6616); in it6616_disable_mipi()
1748 it6616->mipi_tx_enable_mipi_output = 0; in it6616_disable_mipi()
1751 static void it6616_mipi_tx_get_support_format(struct it6616 *it6616) in it6616_mipi_tx_get_support_format() argument
1753 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_get_support_format()
1754 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipi_tx_get_support_format()
1755 u8 mipi_intput_color = it6616->mipi.data_type; in it6616_mipi_tx_get_support_format()
1757 u8 bus_type_index = ((it6616->mipi.bus_type == MIPI_CSI) ? 0 : 1); in it6616_mipi_tx_get_support_format()
1759 if (it6616->mipi.bus_type == MIPI_CSI) { in it6616_mipi_tx_get_support_format()
1763 it6616->mipi.data_type = CSI_RGB888; in it6616_mipi_tx_get_support_format()
1768 it6616->mipi.data_type = CSI_YCbCr4228b; in it6616_mipi_tx_get_support_format()
1775 color_space_name_index = it6616_mipi_tx_find_color_space_name_index(it6616); in it6616_mipi_tx_get_support_format()
1788 mipi_intput_color = it6616->mipi.data_type = DSI_RGB_24b; in it6616_mipi_tx_get_support_format()
1800 static __maybe_unused void it6616_mipi_tx_rk_fix_first_bit_issue(struct it6616 *it6616) in it6616_mipi_tx_rk_fix_first_bit_issue() argument
1802 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_rk_fix_first_bit_issue()
1812 static void it6616_mipitx_initial(struct it6616 *it6616) in it6616_mipitx_initial() argument
1814 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipitx_initial()
1815 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipitx_initial()
1816 struct bus_para *bus = &it6616->mipi.bus_para_config; in it6616_mipitx_initial()
1823 it6616_mipi_tx_set_bits(mipi, 0x6b, 0x01, it6616->mipi.bus_type); in it6616_mipitx_initial()
1829 if (it6616->mipi_tx_enable_initial_fire_lp_cmd) { in it6616_mipitx_initial()
1830 it6616_mipi_tx_write_lp_cmds(it6616, dcs_table, ARRAY_SIZE(dcs_table), in it6616_mipitx_initial()
1838 static bool it6616_hdmi_is_5v_on(struct it6616 *it6616) in it6616_hdmi_is_5v_on() argument
1840 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_is_5v_on()
1848 static bool it6616_hdmi_is_clock_stable(struct it6616 *it6616) in it6616_hdmi_is_clock_stable() argument
1850 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_is_clock_stable()
1858 static __maybe_unused bool it6616_hdmi_is_symbol_locked(struct it6616 *it6616) in it6616_hdmi_is_symbol_locked() argument
1860 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_is_symbol_locked()
1870 static bool it6616_hdmi_is_scdt_on(struct it6616 *it6616) in it6616_hdmi_is_scdt_on() argument
1872 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_is_scdt_on()
1880 static u8 it6616_hdmi_get_output_color_space(struct it6616 *it6616) in it6616_hdmi_get_output_color_space() argument
1883 u8 mipi_intput_color = it6616->mipi.data_type; in it6616_hdmi_get_output_color_space()
1885 if (it6616->mipi.bus_type == MIPI_CSI) { in it6616_hdmi_get_output_color_space()
1920 it6616->output_colorspace = hdmi_output_color; in it6616_hdmi_get_output_color_space()
1925 static void it6616_hdmi_edid_ram_get(struct it6616 *it6616, u8 *buf) in it6616_hdmi_edid_ram_get() argument
1927 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_edid_ram_get()
1928 struct regmap *edid = it6616->edid_regmap; in it6616_hdmi_edid_ram_get()
1935 static void it6616_hdmi_edid_ram_update_chksum(struct it6616 *it6616) in it6616_hdmi_edid_ram_update_chksum() argument
1937 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_edid_ram_update_chksum()
1945 sum += it6616->edid_data[i]; in it6616_hdmi_edid_ram_update_chksum()
1954 sum += it6616->edid_data[i]; in it6616_hdmi_edid_ram_update_chksum()
1956 sum -= it6616->edid_data[offset]; in it6616_hdmi_edid_ram_update_chksum()
1957 sum -= it6616->edid_data[offset + 1]; in it6616_hdmi_edid_ram_update_chksum()
1965 static void it6616_hdmi_edid_ram_init(struct it6616 *it6616) in it6616_hdmi_edid_ram_init() argument
1967 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_edid_ram_init()
1968 struct regmap *edid = it6616->edid_regmap; in it6616_hdmi_edid_ram_init()
1974 it6616_hdmi_edid_write(edid, it6616->edid_data, 0, it6616->edid_len); in it6616_hdmi_edid_ram_init()
1978 addr = cec_get_edid_phys_addr(it6616->edid_data, it6616->edid_len, &phy_addr_off); in it6616_hdmi_edid_ram_init()
1986 it6616_hdmi_edid_ram_update_chksum(it6616); in it6616_hdmi_edid_ram_init()
1993 static void it6616_hdmi_video_reset(struct it6616 *it6616) in it6616_hdmi_video_reset() argument
1995 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_video_reset()
2004 static void it6616_hdmi_edid_ram_enable(struct it6616 *it6616, u8 enabled) in it6616_hdmi_edid_ram_enable() argument
2006 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_edid_ram_enable()
2014 static void it6616_hdmi_rx_get_video_info(struct it6616 *it6616) in it6616_hdmi_rx_get_video_info() argument
2016 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_rx_get_video_info()
2017 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_rx_get_video_info()
2038 it6616->vinfo.h_active = h_active; in it6616_hdmi_rx_get_video_info()
2039 it6616->vinfo.h_total = h_total; in it6616_hdmi_rx_get_video_info()
2040 it6616->vinfo.h_front_porch = h_front_porch; in it6616_hdmi_rx_get_video_info()
2041 it6616->vinfo.h_sync_w = h_sync_w; in it6616_hdmi_rx_get_video_info()
2042 it6616->vinfo.h_back_porch = (h_total - h_active - h_front_porch - h_sync_w); in it6616_hdmi_rx_get_video_info()
2043 it6616->vinfo.v_active = v_active; in it6616_hdmi_rx_get_video_info()
2044 it6616->vinfo.v_total = v_total; in it6616_hdmi_rx_get_video_info()
2045 it6616->vinfo.v_front_porch = v_front_porch; in it6616_hdmi_rx_get_video_info()
2046 it6616->vinfo.v_sync_w = v_sync_w; in it6616_hdmi_rx_get_video_info()
2047 it6616->vinfo.v_back_porch = v_total - v_active - v_front_porch - v_sync_w; in it6616_hdmi_rx_get_video_info()
2048 it6616->vinfo.interlaced = (interlaced) & 0x01; in it6616_hdmi_rx_get_video_info()
2049 it6616->vinfo.v_sync_pol = (v_sync_pol) & 0x01; in it6616_hdmi_rx_get_video_info()
2050 it6616->vinfo.h_sync_pol = (h_sync_pol) & 0x01; in it6616_hdmi_rx_get_video_info()
2052 frame_rate = (u32)(it6616->vinfo.pclk) * 1000; in it6616_hdmi_rx_get_video_info()
2053 frame_rate /= it6616->vinfo.h_total; in it6616_hdmi_rx_get_video_info()
2054 frame_rate /= it6616->vinfo.v_total; in it6616_hdmi_rx_get_video_info()
2055 it6616->vinfo.frame_rate = frame_rate; in it6616_hdmi_rx_get_video_info()
2057 if (it6616->avi_if.colorspace == HDMI_COLORSPACE_YUV420) { in it6616_hdmi_rx_get_video_info()
2058 dev_dbg(dev, "HActive = %d\n", it6616->vinfo.h_active*2); in it6616_hdmi_rx_get_video_info()
2059 dev_dbg(dev, "HTotal = %d\n", it6616->vinfo.h_total*2); in it6616_hdmi_rx_get_video_info()
2061 dev_dbg(dev, "HActive = %d\n", it6616->vinfo.h_active); in it6616_hdmi_rx_get_video_info()
2062 dev_dbg(dev, "HTotal = %d\n", it6616->vinfo.h_total); in it6616_hdmi_rx_get_video_info()
2065 dev_dbg(dev, "VActive = %d\n", it6616->vinfo.v_active); in it6616_hdmi_rx_get_video_info()
2066 dev_dbg(dev, "VTotal = %d\n", it6616->vinfo.v_total); in it6616_hdmi_rx_get_video_info()
2068 if (it6616->avi_if.colorspace == HDMI_COLORSPACE_YUV420) { in it6616_hdmi_rx_get_video_info()
2069 dev_dbg(dev, "HFrontPorch = %d\n", it6616->vinfo.h_front_porch*2); in it6616_hdmi_rx_get_video_info()
2070 dev_dbg(dev, "HSyncWidth = %d\n", it6616->vinfo.h_sync_w*2); in it6616_hdmi_rx_get_video_info()
2071 dev_dbg(dev, "HBackPorch = %d\n", it6616->vinfo.h_back_porch*2); in it6616_hdmi_rx_get_video_info()
2073 dev_dbg(dev, "HFrontPorch = %d\n", it6616->vinfo.h_front_porch); in it6616_hdmi_rx_get_video_info()
2074 dev_dbg(dev, "HSyncWidth = %d\n", it6616->vinfo.h_sync_w); in it6616_hdmi_rx_get_video_info()
2075 dev_dbg(dev, "HBackPorch = %d\n", it6616->vinfo.h_back_porch); in it6616_hdmi_rx_get_video_info()
2078 dev_dbg(dev, "VFrontPorch = %d\n", it6616->vinfo.v_front_porch); in it6616_hdmi_rx_get_video_info()
2079 dev_dbg(dev, "VSyncWidth = %d\n", it6616->vinfo.v_sync_w); in it6616_hdmi_rx_get_video_info()
2080 dev_dbg(dev, "VBackPorch = %d\n", it6616->vinfo.v_back_porch); in it6616_hdmi_rx_get_video_info()
2081 dev_dbg(dev, "FrameRate = %u\n", it6616->vinfo.frame_rate); in it6616_hdmi_rx_get_video_info()
2083 if (it6616->vinfo.interlaced) in it6616_hdmi_rx_get_video_info()
2088 if (it6616->vinfo.v_sync_pol) in it6616_hdmi_rx_get_video_info()
2093 if (it6616->vinfo.h_sync_pol) in it6616_hdmi_rx_get_video_info()
2099 static void it6616_hdmi_hpd_output(struct it6616 *it6616, u8 hpd) in it6616_hdmi_hpd_output() argument
2101 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_hpd_output()
2113 static void it6616_hdmi_hdcp_reset(struct it6616 *it6616) in it6616_hdmi_hdcp_reset() argument
2115 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_hdcp_reset()
2121 static bool it6616_hdmi_get_hdcp_status(struct it6616 *it6616) in it6616_hdmi_get_hdcp_status() argument
2123 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_get_hdcp_status()
2128 static bool it6616_get_hdcp_status(struct it6616 *it6616) in it6616_get_hdcp_status() argument
2132 hdcp_status = it6616_hdmi_get_hdcp_status(it6616); in it6616_get_hdcp_status()
2137 static enum av_mute_state it6616_hdmi_rx_get_av_mute_state(struct it6616 *it6616) in it6616_hdmi_rx_get_av_mute_state() argument
2139 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_rx_get_av_mute_state()
2148 static void it6616_hdmi_rx_set_av_mute(struct it6616 *it6616, enum av_mute_state mute_state) in it6616_hdmi_rx_set_av_mute() argument
2150 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_rx_set_av_mute()
2158 if (!it6616->mipi_tx_enable_mipi_output) { in it6616_hdmi_rx_set_av_mute()
2159 it6616_hdmi_rx_get_video_info(it6616); in it6616_hdmi_rx_set_av_mute()
2160 it6616_mipi_tx_get_support_format(it6616); in it6616_hdmi_rx_set_av_mute()
2161 it6616_enable_mipi(it6616); in it6616_hdmi_rx_set_av_mute()
2166 it6616_disable_mipi(it6616); in it6616_hdmi_rx_set_av_mute()
2173 static void it6616_hdmi_update_rs(struct it6616 *it6616, u8 level) in it6616_hdmi_update_rs() argument
2175 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_update_rs()
2186 static void it6616_mipi_tx_calc_rclk(struct it6616 *it6616) in it6616_mipi_tx_calc_rclk() argument
2188 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_calc_rclk()
2189 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipi_tx_calc_rclk()
2206 it6616->tx_rclk = sum / TIMER_100MS; in it6616_mipi_tx_calc_rclk()
2207 dev_dbg(dev, "mipi rclk = %d.%d MHz", it6616->tx_rclk / 1000, in it6616_mipi_tx_calc_rclk()
2208 it6616->tx_rclk % 1000); in it6616_mipi_tx_calc_rclk()
2211 static void it6616_mipi_tx_calc_mclk(struct it6616 *it6616) in it6616_mipi_tx_calc_mclk() argument
2213 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_calc_mclk()
2214 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipi_tx_calc_mclk()
2233 tx_mclk = it6616->tx_rclk * 2048 / sum; in it6616_mipi_tx_calc_mclk()
2237 static void it6616_mipi_tx_calc_pclk(struct it6616 *it6616) in it6616_mipi_tx_calc_pclk() argument
2239 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipi_tx_calc_pclk()
2240 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipi_tx_calc_pclk()
2259 it6616->tx_pclk = it6616->tx_rclk * 2048 / sum; in it6616_mipi_tx_calc_pclk()
2260 dev_dbg(dev, "mipi pclk = %u.%u MHz", it6616->tx_pclk / 1000, in it6616_mipi_tx_calc_pclk()
2261 it6616->tx_pclk % 1000); in it6616_mipi_tx_calc_pclk()
2264 static u32 it6616_hdmi_rx_calc_rclk(struct it6616 *it6616) in it6616_hdmi_rx_calc_rclk() argument
2266 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_rx_calc_rclk()
2267 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_rx_calc_rclk()
2295 it6616->rclk = rclk; in it6616_hdmi_rx_calc_rclk()
2300 static u32 it6616_hdmi_rx_calc_pclk(struct it6616 *it6616) in it6616_hdmi_rx_calc_pclk() argument
2302 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_rx_calc_pclk()
2303 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_rx_calc_pclk()
2320 pclk = it6616->rclk * 512 / sump; // 512=2*256 because of 1T 2 pixel in it6616_hdmi_rx_calc_pclk()
2322 it6616->vinfo.pclk = pclk; in it6616_hdmi_rx_calc_pclk()
2331 static void it6616_hdmi_rx_calc_tmds_clk(struct it6616 *it6616, u8 count) in it6616_hdmi_rx_calc_tmds_clk() argument
2333 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_rx_calc_tmds_clk()
2334 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_rx_calc_tmds_clk()
2348 it6616->vinfo.TMDSCLK = (it6616->rclk * (u32)1024 * i) / sumt; in it6616_hdmi_rx_calc_tmds_clk()
2350 it6616->vinfo.TMDSCLK = (it6616->rclk * (u32)512 * i) / sumt; in it6616_hdmi_rx_calc_tmds_clk()
2352 it6616->vinfo.TMDSCLK = (it6616->rclk * (u32)256 * i) / sumt; in it6616_hdmi_rx_calc_tmds_clk()
2354 it6616->vinfo.TMDSCLK = (it6616->rclk * (u32)128 * i) / sumt; in it6616_hdmi_rx_calc_tmds_clk()
2357 it6616->vinfo.TMDSCLK / 1000, it6616->vinfo.TMDSCLK % 1000); in it6616_hdmi_rx_calc_tmds_clk()
2363 static void it6616_hdmi_receive_avi_infoframe_log(struct it6616 *it6616, u8 *buffer, size_t length) in it6616_hdmi_receive_avi_infoframe_log() argument
2365 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_receive_avi_infoframe_log()
2373 static int it6616_hdmi_update_avi_infoframe(struct it6616 *it6616) in it6616_hdmi_update_avi_infoframe() argument
2375 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_update_avi_infoframe()
2376 struct hdmi_avi_infoframe *frame = &it6616->avi_if; in it6616_hdmi_update_avi_infoframe()
2386 it6616_hdmi_receive_avi_infoframe_log(it6616, avi_packet, ARRAY_SIZE(avi_packet)); in it6616_hdmi_update_avi_infoframe()
2391 static void it6616_hdmi_rx_setup_csc(struct it6616 *it6616) in it6616_hdmi_rx_setup_csc() argument
2393 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_rx_setup_csc()
2394 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_rx_setup_csc()
2408 color_in = it6616->avi_if.colorspace; in it6616_hdmi_rx_setup_csc()
2409 color_out = it6616_hdmi_get_output_color_space(it6616); in it6616_hdmi_rx_setup_csc()
2421 if (it6616->avi_if.colorimetry == HDMI_COLORIMETRY_ITU_709) { in it6616_hdmi_rx_setup_csc()
2422 if (it6616->avi_if.quantization_range == HDMI_QUANTIZATION_RANGE_LIMITED) in it6616_hdmi_rx_setup_csc()
2427 if (it6616->avi_if.quantization_range == HDMI_QUANTIZATION_RANGE_LIMITED) in it6616_hdmi_rx_setup_csc()
2437 if (it6616->avi_if.colorimetry == HDMI_COLORIMETRY_ITU_709) in it6616_hdmi_rx_setup_csc()
2440 else if (it6616->avi_if.colorimetry == HDMI_COLORIMETRY_EXTENDED && in it6616_hdmi_rx_setup_csc()
2441 (it6616->avi_if.extended_colorimetry == 0x05 || in it6616_hdmi_rx_setup_csc()
2442 it6616->avi_if.extended_colorimetry == 0x06)) in it6616_hdmi_rx_setup_csc()
2500 if (it6616->mipi.bus_type == MIPI_CSI) { in it6616_hdmi_rx_setup_csc()
2501 switch (it6616->mipi.data_type) { in it6616_hdmi_rx_setup_csc()
2507 switch (it6616->mipi.data_type) { in it6616_hdmi_rx_setup_csc()
2520 static void it6616_hdmi_rx_reset_audio_logic(struct it6616 *it6616) in it6616_hdmi_rx_reset_audio_logic() argument
2522 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_rx_reset_audio_logic()
2537 static void it6616_hdmi_rx_audio_setup_i2s_justified(struct it6616 *it6616, u8 i2s_justified) in it6616_hdmi_rx_audio_setup_i2s_justified() argument
2539 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_rx_audio_setup_i2s_justified()
2542 it6616->audio_i2s_justified : i2s_justified; in it6616_hdmi_rx_audio_setup_i2s_justified()
2547 static void it6616_hdmi_tx_audio_setup(struct it6616 *it6616) in it6616_hdmi_tx_audio_setup() argument
2549 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_tx_audio_setup()
2550 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_tx_audio_setup()
2557 it6616_hdmi_rx_audio_setup_i2s_justified(it6616, FROM_CONFIG); in it6616_hdmi_tx_audio_setup()
2559 it6616->ainfo.n = ((u32)it6616_hdmi_read(hdmi, 0xBE) << 12) + in it6616_hdmi_tx_audio_setup()
2562 it6616->ainfo.cts = it6616_hdmi_read(hdmi, 0xC0) >> 4; in it6616_hdmi_tx_audio_setup()
2563 it6616->ainfo.cts |= ((u32)it6616_hdmi_read(hdmi, 0xC1)) << 12; in it6616_hdmi_tx_audio_setup()
2564 it6616->ainfo.cts |= ((u32)it6616_hdmi_read(hdmi, 0xC2)) << 4; in it6616_hdmi_tx_audio_setup()
2567 if (it6616->ainfo.cts == 0) { in it6616_hdmi_tx_audio_setup()
2568 dev_info(dev, "WARNING:cts = %u", it6616->ainfo.cts); in it6616_hdmi_tx_audio_setup()
2575 it6616->ainfo.channel_status = ((it6616_hdmi_read(hdmi, 0xB5) & 0xC0) >> 2) + in it6616_hdmi_tx_audio_setup()
2577 cts_128 = 128 * it6616->ainfo.cts; in it6616_hdmi_tx_audio_setup()
2578 sum = it6616->ainfo.n * it6616->vinfo.TMDSCLK; in it6616_hdmi_tx_audio_setup()
2579 it6616->ainfo.sample_freq = sum / cts_128; in it6616_hdmi_tx_audio_setup()
2581 dev_info(dev, "n = %u cts = %u\n", it6616->ainfo.n, it6616->ainfo.cts); in it6616_hdmi_tx_audio_setup()
2582 dev_info(dev, "tmds clock = %d kHz\n", it6616->vinfo.TMDSCLK); in it6616_hdmi_tx_audio_setup()
2584 it6616->ainfo.channel_status); in it6616_hdmi_tx_audio_setup()
2586 it6616->ainfo.sample_freq, (sum % cts_128) * 100 / cts_128); in it6616_hdmi_tx_audio_setup()
2588 if (it6616->ainfo.sample_freq > 25 && it6616->ainfo.sample_freq <= 38) in it6616_hdmi_tx_audio_setup()
2589 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_32K; in it6616_hdmi_tx_audio_setup()
2590 else if (it6616->ainfo.sample_freq > 38 && it6616->ainfo.sample_freq <= 45) in it6616_hdmi_tx_audio_setup()
2591 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_44P1K; in it6616_hdmi_tx_audio_setup()
2592 else if (it6616->ainfo.sample_freq > 45 && it6616->ainfo.sample_freq <= 58) in it6616_hdmi_tx_audio_setup()
2593 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_48K; in it6616_hdmi_tx_audio_setup()
2594 else if (it6616->ainfo.sample_freq > 58 && it6616->ainfo.sample_freq <= 78) in it6616_hdmi_tx_audio_setup()
2595 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_64K; in it6616_hdmi_tx_audio_setup()
2596 else if (it6616->ainfo.sample_freq > 78 && it6616->ainfo.sample_freq <= 91) in it6616_hdmi_tx_audio_setup()
2597 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_88P2K; in it6616_hdmi_tx_audio_setup()
2598 else if (it6616->ainfo.sample_freq > 91 && it6616->ainfo.sample_freq <= 106) in it6616_hdmi_tx_audio_setup()
2599 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_96K; in it6616_hdmi_tx_audio_setup()
2600 else if (it6616->ainfo.sample_freq > 106 && it6616->ainfo.sample_freq <= 166) in it6616_hdmi_tx_audio_setup()
2601 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_128K; in it6616_hdmi_tx_audio_setup()
2602 else if (it6616->ainfo.sample_freq > 166 && it6616->ainfo.sample_freq <= 182) in it6616_hdmi_tx_audio_setup()
2603 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_176P4K; in it6616_hdmi_tx_audio_setup()
2604 else if (it6616->ainfo.sample_freq > 182 && it6616->ainfo.sample_freq <= 202) in it6616_hdmi_tx_audio_setup()
2605 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_192K; in it6616_hdmi_tx_audio_setup()
2606 else if (it6616->ainfo.sample_freq > 224 && it6616->ainfo.sample_freq <= 320) in it6616_hdmi_tx_audio_setup()
2607 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_256K; in it6616_hdmi_tx_audio_setup()
2608 else if (it6616->ainfo.sample_freq > 320 && it6616->ainfo.sample_freq <= 448) in it6616_hdmi_tx_audio_setup()
2609 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_384K; in it6616_hdmi_tx_audio_setup()
2610 else if (it6616->ainfo.sample_freq > 448 && it6616->ainfo.sample_freq <= 638) in it6616_hdmi_tx_audio_setup()
2611 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_512K; in it6616_hdmi_tx_audio_setup()
2612 else if (it6616->ainfo.sample_freq > 638 && it6616->ainfo.sample_freq <= 894) in it6616_hdmi_tx_audio_setup()
2613 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_768K; in it6616_hdmi_tx_audio_setup()
2614 else if (it6616->ainfo.sample_freq > 894 && it6616->ainfo.sample_freq <= 1324) in it6616_hdmi_tx_audio_setup()
2615 it6616->ainfo.force_sample_freq = AUDIO_SAMPLING_1024K; in it6616_hdmi_tx_audio_setup()
2617 dev_info(dev, "Sampling_Frequency value 0x%02x", it6616->ainfo.force_sample_freq); in it6616_hdmi_tx_audio_setup()
2619 if (it6616->ainfo.channel_status == it6616->ainfo.force_sample_freq) { in it6616_hdmi_tx_audio_setup()
2624 it6616_hdmi_rx_reset_audio_logic(it6616); in it6616_hdmi_tx_audio_setup()
2626 it6616->audio_sampling_freq_error_count = 0; in it6616_hdmi_tx_audio_setup()
2630 it6616->audio_sampling_freq_error_count++; in it6616_hdmi_tx_audio_setup()
2632 (int) it6616->audio_sampling_freq_error_count); in it6616_hdmi_tx_audio_setup()
2635 if (it6616->audio_sampling_freq_error_count > MAX_AUDIO_SAMPLING_FREQ_ERROR_COUNT) { in it6616_hdmi_tx_audio_setup()
2638 it6616_hdmi_set(hdmi, 0x8A, 0x3F, it6616->ainfo.force_sample_freq); in it6616_hdmi_tx_audio_setup()
2641 if (it6616->ainfo.sample_freq <= 182) { in it6616_hdmi_tx_audio_setup()
2649 it6616->audio_sampling_freq_error_count = 0; in it6616_hdmi_tx_audio_setup()
2650 it6616_hdmi_rx_reset_audio_logic(it6616); in it6616_hdmi_tx_audio_setup()
2654 static void it6616_hdmi_tx_audio_output_enable(struct it6616 *it6616, u8 output_interface) in it6616_hdmi_tx_audio_output_enable() argument
2656 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_tx_audio_output_enable()
2657 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_tx_audio_output_enable()
2677 static void it6616_hdmi_audio_mute_clear(struct it6616 *it6616) in it6616_hdmi_audio_mute_clear() argument
2679 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_audio_mute_clear()
2686 static void it6616_hdmi_rx_audio_process(struct it6616 *it6616) in it6616_hdmi_rx_audio_process() argument
2688 it6616_hdmi_tx_audio_output_enable(it6616, AUDIO_OFF); in it6616_hdmi_rx_audio_process()
2689 it6616_hdmi_rx_reset_audio_logic(it6616); in it6616_hdmi_rx_audio_process()
2690 it6616_hdmi_tx_audio_setup(it6616); in it6616_hdmi_rx_audio_process()
2691 it6616_hdmi_audio_mute_clear(it6616); in it6616_hdmi_rx_audio_process()
2692 it6616_hdmi_tx_audio_output_enable(it6616, it6616->audio_interface); in it6616_hdmi_rx_audio_process()
2695 static void it6616_hdmi_initial(struct it6616 *it6616) in it6616_hdmi_initial() argument
2697 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_initial()
2698 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_initial()
2703 it6616_hdmi_update_rs(it6616, DEFAULT_RS_LEVEL); in it6616_hdmi_initial()
2704 it6616_hdmi_set(hdmi, 0x67, BIT(7), it6616->hdmi_rx_disable_pixel_repeat << 7); in it6616_hdmi_initial()
2706 it6616->hdmi_rx_video_stable_condition << 5); in it6616_hdmi_initial()
2712 static void it6616_hdmi_irq_color_depth(struct it6616 *it6616) in it6616_hdmi_irq_color_depth() argument
2714 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_irq_color_depth()
2715 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_irq_color_depth()
2722 static void it6616_hdmi_irq_new_avi_infoframe(struct it6616 *it6616) in it6616_hdmi_irq_new_avi_infoframe() argument
2727 if (it6616_hdmi_update_avi_infoframe(it6616) == 0) { in it6616_hdmi_irq_new_avi_infoframe()
2728 avi_new = &it6616->avi_if; in it6616_hdmi_irq_new_avi_infoframe()
2729 avi_prev = &it6616->avi_if_prev; in it6616_hdmi_irq_new_avi_infoframe()
2730 hdmi_infoframe_log(KERN_INFO, &it6616->hdmi_i2c->dev, in it6616_hdmi_irq_new_avi_infoframe()
2740 static void it6616_hdmi_hpd_trun_on(struct it6616 *it6616) in it6616_hdmi_hpd_trun_on() argument
2742 it6616_hdmi_edid_ram_enable(it6616, 1); in it6616_hdmi_hpd_trun_on()
2743 it6616_hdmi_video_reset(it6616); in it6616_hdmi_hpd_trun_on()
2744 it6616_hdmi_rx_reset_audio_logic(it6616); in it6616_hdmi_hpd_trun_on()
2745 it6616_hdmi_hpd_output(it6616, true); in it6616_hdmi_hpd_trun_on()
2748 static void it6616_hdmi_hpd_trun_off(struct it6616 *it6616) in it6616_hdmi_hpd_trun_off() argument
2750 it6616_hdmi_hpd_output(it6616, false); in it6616_hdmi_hpd_trun_off()
2751 it6616_hdmi_edid_ram_enable(it6616, 0); in it6616_hdmi_hpd_trun_off()
2754 static void it6616_mipitx_irq(struct it6616 *it6616) in it6616_mipitx_irq() argument
2756 struct regmap *mipi = it6616->mipi_regmap; in it6616_mipitx_irq()
2757 struct device *dev = &it6616->mipi_i2c->dev; in it6616_mipitx_irq()
2768 it6616->mipi_tx_video_stable = it6616_mipi_tx_get_video_stable(it6616); in it6616_mipitx_irq()
2771 reg09h, it6616->mipi_tx_video_stable ? "" : "un"); in it6616_mipitx_irq()
2773 if (it6616->mipi_tx_video_stable) { in it6616_mipitx_irq()
2774 it6616_mipi_tx_calc_rclk(it6616); in it6616_mipitx_irq()
2775 it6616_mipi_tx_calc_mclk(it6616); in it6616_mipitx_irq()
2776 it6616_mipi_tx_calc_pclk(it6616); in it6616_mipitx_irq()
2788 static void it6616_hdmi_irq(struct it6616 *it6616) in it6616_hdmi_irq() argument
2790 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_hdmi_irq()
2791 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_hdmi_irq()
2825 it6616_hdmi_hdcp_reset(it6616); in it6616_hdmi_irq()
2833 if (it6616_hdmi_is_clock_stable(it6616)) in it6616_hdmi_irq()
2844 it6616_hdmi_hdcp_reset(it6616); in it6616_hdmi_irq()
2845 if (it6616_hdmi_is_5v_on(it6616)) in it6616_hdmi_irq()
2846 it6616_hdmi_hpd_trun_on(it6616); in it6616_hdmi_irq()
2848 it6616_hdmi_hpd_trun_off(it6616); in it6616_hdmi_irq()
2876 it6616->hdmi_rx_hdcp_state = true; in it6616_hdmi_irq()
2879 it6616->hdmi_rx_hdcp_state = it6616_get_hdcp_status(it6616); in it6616_hdmi_irq()
2882 it6616->hdmi_rx_hdcp_state ? "ON" : "OFF"); in it6616_hdmi_irq()
2886 it6616->hdmi_rx_hdcp_state = false; in it6616_hdmi_irq()
2897 it6616_hdmi_rx_calc_tmds_clk(it6616, 5); in it6616_hdmi_irq()
2898 it6616_hdmi_rx_calc_pclk(it6616); in it6616_hdmi_irq()
2899 it6616_hdmi_rx_get_video_info(it6616); in it6616_hdmi_irq()
2919 it6616_hdmi_irq_new_avi_infoframe(it6616); in it6616_hdmi_irq()
2920 it6616_hdmi_rx_setup_csc(it6616); in it6616_hdmi_irq()
2927 it6616_hdmi_rx_audio_process(it6616); in it6616_hdmi_irq()
2934 it6616_hdmi_rx_set_av_mute(it6616, AV_MUTE_OFF); in it6616_hdmi_irq()
2938 it6616_hdmi_rx_set_av_mute(it6616, AV_MUTE_ON); in it6616_hdmi_irq()
2945 it6616->hdmi_rx_video_stable = it6616_hdmi_is_scdt_on(it6616); in it6616_hdmi_irq()
2946 dev_info(dev, "SCDT %s", it6616->hdmi_rx_video_stable ? "ON" : "OFF"); in it6616_hdmi_irq()
2948 if (it6616->hdmi_rx_video_stable) { in it6616_hdmi_irq()
2949 it6616_hdmi_rx_calc_tmds_clk(it6616, 5); in it6616_hdmi_irq()
2950 it6616_hdmi_rx_calc_pclk(it6616); in it6616_hdmi_irq()
2951 it6616_hdmi_rx_get_video_info(it6616); in it6616_hdmi_irq()
2952 it6616_hdmi_rx_audio_process(it6616); in it6616_hdmi_irq()
2954 it6616_mipi_tx_get_support_format(it6616); in it6616_hdmi_irq()
2955 it6616_enable_mipi(it6616); in it6616_hdmi_irq()
2957 it6616_disable_mipi(it6616); in it6616_hdmi_irq()
2971 it6616_hdmi_irq_color_depth(it6616); in it6616_hdmi_irq()
3001 static int it6616_get_chip_id(struct it6616 *it6616) in it6616_get_chip_id() argument
3003 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_get_chip_id()
3004 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_get_chip_id()
3020 static void it6616_poll_threaded_handler(struct it6616 *it6616) in it6616_poll_threaded_handler() argument
3022 struct regmap *hdmi = it6616->hdmi_regmap; in it6616_poll_threaded_handler()
3026 current_mute_state = it6616_hdmi_rx_get_av_mute_state(it6616); in it6616_poll_threaded_handler()
3029 it6616_hdmi_rx_set_av_mute(it6616, current_mute_state); in it6616_poll_threaded_handler()
3034 struct it6616 *it6616 = (struct it6616 *)data; in it6616_intp_threaded_handler() local
3036 mutex_lock(&it6616->confctl_mutex); in it6616_intp_threaded_handler()
3038 it6616_hdmi_irq(it6616); in it6616_intp_threaded_handler()
3039 it6616_mipitx_irq(it6616); in it6616_intp_threaded_handler()
3041 mutex_unlock(&it6616->confctl_mutex); in it6616_intp_threaded_handler()
3046 static int it6616_initial(struct it6616 *it6616) in it6616_initial() argument
3048 struct device *dev = &it6616->hdmi_i2c->dev; in it6616_initial()
3050 mutex_lock(&it6616->confctl_mutex); in it6616_initial()
3053 if (it6616_get_chip_id(it6616)) { in it6616_initial()
3059 it6616->edid_len = sizeof(default_edid); in it6616_initial()
3060 memcpy(it6616->edid_data, default_edid, it6616->edid_len); in it6616_initial()
3063 it6616->mipi.bus_type = MIPI_TX_INTERFACE; in it6616_initial()
3064 it6616->mipi.lane_cnt = it6616->csi_lanes_in_use; in it6616_initial()
3065 it6616->mipi.data_type = MIPI_TX_DATA_TYPE; in it6616_initial()
3067 it6616->mipi_tx_enable_auto_adjust_lane_count = in it6616_initial()
3069 it6616->mipi_tx_enable_h_fire_packet = in it6616_initial()
3071 it6616->mipi_tx_enable_initial_fire_lp_cmd = in it6616_initial()
3074 it6616->rs_level = DEFAULT_RS_LEVEL; in it6616_initial()
3075 it6616->audio_interface = AUDIO_I2S; in it6616_initial()
3076 it6616->audio_i2s_justified = AUDIO_I2S_JUSTIFIED; in it6616_initial()
3077 it6616->hdmi_rx_disable_pixel_repeat = in it6616_initial()
3079 it6616->hdmi_rx_video_stable_condition = in it6616_initial()
3081 it6616->mipi_tx_enable_continuous_clock = in it6616_initial()
3083 it6616->mipi_tx_enable_manual_adjusted_d_phy = in it6616_initial()
3085 it6616->hdmi_rx_video_stable = false; in it6616_initial()
3086 it6616->mipi_tx_video_stable = false; in it6616_initial()
3087 it6616->hdmi_rx_hdcp_state = false; in it6616_initial()
3088 it6616->mipi_tx_enable_mipi_output = false; in it6616_initial()
3090 it6616_hdmi_rx_calc_rclk(it6616); in it6616_initial()
3092 it6616_hdmi_initial(it6616); in it6616_initial()
3093 it6616_hdmi_edid_ram_init(it6616); in it6616_initial()
3094 it6616_mipitx_init_bus_para(it6616); in it6616_initial()
3095 it6616_mipitx_initial(it6616); in it6616_initial()
3097 mutex_unlock(&it6616->confctl_mutex); in it6616_initial()
3102 static __maybe_unused void it6616_set_hpd(struct it6616 *it6616, u8 hpd) in it6616_set_hpd() argument
3104 mutex_lock(&it6616->confctl_mutex); in it6616_set_hpd()
3107 it6616_hdmi_hpd_trun_on(it6616); in it6616_set_hpd()
3109 it6616_hdmi_hpd_trun_off(it6616); in it6616_set_hpd()
3111 mutex_unlock(&it6616->confctl_mutex); in it6616_set_hpd()
3114 static __maybe_unused void it6616_update_edid_data(struct it6616 *it6616, u8 *edid, int edid_len) in it6616_update_edid_data() argument
3116 mutex_lock(&it6616->confctl_mutex); in it6616_update_edid_data()
3118 memcpy(it6616->edid_data, edid, it6616->edid_len); in it6616_update_edid_data()
3119 it6616->edid_len = edid_len; in it6616_update_edid_data()
3120 it6616_hdmi_edid_ram_init(it6616); in it6616_update_edid_data()
3122 mutex_unlock(&it6616->confctl_mutex); in it6616_update_edid_data()
3199 struct it6616 *it6616 = dev_get_drvdata(dev); in edid_ram_show() local
3203 dev_info(dev, "%s(%x)\n", __func__, it6616->attr_hdmi_reg_bank); in edid_ram_show()
3205 mutex_lock(&it6616->confctl_mutex); in edid_ram_show()
3206 it6616_hdmi_edid_ram_get(it6616, reg_buf); in edid_ram_show()
3207 mutex_unlock(&it6616->confctl_mutex); in edid_ram_show()
3215 struct it6616 *it6616 = dev_get_drvdata(dev); in hdmi_reg_store() local
3221 it6616->attr_hdmi_reg_bank = (u8) reg_bank; in hdmi_reg_store()
3224 __func__, reg_bank, it6616->attr_hdmi_reg_bank); in hdmi_reg_store()
3233 struct it6616 *it6616 = dev_get_drvdata(dev); in hdmi_reg_show() local
3234 struct regmap *hdmi = it6616->hdmi_regmap; in hdmi_reg_show()
3238 dev_info(dev, "%s(%x)\n", __func__, it6616->attr_hdmi_reg_bank); in hdmi_reg_show()
3240 mutex_lock(&it6616->confctl_mutex); in hdmi_reg_show()
3241 it6616_hdmi_chgbank(hdmi, it6616->attr_hdmi_reg_bank); in hdmi_reg_show()
3246 mutex_unlock(&it6616->confctl_mutex); in hdmi_reg_show()
3254 struct it6616 *it6616 = dev_get_drvdata(dev); in mipi_reg_show() local
3255 struct regmap *mipi = it6616->mipi_regmap; in mipi_reg_show()
3259 mutex_lock(&it6616->confctl_mutex); in mipi_reg_show()
3263 mutex_unlock(&it6616->confctl_mutex); in mipi_reg_show()
3271 struct it6616 *it6616 = dev_get_drvdata(dev); in mipi_reg_store() local
3272 struct regmap *mipi = it6616->mipi_regmap; in mipi_reg_store()
3302 struct it6616 *it6616 = to_it6616(sd); in tx_5v_power_present() local
3304 return it6616_hdmi_is_5v_on(it6616); in tx_5v_power_present()
3309 struct it6616 *it6616 = to_it6616(sd); in no_signal() local
3312 it6616->nosignal); in no_signal()
3314 return it6616->nosignal; in no_signal()
3319 struct it6616 *it6616 = to_it6616(sd); in audio_present() local
3321 return it6616->is_audio_present; in audio_present()
3326 struct it6616 *it6616 = to_it6616(sd); in get_audio_sampling_rate() local
3331 return code_to_rate_table[it6616->ainfo.force_sample_freq]; in get_audio_sampling_rate()
3367 struct it6616 *it6616 = to_it6616(sd); in it6616_get_detected_timings() local
3372 it6616_hdmi_rx_get_video_info(it6616); in it6616_get_detected_timings()
3374 it6616->nosignal = false; in it6616_get_detected_timings()
3375 it6616->is_audio_present = tx_5v_power_present(sd) ? true : false; in it6616_get_detected_timings()
3377 bt->interlaced = it6616->vinfo.interlaced; in it6616_get_detected_timings()
3378 bt->width = it6616->vinfo.h_active; in it6616_get_detected_timings()
3379 bt->height = it6616->vinfo.v_active; in it6616_get_detected_timings()
3380 bt->vsync = it6616->vinfo.v_sync_w; in it6616_get_detected_timings()
3381 bt->hsync = it6616->vinfo.h_sync_w; in it6616_get_detected_timings()
3382 bt->pixelclock = it6616->vinfo.pclk * 1000; in it6616_get_detected_timings()
3383 bt->hfrontporch = it6616->vinfo.h_front_porch; in it6616_get_detected_timings()
3384 bt->vfrontporch = it6616->vinfo.v_front_porch; in it6616_get_detected_timings()
3385 bt->hbackporch = it6616->vinfo.h_back_porch; in it6616_get_detected_timings()
3386 bt->vbackporch = it6616->vinfo.v_back_porch; in it6616_get_detected_timings()
3387 htotal = it6616->vinfo.h_total; in it6616_get_detected_timings()
3388 vtotal = it6616->vinfo.v_total; in it6616_get_detected_timings()
3390 if (it6616->avi_if.colorspace == HDMI_COLORSPACE_YUV420) { in it6616_get_detected_timings()
3391 bt->width = it6616->vinfo.h_active * 2; in it6616_get_detected_timings()
3392 bt->hfrontporch = it6616->vinfo.h_front_porch * 2; in it6616_get_detected_timings()
3393 bt->hbackporch = it6616->vinfo.h_back_porch * 2; in it6616_get_detected_timings()
3394 bt->hsync = it6616->vinfo.h_sync_w * 2; in it6616_get_detected_timings()
3395 htotal = it6616->vinfo.h_total * 2; in it6616_get_detected_timings()
3401 it6616->nosignal = true; in it6616_get_detected_timings()
3424 struct it6616 *it6616 = to_it6616(sd); in it6616_s_ctrl_detect_tx_5v() local
3426 return v4l2_ctrl_s_ctrl(it6616->detect_tx_5v_ctrl, in it6616_s_ctrl_detect_tx_5v()
3432 struct it6616 *it6616 = to_it6616(sd); in it6616_s_ctrl_audio_sampling_rate() local
3434 return v4l2_ctrl_s_ctrl(it6616->audio_sampling_rate_ctrl, in it6616_s_ctrl_audio_sampling_rate()
3440 struct it6616 *it6616 = to_it6616(sd); in it6616_s_ctrl_audio_present() local
3442 return v4l2_ctrl_s_ctrl(it6616->audio_present_ctrl, in it6616_s_ctrl_audio_present()
3481 struct it6616 *it6616 = to_it6616(sd); in it6616_format_change() local
3490 if (!it6616_match_dv_timings(&it6616->timings, &timings)) { in it6616_format_change()
3503 struct it6616 *it6616 = to_it6616(sd); in it6616_isr() local
3508 it6616_poll_threaded_handler(it6616); in it6616_isr()
3509 it6616_intp_threaded_handler(0, it6616); in it6616_isr()
3513 it6616->nosignal = true; in it6616_isr()
3524 struct it6616 *it6616 = to_it6616(sd); in it6616_detect_hot_plug() local
3526 if (it6616->mipi_tx_video_stable && it6616_hdmi_is_5v_on(it6616)) in it6616_detect_hot_plug()
3527 v4l2_ctrl_s_ctrl(it6616->detect_tx_5v_ctrl, 1); in it6616_detect_hot_plug()
3529 v4l2_ctrl_s_ctrl(it6616->detect_tx_5v_ctrl, 0); in it6616_detect_hot_plug()
3535 struct it6616 *it6616 = container_of(dwork, in it6616_work_i2c_poll() local
3536 struct it6616, work_i2c_poll); in it6616_work_i2c_poll()
3539 it6616_isr(&it6616->sd, 0, &handled); in it6616_work_i2c_poll()
3540 it6616_detect_hot_plug(&it6616->sd); in it6616_work_i2c_poll()
3541 schedule_delayed_work(&it6616->work_i2c_poll, in it6616_work_i2c_poll()
3571 struct it6616 *it6616 = to_it6616(sd); in it6616_s_dv_timings() local
3580 if (v4l2_match_dv_timings(&it6616->timings, timings, 0, false)) { in it6616_s_dv_timings()
3591 it6616->timings = *timings; in it6616_s_dv_timings()
3599 struct it6616 *it6616 = to_it6616(sd); in it6616_g_dv_timings() local
3601 *timings = it6616->timings; in it6616_g_dv_timings()
3619 struct it6616 *it6616 = to_it6616(sd); in it6616_query_dv_timings() local
3621 *timings = it6616->timings; in it6616_query_dv_timings()
3651 struct it6616 *it6616 = to_it6616(sd); in it6616_g_mbus_config() local
3657 switch (it6616->csi_lanes_in_use) { in it6616_g_mbus_config()
3678 static int __it6616_start_stream(struct it6616 *it6616) in __it6616_start_stream() argument
3680 it6616_mipitx_output_disable(it6616); in __it6616_start_stream()
3682 it6616_mipi_tx_output_enable(it6616); in __it6616_start_stream()
3687 static int __it6616_stop_stream(struct it6616 *it6616) in __it6616_stop_stream() argument
3689 it6616_mipitx_output_disable(it6616); in __it6616_stop_stream()
3696 struct it6616 *it6616 = to_it6616(sd); in it6616_s_stream() local
3697 struct i2c_client *client = it6616->i2c_client; in it6616_s_stream()
3701 it6616->cur_mode->width, in it6616_s_stream()
3702 it6616->cur_mode->height, in it6616_s_stream()
3703 DIV_ROUND_CLOSEST(it6616->cur_mode->max_fps.denominator, in it6616_s_stream()
3704 it6616->cur_mode->max_fps.numerator)); in it6616_s_stream()
3706 mutex_lock(&it6616->confctl_mutex); in it6616_s_stream()
3710 ret = __it6616_start_stream(it6616); in it6616_s_stream()
3712 dev_err(it6616->dev, "Failed to start it6616 stream\n"); in it6616_s_stream()
3716 __it6616_stop_stream(it6616); in it6616_s_stream()
3721 mutex_unlock(&it6616->confctl_mutex); in it6616_s_stream()
3763 struct it6616 *it6616 = to_it6616(sd); in it6616_get_fmt() local
3765 mutex_lock(&it6616->confctl_mutex); in it6616_get_fmt()
3766 format->format.code = it6616->mbus_fmt_code; in it6616_get_fmt()
3767 format->format.width = it6616->timings.bt.width; in it6616_get_fmt()
3768 format->format.height = it6616->timings.bt.height; in it6616_get_fmt()
3770 it6616->timings.bt.interlaced ? in it6616_get_fmt()
3773 mutex_unlock(&it6616->confctl_mutex); in it6616_get_fmt()
3829 struct it6616 *it6616 = to_it6616(sd); in it6616_set_fmt() local
3852 it6616->mbus_fmt_code = format->format.code; in it6616_set_fmt()
3854 it6616->cur_mode = mode; in it6616_set_fmt()
3862 struct it6616 *it6616 = to_it6616(sd); in it6616_g_frame_interval() local
3863 const struct it6616_mode *mode = it6616->cur_mode; in it6616_g_frame_interval()
3865 mutex_lock(&it6616->confctl_mutex); in it6616_g_frame_interval()
3867 mutex_unlock(&it6616->confctl_mutex); in it6616_g_frame_interval()
3872 static void it6616_get_module_inf(struct it6616 *it6616, in it6616_get_module_inf() argument
3877 strscpy(inf->base.module, it6616->module_name, sizeof(inf->base.module)); in it6616_get_module_inf()
3878 strscpy(inf->base.lens, it6616->len_name, sizeof(inf->base.lens)); in it6616_get_module_inf()
3883 struct it6616 *it6616 = to_it6616(sd); in it6616_ioctl() local
3888 it6616_get_module_inf(it6616, (struct rkmodule_inf *)arg); in it6616_ioctl()
3903 struct it6616 *it6616 = to_it6616(sd); in it6616_s_power() local
3906 mutex_lock(&it6616->confctl_mutex); in it6616_s_power()
3908 if (it6616->power_on == !!on) in it6616_s_power()
3912 it6616->power_on = true; in it6616_s_power()
3914 it6616->power_on = false; in it6616_s_power()
3917 mutex_unlock(&it6616->confctl_mutex); in it6616_s_power()
3974 struct it6616 *it6616 = to_it6616(sd); in it6616_open() local
3979 mutex_lock(&it6616->confctl_mutex); in it6616_open()
3985 mutex_unlock(&it6616->confctl_mutex); in it6616_open()
4056 static void it6616_reset(struct it6616 *it6616) in it6616_reset() argument
4058 gpiod_set_value(it6616->reset_gpio, 0); in it6616_reset()
4060 gpiod_set_value(it6616->reset_gpio, 1); in it6616_reset()
4062 gpiod_set_value(it6616->reset_gpio, 0); in it6616_reset()
4066 static int it6616_init_v4l2_ctrls(struct it6616 *it6616) in it6616_init_v4l2_ctrls() argument
4071 sd = &it6616->sd; in it6616_init_v4l2_ctrls()
4072 ret = v4l2_ctrl_handler_init(&it6616->hdl, 5); in it6616_init_v4l2_ctrls()
4076 it6616->link_freq = v4l2_ctrl_new_int_menu(&it6616->hdl, NULL, in it6616_init_v4l2_ctrls()
4080 it6616->pixel_rate = v4l2_ctrl_new_std(&it6616->hdl, NULL, in it6616_init_v4l2_ctrls()
4084 it6616->detect_tx_5v_ctrl = v4l2_ctrl_new_std(&it6616->hdl, in it6616_init_v4l2_ctrls()
4088 it6616->audio_sampling_rate_ctrl = in it6616_init_v4l2_ctrls()
4089 v4l2_ctrl_new_custom(&it6616->hdl, in it6616_init_v4l2_ctrls()
4091 it6616->audio_present_ctrl = v4l2_ctrl_new_custom(&it6616->hdl, in it6616_init_v4l2_ctrls()
4094 sd->ctrl_handler = &it6616->hdl; in it6616_init_v4l2_ctrls()
4095 if (it6616->hdl.error) { in it6616_init_v4l2_ctrls()
4096 ret = it6616->hdl.error; in it6616_init_v4l2_ctrls()
4101 __v4l2_ctrl_s_ctrl(it6616->link_freq, link_freq_menu_items[0]); in it6616_init_v4l2_ctrls()
4102 __v4l2_ctrl_s_ctrl_int64(it6616->pixel_rate, IT6616_PIXEL_RATE); in it6616_init_v4l2_ctrls()
4114 static int it6616_probe_of(struct it6616 *it6616) in it6616_probe_of() argument
4116 struct device *dev = &it6616->i2c_client->dev; in it6616_probe_of()
4123 &it6616->module_index); in it6616_probe_of()
4125 &it6616->module_facing); in it6616_probe_of()
4127 &it6616->module_name); in it6616_probe_of()
4129 &it6616->len_name); in it6616_probe_of()
4135 it6616->power_gpio = devm_gpiod_get_optional(dev, "power", in it6616_probe_of()
4137 if (IS_ERR(it6616->power_gpio)) { in it6616_probe_of()
4139 ret = PTR_ERR(it6616->power_gpio); in it6616_probe_of()
4143 it6616->reset_gpio = devm_gpiod_get_optional(dev, "reset", in it6616_probe_of()
4145 if (IS_ERR(it6616->reset_gpio)) { in it6616_probe_of()
4147 ret = PTR_ERR(it6616->reset_gpio); in it6616_probe_of()
4170 it6616->xvclk = devm_clk_get(dev, "xvclk"); in it6616_probe_of()
4171 if (IS_ERR(it6616->xvclk)) { in it6616_probe_of()
4177 ret = clk_prepare_enable(it6616->xvclk); in it6616_probe_of()
4183 it6616->csi_lanes_in_use = endpoint.bus.mipi_csi2.num_data_lanes; in it6616_probe_of()
4184 it6616->bus = endpoint.bus.mipi_csi2; in it6616_probe_of()
4186 gpiod_set_value(it6616->power_gpio, 1); in it6616_probe_of()
4187 it6616_reset(it6616); in it6616_probe_of()
4198 static inline int it6616_probe_of(struct it6616 *state) in it6616_probe_of()
4207 struct it6616 *it6616 = g_it6616; in audio_present_show() local
4210 tx_5v_power_present(&it6616->sd) ? 1 : 0); in audio_present_show()
4216 struct it6616 *it6616 = g_it6616; in audio_rate_show() local
4219 code_to_rate_table[it6616->ainfo.force_sample_freq]); in audio_rate_show()
4225 static int it6616_create_class_attr(struct it6616 *it6616) in it6616_create_class_attr() argument
4229 it6616->hdmirx_class = class_create(THIS_MODULE, "hdmirx_it6616"); in it6616_create_class_attr()
4230 if (IS_ERR(it6616->hdmirx_class)) { in it6616_create_class_attr()
4232 dev_err(it6616->dev, "failed to create hdmirx_it6616 class!\n"); in it6616_create_class_attr()
4236 it6616->classdev = device_create(it6616->hdmirx_class, NULL, in it6616_create_class_attr()
4238 if (IS_ERR(it6616->classdev)) { in it6616_create_class_attr()
4239 ret = PTR_ERR(it6616->classdev); in it6616_create_class_attr()
4240 dev_err(it6616->dev, "Failed to create device\n"); in it6616_create_class_attr()
4244 ret = device_create_file(it6616->classdev, in it6616_create_class_attr()
4247 dev_err(it6616->dev, "failed to create attr audio_present!\n"); in it6616_create_class_attr()
4251 ret = device_create_file(it6616->classdev, in it6616_create_class_attr()
4254 dev_err(it6616->dev, in it6616_create_class_attr()
4262 device_remove_file(it6616->classdev, &dev_attr_audio_present); in it6616_create_class_attr()
4264 class_destroy(it6616->hdmirx_class); in it6616_create_class_attr()
4268 static void it6616_remove_class_attr(struct it6616 *it6616) in it6616_remove_class_attr() argument
4270 device_remove_file(it6616->classdev, &dev_attr_audio_rate); in it6616_remove_class_attr()
4271 device_remove_file(it6616->classdev, &dev_attr_audio_present); in it6616_remove_class_attr()
4272 class_destroy(it6616->hdmirx_class); in it6616_remove_class_attr()
4278 struct it6616 *it6616; in it6616_probe() local
4289 it6616 = devm_kzalloc(dev, sizeof(struct it6616), GFP_KERNEL); in it6616_probe()
4290 if (!it6616) in it6616_probe()
4293 sd = &it6616->sd; in it6616_probe()
4294 it6616->hdmi_i2c = client; in it6616_probe()
4295 it6616->mipi_i2c = i2c_new_dummy_device(client->adapter, in it6616_probe()
4298 if (!it6616->mipi_i2c) in it6616_probe()
4301 it6616->edid_i2c = i2c_new_dummy_device(client->adapter, in it6616_probe()
4304 if (!it6616->edid_i2c) in it6616_probe()
4307 it6616->hdmi_regmap = devm_regmap_init_i2c(client, in it6616_probe()
4309 if (IS_ERR(it6616->hdmi_i2c)) { in it6616_probe()
4310 err = PTR_ERR(it6616->hdmi_i2c); in it6616_probe()
4314 it6616->mipi_regmap = devm_regmap_init_i2c(it6616->mipi_i2c, in it6616_probe()
4316 if (IS_ERR(it6616->mipi_regmap)) { in it6616_probe()
4317 err = PTR_ERR(it6616->mipi_regmap); in it6616_probe()
4321 it6616->edid_regmap = devm_regmap_init_i2c(it6616->edid_i2c, in it6616_probe()
4323 if (IS_ERR(it6616->edid_regmap)) { in it6616_probe()
4324 err = PTR_ERR(it6616->edid_regmap); in it6616_probe()
4328 it6616->dev = dev; in it6616_probe()
4329 it6616->cur_mode = &supported_modes[0]; in it6616_probe()
4330 it6616->i2c_client = client; in it6616_probe()
4331 it6616->mbus_fmt_code = IT6616_MEDIA_BUS_FMT; in it6616_probe()
4332 err = it6616_probe_of(it6616); in it6616_probe()
4337 it6616_reset(it6616); in it6616_probe()
4339 mutex_init(&it6616->confctl_mutex); in it6616_probe()
4341 err = it6616_initial(it6616); in it6616_probe()
4354 i2c_set_clientdata(client, it6616); in it6616_probe()
4357 err = it6616_init_v4l2_ctrls(it6616); in it6616_probe()
4369 it6616->pad.flags = MEDIA_PAD_FL_SOURCE; in it6616_probe()
4371 err = media_entity_pads_init(&sd->entity, 1, &it6616->pad); in it6616_probe()
4378 if (strcmp(it6616->module_facing, "back") == 0) in it6616_probe()
4384 it6616->module_index, facing, in it6616_probe()
4392 err = it6616_create_class_attr(it6616); in it6616_probe()
4394 dev_err(it6616->dev, "create class attr failed! err:%d\n", err); in it6616_probe()
4398 INIT_DELAYED_WORK(&it6616->work_i2c_poll, it6616_work_i2c_poll); in it6616_probe()
4399 schedule_delayed_work(&it6616->work_i2c_poll, msecs_to_jiffies(500)); in it6616_probe()
4408 g_it6616 = it6616; in it6616_probe()
4413 cancel_delayed_work_sync(&it6616->work_i2c_poll); in it6616_probe()
4419 v4l2_ctrl_handler_free(&it6616->hdl); in it6616_probe()
4420 mutex_destroy(&it6616->confctl_mutex); in it6616_probe()
4422 i2c_unregister_device(it6616->edid_i2c); in it6616_probe()
4424 i2c_unregister_device(it6616->mipi_i2c); in it6616_probe()
4432 struct it6616 *it6616 = to_it6616(sd); in it6616_remove() local
4434 cancel_delayed_work_sync(&it6616->work_i2c_poll); in it6616_remove()
4435 it6616_remove_class_attr(it6616); in it6616_remove()
4441 v4l2_ctrl_handler_free(&it6616->hdl); in it6616_remove()
4443 mutex_destroy(&it6616->confctl_mutex); in it6616_remove()
4445 i2c_unregister_device(it6616->mipi_i2c); in it6616_remove()
4446 i2c_unregister_device(it6616->edid_i2c); in it6616_remove()
4447 clk_disable_unprepare(it6616->xvclk); in it6616_remove()