Lines Matching refs:khadas_ts050

638 	struct khadas_ts050_panel *khadas_ts050 = to_khadas_ts050_panel(panel);  in khadas_ts050_panel_prepare()  local
642 gpiod_set_value_cansleep(khadas_ts050->enable_gpio, 0); in khadas_ts050_panel_prepare()
644 err = regulator_enable(khadas_ts050->supply); in khadas_ts050_panel_prepare()
648 gpiod_set_value_cansleep(khadas_ts050->enable_gpio, 1); in khadas_ts050_panel_prepare()
652 gpiod_set_value_cansleep(khadas_ts050->reset_gpio, 1); in khadas_ts050_panel_prepare()
656 gpiod_set_value_cansleep(khadas_ts050->reset_gpio, 0); in khadas_ts050_panel_prepare()
659 mipi_dsi_dcs_write(khadas_ts050->link, 0xff, (u8[]){ 0x05 }, 1); in khadas_ts050_panel_prepare()
662 mipi_dsi_dcs_write(khadas_ts050->link, 0xfb, (u8[]){ 0x01 }, 1); in khadas_ts050_panel_prepare()
664 mipi_dsi_dcs_write(khadas_ts050->link, 0xc5, (u8[]){ 0x01 }, 1); in khadas_ts050_panel_prepare()
668 for (i = 0; i < khadas_ts050->panel_data->len; i++) { in khadas_ts050_panel_prepare()
669 err = mipi_dsi_dcs_write(khadas_ts050->link, in khadas_ts050_panel_prepare()
670 khadas_ts050->panel_data->init_code[i].cmd, in khadas_ts050_panel_prepare()
671 &khadas_ts050->panel_data->init_code[i].data, in khadas_ts050_panel_prepare()
672 khadas_ts050->panel_data->init_code[i].size); in khadas_ts050_panel_prepare()
679 err = mipi_dsi_dcs_exit_sleep_mode(khadas_ts050->link); in khadas_ts050_panel_prepare()
688 mipi_dsi_dcs_write(khadas_ts050->link, 0xff, (u8[]){ 0x00 }, 1); in khadas_ts050_panel_prepare()
690 err = mipi_dsi_dcs_set_tear_on(khadas_ts050->link, in khadas_ts050_panel_prepare()
697 err = mipi_dsi_dcs_set_display_on(khadas_ts050->link); in khadas_ts050_panel_prepare()
708 gpiod_set_value_cansleep(khadas_ts050->enable_gpio, 0); in khadas_ts050_panel_prepare()
709 gpiod_set_value_cansleep(khadas_ts050->reset_gpio, 1); in khadas_ts050_panel_prepare()
711 regulator_disable(khadas_ts050->supply); in khadas_ts050_panel_prepare()
718 struct khadas_ts050_panel *khadas_ts050 = to_khadas_ts050_panel(panel); in khadas_ts050_panel_unprepare() local
721 err = mipi_dsi_dcs_enter_sleep_mode(khadas_ts050->link); in khadas_ts050_panel_unprepare()
727 gpiod_set_value_cansleep(khadas_ts050->enable_gpio, 0); in khadas_ts050_panel_unprepare()
728 gpiod_set_value_cansleep(khadas_ts050->reset_gpio, 1); in khadas_ts050_panel_unprepare()
730 err = regulator_disable(khadas_ts050->supply); in khadas_ts050_panel_unprepare()
739 struct khadas_ts050_panel *khadas_ts050 = to_khadas_ts050_panel(panel); in khadas_ts050_panel_disable() local
742 err = mipi_dsi_dcs_set_display_off(khadas_ts050->link); in khadas_ts050_panel_disable()
802 static int khadas_ts050_panel_add(struct khadas_ts050_panel *khadas_ts050) in khadas_ts050_panel_add() argument
804 struct device *dev = &khadas_ts050->link->dev; in khadas_ts050_panel_add()
807 khadas_ts050->supply = devm_regulator_get(dev, "power"); in khadas_ts050_panel_add()
808 if (IS_ERR(khadas_ts050->supply)) in khadas_ts050_panel_add()
809 return dev_err_probe(dev, PTR_ERR(khadas_ts050->supply), in khadas_ts050_panel_add()
812 khadas_ts050->reset_gpio = devm_gpiod_get(dev, "reset", in khadas_ts050_panel_add()
814 if (IS_ERR(khadas_ts050->reset_gpio)) in khadas_ts050_panel_add()
815 return dev_err_probe(dev, PTR_ERR(khadas_ts050->reset_gpio), in khadas_ts050_panel_add()
818 khadas_ts050->enable_gpio = devm_gpiod_get(dev, "enable", in khadas_ts050_panel_add()
820 if (IS_ERR(khadas_ts050->enable_gpio)) in khadas_ts050_panel_add()
821 return dev_err_probe(dev, PTR_ERR(khadas_ts050->enable_gpio), in khadas_ts050_panel_add()
824 drm_panel_init(&khadas_ts050->base, &khadas_ts050->link->dev, in khadas_ts050_panel_add()
827 err = drm_panel_of_backlight(&khadas_ts050->base); in khadas_ts050_panel_add()
831 drm_panel_add(&khadas_ts050->base); in khadas_ts050_panel_add()
838 struct khadas_ts050_panel *khadas_ts050; in khadas_ts050_panel_probe() local
853 khadas_ts050 = devm_kzalloc(&dsi->dev, sizeof(*khadas_ts050), in khadas_ts050_panel_probe()
855 if (!khadas_ts050) in khadas_ts050_panel_probe()
858 khadas_ts050->panel_data = (struct khadas_ts050_panel_data *)data; in khadas_ts050_panel_probe()
859 mipi_dsi_set_drvdata(dsi, khadas_ts050); in khadas_ts050_panel_probe()
860 khadas_ts050->link = dsi; in khadas_ts050_panel_probe()
862 err = khadas_ts050_panel_add(khadas_ts050); in khadas_ts050_panel_probe()
868 drm_panel_remove(&khadas_ts050->base); in khadas_ts050_panel_probe()
875 struct khadas_ts050_panel *khadas_ts050 = mipi_dsi_get_drvdata(dsi); in khadas_ts050_panel_remove() local
882 drm_panel_remove(&khadas_ts050->base); in khadas_ts050_panel_remove()