Lines Matching full:lt9611

31 struct lt9611 {  struct
103 static struct lt9611 *bridge_to_lt9611(struct drm_bridge *bridge) in bridge_to_lt9611()
105 return container_of(bridge, struct lt9611, bridge); in bridge_to_lt9611()
108 static struct lt9611 *connector_to_lt9611(struct drm_connector *connector) in connector_to_lt9611()
110 return container_of(connector, struct lt9611, connector); in connector_to_lt9611()
113 static int lt9611_mipi_input_analog(struct lt9611 *lt9611) in lt9611_mipi_input_analog() argument
127 return regmap_multi_reg_write(lt9611->regmap, reg_cfg, ARRAY_SIZE(reg_cfg)); in lt9611_mipi_input_analog()
130 static int lt9611_mipi_input_digital(struct lt9611 *lt9611, in lt9611_mipi_input_digital() argument
145 return regmap_multi_reg_write(lt9611->regmap, reg_cfg, ARRAY_SIZE(reg_cfg)); in lt9611_mipi_input_digital()
148 static void lt9611_mipi_video_setup(struct lt9611 *lt9611, in lt9611_mipi_video_setup() argument
167 regmap_write(lt9611->regmap, 0x830d, (u8)(v_total / 256)); in lt9611_mipi_video_setup()
168 regmap_write(lt9611->regmap, 0x830e, (u8)(v_total % 256)); in lt9611_mipi_video_setup()
170 regmap_write(lt9611->regmap, 0x830f, (u8)(vactive / 256)); in lt9611_mipi_video_setup()
171 regmap_write(lt9611->regmap, 0x8310, (u8)(vactive % 256)); in lt9611_mipi_video_setup()
173 regmap_write(lt9611->regmap, 0x8311, (u8)(h_total / 256)); in lt9611_mipi_video_setup()
174 regmap_write(lt9611->regmap, 0x8312, (u8)(h_total % 256)); in lt9611_mipi_video_setup()
176 regmap_write(lt9611->regmap, 0x8313, (u8)(hactive / 256)); in lt9611_mipi_video_setup()
177 regmap_write(lt9611->regmap, 0x8314, (u8)(hactive % 256)); in lt9611_mipi_video_setup()
179 regmap_write(lt9611->regmap, 0x8315, (u8)(vsync_len % 256)); in lt9611_mipi_video_setup()
180 regmap_write(lt9611->regmap, 0x8316, (u8)(hsync_len % 256)); in lt9611_mipi_video_setup()
182 regmap_write(lt9611->regmap, 0x8317, (u8)(vfront_porch % 256)); in lt9611_mipi_video_setup()
184 regmap_write(lt9611->regmap, 0x8318, (u8)(vsync_porch % 256)); in lt9611_mipi_video_setup()
186 regmap_write(lt9611->regmap, 0x8319, (u8)(hfront_porch % 256)); in lt9611_mipi_video_setup()
188 regmap_write(lt9611->regmap, 0x831a, (u8)(hsync_porch / 256)); in lt9611_mipi_video_setup()
189 regmap_write(lt9611->regmap, 0x831b, (u8)(hsync_porch % 256)); in lt9611_mipi_video_setup()
192 static void lt9611_pcr_setup(struct lt9611 *lt9611, const struct drm_display_mode *mode) in lt9611_pcr_setup() argument
227 regmap_multi_reg_write(lt9611->regmap, reg_cfg, ARRAY_SIZE(reg_cfg)); in lt9611_pcr_setup()
231 regmap_write(lt9611->regmap, 0x8326, 0x14); in lt9611_pcr_setup()
234 regmap_write(lt9611->regmap, 0x8326, 0x37); in lt9611_pcr_setup()
237 regmap_multi_reg_write(lt9611->regmap, reg_cfg2, ARRAY_SIZE(reg_cfg2)); in lt9611_pcr_setup()
242 regmap_write(lt9611->regmap, 0x8011, 0x5a); in lt9611_pcr_setup()
243 regmap_write(lt9611->regmap, 0x8011, 0xfa); in lt9611_pcr_setup()
246 static int lt9611_pll_setup(struct lt9611 *lt9611, const struct drm_display_mode *mode) in lt9611_pll_setup() argument
262 regmap_multi_reg_write(lt9611->regmap, reg_cfg, ARRAY_SIZE(reg_cfg)); in lt9611_pll_setup()
265 regmap_write(lt9611->regmap, 0x812d, 0x88); in lt9611_pll_setup()
267 regmap_write(lt9611->regmap, 0x812d, 0x99); in lt9611_pll_setup()
269 regmap_write(lt9611->regmap, 0x812d, 0xaa); in lt9611_pll_setup()
277 regmap_write(lt9611->regmap, 0x82e3, pclk >> 17); /* pclk[19:16] */ in lt9611_pll_setup()
278 regmap_write(lt9611->regmap, 0x82e4, pclk >> 9); /* pclk[15:8] */ in lt9611_pll_setup()
279 regmap_write(lt9611->regmap, 0x82e5, pclk >> 1); /* pclk[7:0] */ in lt9611_pll_setup()
281 regmap_write(lt9611->regmap, 0x82de, 0x20); in lt9611_pll_setup()
282 regmap_write(lt9611->regmap, 0x82de, 0xe0); in lt9611_pll_setup()
284 regmap_write(lt9611->regmap, 0x8016, 0xf1); in lt9611_pll_setup()
285 regmap_write(lt9611->regmap, 0x8016, 0xf3); in lt9611_pll_setup()
290 static int lt9611_read_video_check(struct lt9611 *lt9611, unsigned int reg) in lt9611_read_video_check() argument
295 ret = regmap_read(lt9611->regmap, reg, &temp); in lt9611_read_video_check()
299 ret = regmap_read(lt9611->regmap, reg + 1, &temp2); in lt9611_read_video_check()
306 static int lt9611_video_check(struct lt9611 *lt9611) in lt9611_video_check() argument
314 temp = lt9611_read_video_check(lt9611, 0x8282); in lt9611_video_check()
320 temp = lt9611_read_video_check(lt9611, 0x826c); in lt9611_video_check()
326 temp = lt9611_read_video_check(lt9611, 0x8286); in lt9611_video_check()
332 temp = lt9611_read_video_check(lt9611, 0x8382); in lt9611_video_check()
338 temp = lt9611_read_video_check(lt9611, 0x8386); in lt9611_video_check()
343 dev_info(lt9611->dev, in lt9611_video_check()
350 dev_err(lt9611->dev, "read video check error\n"); in lt9611_video_check()
354 static void lt9611_hdmi_tx_digital(struct lt9611 *lt9611) in lt9611_hdmi_tx_digital() argument
356 regmap_write(lt9611->regmap, 0x8443, 0x46 - lt9611->vic); in lt9611_hdmi_tx_digital()
357 regmap_write(lt9611->regmap, 0x8447, lt9611->vic); in lt9611_hdmi_tx_digital()
358 regmap_write(lt9611->regmap, 0x843d, 0x0a); /* UD1 infoframe */ in lt9611_hdmi_tx_digital()
360 regmap_write(lt9611->regmap, 0x82d6, 0x8c); in lt9611_hdmi_tx_digital()
361 regmap_write(lt9611->regmap, 0x82d7, 0x04); in lt9611_hdmi_tx_digital()
364 static void lt9611_hdmi_tx_phy(struct lt9611 *lt9611) in lt9611_hdmi_tx_phy() argument
384 if (lt9611->ac_mode) in lt9611_hdmi_tx_phy()
387 regmap_multi_reg_write(lt9611->regmap, reg_cfg, ARRAY_SIZE(reg_cfg)); in lt9611_hdmi_tx_phy()
392 struct lt9611 *lt9611 = dev_id; in lt9611_irq_thread_handler() local
396 regmap_read(lt9611->regmap, 0x820f, &irq_flag3); in lt9611_irq_thread_handler()
397 regmap_read(lt9611->regmap, 0x820c, &irq_flag0); in lt9611_irq_thread_handler()
401 dev_info(lt9611->dev, "hdmi cable disconnected\n"); in lt9611_irq_thread_handler()
403 regmap_write(lt9611->regmap, 0x8207, 0xbf); in lt9611_irq_thread_handler()
404 regmap_write(lt9611->regmap, 0x8207, 0x3f); in lt9611_irq_thread_handler()
409 dev_info(lt9611->dev, "hdmi cable connected\n"); in lt9611_irq_thread_handler()
411 regmap_write(lt9611->regmap, 0x8207, 0x7f); in lt9611_irq_thread_handler()
412 regmap_write(lt9611->regmap, 0x8207, 0x3f); in lt9611_irq_thread_handler()
415 if (irq_flag3 & 0xc0 && lt9611->bridge.dev) in lt9611_irq_thread_handler()
416 drm_kms_helper_hotplug_event(lt9611->bridge.dev); in lt9611_irq_thread_handler()
420 dev_info(lt9611->dev, "video input changed\n"); in lt9611_irq_thread_handler()
421 regmap_write(lt9611->regmap, 0x829e, 0xff); in lt9611_irq_thread_handler()
422 regmap_write(lt9611->regmap, 0x829e, 0xf7); in lt9611_irq_thread_handler()
423 regmap_write(lt9611->regmap, 0x8204, 0xff); in lt9611_irq_thread_handler()
424 regmap_write(lt9611->regmap, 0x8204, 0xfe); in lt9611_irq_thread_handler()
430 static void lt9611_enable_hpd_interrupts(struct lt9611 *lt9611) in lt9611_enable_hpd_interrupts() argument
434 regmap_read(lt9611->regmap, 0x8203, &val); in lt9611_enable_hpd_interrupts()
437 regmap_write(lt9611->regmap, 0x8203, val); in lt9611_enable_hpd_interrupts()
438 regmap_write(lt9611->regmap, 0x8207, 0xff); /* clear */ in lt9611_enable_hpd_interrupts()
439 regmap_write(lt9611->regmap, 0x8207, 0x3f); in lt9611_enable_hpd_interrupts()
442 static void lt9611_sleep_setup(struct lt9611 *lt9611) in lt9611_sleep_setup() argument
457 regmap_multi_reg_write(lt9611->regmap, in lt9611_sleep_setup()
459 lt9611->sleep = true; in lt9611_sleep_setup()
462 static int lt9611_power_on(struct lt9611 *lt9611) in lt9611_power_on() argument
490 if (lt9611->power_on) in lt9611_power_on()
493 ret = regmap_multi_reg_write(lt9611->regmap, seq, ARRAY_SIZE(seq)); in lt9611_power_on()
495 lt9611->power_on = true; in lt9611_power_on()
500 static int lt9611_power_off(struct lt9611 *lt9611) in lt9611_power_off() argument
504 ret = regmap_write(lt9611->regmap, 0x8130, 0x6a); in lt9611_power_off()
506 lt9611->power_on = false; in lt9611_power_off()
511 static void lt9611_reset(struct lt9611 *lt9611) in lt9611_reset() argument
513 gpiod_set_value_cansleep(lt9611->reset_gpio, 1); in lt9611_reset()
516 gpiod_set_value_cansleep(lt9611->reset_gpio, 0); in lt9611_reset()
519 gpiod_set_value_cansleep(lt9611->reset_gpio, 1); in lt9611_reset()
523 static void lt9611_assert_5v(struct lt9611 *lt9611) in lt9611_assert_5v() argument
525 if (!lt9611->enable_gpio) in lt9611_assert_5v()
528 gpiod_set_value_cansleep(lt9611->enable_gpio, 1); in lt9611_assert_5v()
532 static int lt9611_regulator_init(struct lt9611 *lt9611) in lt9611_regulator_init() argument
536 lt9611->supplies[0].supply = "vdd"; in lt9611_regulator_init()
537 lt9611->supplies[1].supply = "vcc"; in lt9611_regulator_init()
539 ret = devm_regulator_bulk_get(lt9611->dev, 2, lt9611->supplies); in lt9611_regulator_init()
543 return regulator_set_load(lt9611->supplies[0].consumer, 300000); in lt9611_regulator_init()
546 static int lt9611_regulator_enable(struct lt9611 *lt9611) in lt9611_regulator_enable() argument
550 ret = regulator_enable(lt9611->supplies[0].consumer); in lt9611_regulator_enable()
556 ret = regulator_enable(lt9611->supplies[1].consumer); in lt9611_regulator_enable()
558 regulator_disable(lt9611->supplies[0].consumer); in lt9611_regulator_enable()
584 struct lt9611 *lt9611 = connector_to_lt9611(connector); in lt9611_connector_detect() local
588 regmap_read(lt9611->regmap, 0x825e, &reg_val); in lt9611_connector_detect()
591 lt9611->status = connected ? connector_status_connected : in lt9611_connector_detect()
594 return lt9611->status; in lt9611_connector_detect()
597 static int lt9611_read_edid(struct lt9611 *lt9611) in lt9611_read_edid() argument
604 memset(lt9611->edid_buf, 0, sizeof(lt9611->edid_buf)); in lt9611_read_edid()
606 regmap_write(lt9611->regmap, 0x8503, 0xc9); in lt9611_read_edid()
609 regmap_write(lt9611->regmap, 0x8504, 0xa0); in lt9611_read_edid()
611 regmap_write(lt9611->regmap, 0x8505, 0x00); in lt9611_read_edid()
614 regmap_write(lt9611->regmap, 0x8506, EDID_LEN); in lt9611_read_edid()
615 regmap_write(lt9611->regmap, 0x8514, 0x7f); in lt9611_read_edid()
619 regmap_write(lt9611->regmap, 0x8505, i * EDID_LEN); in lt9611_read_edid()
620 regmap_write(lt9611->regmap, 0x8507, 0x36); in lt9611_read_edid()
621 regmap_write(lt9611->regmap, 0x8507, 0x31); in lt9611_read_edid()
622 regmap_write(lt9611->regmap, 0x8507, 0x37); in lt9611_read_edid()
625 regmap_read(lt9611->regmap, 0x8540, &temp); in lt9611_read_edid()
629 regmap_read(lt9611->regmap, 0x8583, &temp); in lt9611_read_edid()
630 lt9611->edid_buf[i * EDID_LEN + j] = temp; in lt9611_read_edid()
634 dev_err(lt9611->dev, "read edid failed: no ack\n"); in lt9611_read_edid()
639 dev_err(lt9611->dev, "read edid failed: access not done\n"); in lt9611_read_edid()
646 regmap_write(lt9611->regmap, 0x8507, 0x1f); in lt9611_read_edid()
653 struct lt9611 *lt9611 = data; in lt9611_get_edid_block() local
665 ret = lt9611_read_edid(lt9611); in lt9611_get_edid_block()
667 dev_err(lt9611->dev, "edid read failed\n"); in lt9611_get_edid_block()
673 memcpy(buf, lt9611->edid_buf + (block * 128), len); in lt9611_get_edid_block()
680 struct lt9611 *lt9611 = connector_to_lt9611(connector); in lt9611_connector_get_modes() local
684 lt9611_power_on(lt9611); in lt9611_connector_get_modes()
685 edid = drm_do_get_edid(connector, lt9611_get_edid_block, lt9611); in lt9611_connector_get_modes()
705 struct lt9611 *lt9611 = bridge_to_lt9611(bridge); in lt9611_bridge_enable() local
707 if (lt9611_power_on(lt9611)) { in lt9611_bridge_enable()
708 dev_err(lt9611->dev, "power on failed\n"); in lt9611_bridge_enable()
712 lt9611_mipi_input_analog(lt9611); in lt9611_bridge_enable()
713 lt9611_hdmi_tx_digital(lt9611); in lt9611_bridge_enable()
714 lt9611_hdmi_tx_phy(lt9611); in lt9611_bridge_enable()
718 lt9611_video_check(lt9611); in lt9611_bridge_enable()
721 regmap_write(lt9611->regmap, 0x8130, 0xea); in lt9611_bridge_enable()
726 struct lt9611 *lt9611 = bridge_to_lt9611(bridge); in lt9611_bridge_disable() local
730 ret = regmap_write(lt9611->regmap, 0x8130, 0x6a); in lt9611_bridge_disable()
732 dev_err(lt9611->dev, "video on failed\n"); in lt9611_bridge_disable()
736 if (lt9611_power_off(lt9611)) { in lt9611_bridge_disable()
737 dev_err(lt9611->dev, "power on failed\n"); in lt9611_bridge_disable()
757 static struct mipi_dsi_device *lt9611_attach_dsi(struct lt9611 *lt9611, in lt9611_attach_dsi() argument
760 const struct mipi_dsi_device_info info = { "lt9611", 0, NULL }; in lt9611_attach_dsi()
767 dev_err(lt9611->dev, "failed to find dsi host\n"); in lt9611_attach_dsi()
773 dev_err(lt9611->dev, "failed to create dsi device\n"); in lt9611_attach_dsi()
784 dev_err(lt9611->dev, "failed to attach dsi to host\n"); in lt9611_attach_dsi()
794 struct lt9611 *lt9611 = bridge_to_lt9611(bridge); in lt9611_bridge_detach() local
796 if (lt9611->dsi1) { in lt9611_bridge_detach()
797 mipi_dsi_detach(lt9611->dsi1); in lt9611_bridge_detach()
798 mipi_dsi_device_unregister(lt9611->dsi1); in lt9611_bridge_detach()
801 mipi_dsi_detach(lt9611->dsi0); in lt9611_bridge_detach()
802 mipi_dsi_device_unregister(lt9611->dsi0); in lt9611_bridge_detach()
805 static int lt9611_connector_init(struct drm_bridge *bridge, struct lt9611 *lt9611) in lt9611_connector_init() argument
809 ret = drm_connector_init(bridge->dev, &lt9611->connector, in lt9611_connector_init()
817 drm_connector_helper_add(&lt9611->connector, in lt9611_connector_init()
819 drm_connector_attach_encoder(&lt9611->connector, bridge->encoder); in lt9611_connector_init()
832 struct lt9611 *lt9611 = bridge_to_lt9611(bridge); in lt9611_bridge_attach() local
836 ret = lt9611_connector_init(bridge, lt9611); in lt9611_bridge_attach()
842 lt9611->dsi0 = lt9611_attach_dsi(lt9611, lt9611->dsi0_node); in lt9611_bridge_attach()
843 if (IS_ERR(lt9611->dsi0)) in lt9611_bridge_attach()
844 return PTR_ERR(lt9611->dsi0); in lt9611_bridge_attach()
847 if (lt9611->dsi1_node) { in lt9611_bridge_attach()
848 lt9611->dsi1 = lt9611_attach_dsi(lt9611, lt9611->dsi1_node); in lt9611_bridge_attach()
849 if (IS_ERR(lt9611->dsi1)) { in lt9611_bridge_attach()
850 ret = PTR_ERR(lt9611->dsi1); in lt9611_bridge_attach()
859 drm_connector_cleanup(&lt9611->connector); in lt9611_bridge_attach()
860 mipi_dsi_device_unregister(lt9611->dsi0); in lt9611_bridge_attach()
876 struct lt9611 *lt9611 = bridge_to_lt9611(bridge); in lt9611_bridge_pre_enable() local
878 if (!lt9611->sleep) in lt9611_bridge_pre_enable()
881 lt9611_reset(lt9611); in lt9611_bridge_pre_enable()
882 regmap_write(lt9611->regmap, 0x80ee, 0x01); in lt9611_bridge_pre_enable()
884 lt9611->sleep = false; in lt9611_bridge_pre_enable()
889 struct lt9611 *lt9611 = bridge_to_lt9611(bridge); in lt9611_bridge_post_disable() local
891 lt9611_sleep_setup(lt9611); in lt9611_bridge_post_disable()
898 struct lt9611 *lt9611 = bridge_to_lt9611(bridge); in lt9611_bridge_mode_set() local
904 lt9611_mipi_input_digital(lt9611, mode); in lt9611_bridge_mode_set()
905 lt9611_pll_setup(lt9611, mode); in lt9611_bridge_mode_set()
906 lt9611_mipi_video_setup(lt9611, mode); in lt9611_bridge_mode_set()
907 lt9611_pcr_setup(lt9611, mode); in lt9611_bridge_mode_set()
910 &lt9611->connector, in lt9611_bridge_mode_set()
913 lt9611->vic = avi_frame.video_code; in lt9611_bridge_mode_set()
918 struct lt9611 *lt9611 = bridge_to_lt9611(bridge); in lt9611_bridge_detect() local
922 regmap_read(lt9611->regmap, 0x825e, &reg_val); in lt9611_bridge_detect()
925 lt9611->status = connected ? connector_status_connected : in lt9611_bridge_detect()
928 return lt9611->status; in lt9611_bridge_detect()
934 struct lt9611 *lt9611 = bridge_to_lt9611(bridge); in lt9611_bridge_get_edid() local
936 lt9611_power_on(lt9611); in lt9611_bridge_get_edid()
937 return drm_do_get_edid(connector, lt9611_get_edid_block, lt9611); in lt9611_bridge_get_edid()
942 struct lt9611 *lt9611 = bridge_to_lt9611(bridge); in lt9611_bridge_hpd_enable() local
944 lt9611_enable_hpd_interrupts(lt9611); in lt9611_bridge_hpd_enable()
961 struct lt9611 *lt9611) in lt9611_parse_dt() argument
963 lt9611->dsi0_node = of_graph_get_remote_node(dev->of_node, 0, -1); in lt9611_parse_dt()
964 if (!lt9611->dsi0_node) { in lt9611_parse_dt()
965 dev_err(lt9611->dev, "failed to get remote node for primary dsi\n"); in lt9611_parse_dt()
969 lt9611->dsi1_node = of_graph_get_remote_node(dev->of_node, 1, -1); in lt9611_parse_dt()
971 lt9611->ac_mode = of_property_read_bool(dev->of_node, "lt,ac-mode"); in lt9611_parse_dt()
976 static int lt9611_gpio_init(struct lt9611 *lt9611) in lt9611_gpio_init() argument
978 struct device *dev = lt9611->dev; in lt9611_gpio_init()
980 lt9611->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in lt9611_gpio_init()
981 if (IS_ERR(lt9611->reset_gpio)) { in lt9611_gpio_init()
983 return PTR_ERR(lt9611->reset_gpio); in lt9611_gpio_init()
986 lt9611->enable_gpio = devm_gpiod_get_optional(dev, "enable", in lt9611_gpio_init()
988 if (IS_ERR(lt9611->enable_gpio)) { in lt9611_gpio_init()
990 return PTR_ERR(lt9611->enable_gpio); in lt9611_gpio_init()
996 static int lt9611_read_device_rev(struct lt9611 *lt9611) in lt9611_read_device_rev() argument
1001 regmap_write(lt9611->regmap, 0x80ee, 0x01); in lt9611_read_device_rev()
1002 ret = regmap_read(lt9611->regmap, 0x8002, &rev); in lt9611_read_device_rev()
1004 dev_err(lt9611->dev, "failed to read revision: %d\n", ret); in lt9611_read_device_rev()
1006 dev_info(lt9611->dev, "LT9611 revision: 0x%x\n", rev); in lt9611_read_device_rev()
1015 struct lt9611 *lt9611 = data; in lt9611_hdmi_hw_params() local
1018 regmap_write(lt9611->regmap, 0x840f, 0x2b); in lt9611_hdmi_hw_params()
1020 regmap_write(lt9611->regmap, 0x840f, 0xab); in lt9611_hdmi_hw_params()
1024 regmap_write(lt9611->regmap, 0x8435, 0x00); in lt9611_hdmi_hw_params()
1025 regmap_write(lt9611->regmap, 0x8436, 0x18); in lt9611_hdmi_hw_params()
1026 regmap_write(lt9611->regmap, 0x8437, 0x00); in lt9611_hdmi_hw_params()
1033 struct lt9611 *lt9611 = data; in lt9611_audio_startup() local
1035 regmap_write(lt9611->regmap, 0x82d6, 0x8c); in lt9611_audio_startup()
1036 regmap_write(lt9611->regmap, 0x82d7, 0x04); in lt9611_audio_startup()
1038 regmap_write(lt9611->regmap, 0x8406, 0x08); in lt9611_audio_startup()
1039 regmap_write(lt9611->regmap, 0x8407, 0x10); in lt9611_audio_startup()
1041 regmap_write(lt9611->regmap, 0x8434, 0xd5); in lt9611_audio_startup()
1048 struct lt9611 *lt9611 = data; in lt9611_audio_shutdown() local
1050 regmap_write(lt9611->regmap, 0x8406, 0x00); in lt9611_audio_shutdown()
1051 regmap_write(lt9611->regmap, 0x8407, 0x00); in lt9611_audio_shutdown()
1087 static int lt9611_audio_init(struct device *dev, struct lt9611 *lt9611) in lt9611_audio_init() argument
1089 codec_data.data = lt9611; in lt9611_audio_init()
1090 lt9611->audio_pdev = in lt9611_audio_init()
1095 return PTR_ERR_OR_ZERO(lt9611->audio_pdev); in lt9611_audio_init()
1098 static void lt9611_audio_exit(struct lt9611 *lt9611) in lt9611_audio_exit() argument
1100 if (lt9611->audio_pdev) { in lt9611_audio_exit()
1101 platform_device_unregister(lt9611->audio_pdev); in lt9611_audio_exit()
1102 lt9611->audio_pdev = NULL; in lt9611_audio_exit()
1109 struct lt9611 *lt9611; in lt9611_probe() local
1118 lt9611 = devm_kzalloc(dev, sizeof(*lt9611), GFP_KERNEL); in lt9611_probe()
1119 if (!lt9611) in lt9611_probe()
1122 lt9611->dev = &client->dev; in lt9611_probe()
1123 lt9611->client = client; in lt9611_probe()
1124 lt9611->sleep = false; in lt9611_probe()
1126 lt9611->regmap = devm_regmap_init_i2c(client, &lt9611_regmap_config); in lt9611_probe()
1127 if (IS_ERR(lt9611->regmap)) { in lt9611_probe()
1128 dev_err(lt9611->dev, "regmap i2c init failed\n"); in lt9611_probe()
1129 return PTR_ERR(lt9611->regmap); in lt9611_probe()
1132 ret = lt9611_parse_dt(&client->dev, lt9611); in lt9611_probe()
1138 ret = lt9611_gpio_init(lt9611); in lt9611_probe()
1142 ret = lt9611_regulator_init(lt9611); in lt9611_probe()
1146 lt9611_assert_5v(lt9611); in lt9611_probe()
1148 ret = lt9611_regulator_enable(lt9611); in lt9611_probe()
1152 lt9611_reset(lt9611); in lt9611_probe()
1154 ret = lt9611_read_device_rev(lt9611); in lt9611_probe()
1162 IRQF_ONESHOT, "lt9611", lt9611); in lt9611_probe()
1168 i2c_set_clientdata(client, lt9611); in lt9611_probe()
1170 lt9611->bridge.funcs = &lt9611_bridge_funcs; in lt9611_probe()
1171 lt9611->bridge.of_node = client->dev.of_node; in lt9611_probe()
1172 lt9611->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | in lt9611_probe()
1174 lt9611->bridge.type = DRM_MODE_CONNECTOR_HDMIA; in lt9611_probe()
1176 drm_bridge_add(&lt9611->bridge); in lt9611_probe()
1178 lt9611_enable_hpd_interrupts(lt9611); in lt9611_probe()
1180 return lt9611_audio_init(dev, lt9611); in lt9611_probe()
1183 regulator_bulk_disable(ARRAY_SIZE(lt9611->supplies), lt9611->supplies); in lt9611_probe()
1186 of_node_put(lt9611->dsi1_node); in lt9611_probe()
1187 of_node_put(lt9611->dsi0_node); in lt9611_probe()
1194 struct lt9611 *lt9611 = i2c_get_clientdata(client); in lt9611_remove() local
1197 lt9611_audio_exit(lt9611); in lt9611_remove()
1198 drm_bridge_remove(&lt9611->bridge); in lt9611_remove()
1200 regulator_bulk_disable(ARRAY_SIZE(lt9611->supplies), lt9611->supplies); in lt9611_remove()
1202 of_node_put(lt9611->dsi1_node); in lt9611_remove()
1203 of_node_put(lt9611->dsi0_node); in lt9611_remove()
1209 { "lontium,lt9611", 0 },
1214 { .compatible = "lontium,lt9611" },
1221 .name = "lt9611",