Lines Matching refs:khadas_ts050

583 	struct khadas_ts050_panel *khadas_ts050 = to_khadas_ts050_panel(panel);  in khadas_ts050_panel_prepare()  local
587 if (khadas_ts050->prepared) in khadas_ts050_panel_prepare()
590 gpiod_set_value_cansleep(khadas_ts050->enable_gpio, 0); in khadas_ts050_panel_prepare()
592 err = regulator_enable(khadas_ts050->supply); in khadas_ts050_panel_prepare()
596 gpiod_set_value_cansleep(khadas_ts050->enable_gpio, 1); in khadas_ts050_panel_prepare()
600 gpiod_set_value_cansleep(khadas_ts050->reset_gpio, 1); in khadas_ts050_panel_prepare()
604 gpiod_set_value_cansleep(khadas_ts050->reset_gpio, 0); in khadas_ts050_panel_prepare()
607 mipi_dsi_dcs_write(khadas_ts050->link, 0xff, (u8[]){ 0x05 }, 1); in khadas_ts050_panel_prepare()
610 mipi_dsi_dcs_write(khadas_ts050->link, 0xfb, (u8[]){ 0x01 }, 1); in khadas_ts050_panel_prepare()
612 mipi_dsi_dcs_write(khadas_ts050->link, 0xc5, (u8[]){ 0x01 }, 1); in khadas_ts050_panel_prepare()
617 err = mipi_dsi_dcs_write(khadas_ts050->link, in khadas_ts050_panel_prepare()
626 err = mipi_dsi_dcs_exit_sleep_mode(khadas_ts050->link); in khadas_ts050_panel_prepare()
635 mipi_dsi_dcs_write(khadas_ts050->link, 0xff, (u8[]){ 0x00 }, 1); in khadas_ts050_panel_prepare()
637 err = mipi_dsi_dcs_set_tear_on(khadas_ts050->link, in khadas_ts050_panel_prepare()
644 err = mipi_dsi_dcs_set_display_on(khadas_ts050->link); in khadas_ts050_panel_prepare()
652 khadas_ts050->prepared = true; in khadas_ts050_panel_prepare()
657 gpiod_set_value_cansleep(khadas_ts050->enable_gpio, 0); in khadas_ts050_panel_prepare()
658 gpiod_set_value_cansleep(khadas_ts050->reset_gpio, 1); in khadas_ts050_panel_prepare()
660 regulator_disable(khadas_ts050->supply); in khadas_ts050_panel_prepare()
667 struct khadas_ts050_panel *khadas_ts050 = to_khadas_ts050_panel(panel); in khadas_ts050_panel_unprepare() local
670 if (!khadas_ts050->prepared) in khadas_ts050_panel_unprepare()
673 khadas_ts050->prepared = false; in khadas_ts050_panel_unprepare()
675 err = mipi_dsi_dcs_enter_sleep_mode(khadas_ts050->link); in khadas_ts050_panel_unprepare()
681 gpiod_set_value_cansleep(khadas_ts050->enable_gpio, 0); in khadas_ts050_panel_unprepare()
682 gpiod_set_value_cansleep(khadas_ts050->reset_gpio, 1); in khadas_ts050_panel_unprepare()
684 err = regulator_disable(khadas_ts050->supply); in khadas_ts050_panel_unprepare()
693 struct khadas_ts050_panel *khadas_ts050 = to_khadas_ts050_panel(panel); in khadas_ts050_panel_enable() local
695 khadas_ts050->enabled = true; in khadas_ts050_panel_enable()
702 struct khadas_ts050_panel *khadas_ts050 = to_khadas_ts050_panel(panel); in khadas_ts050_panel_disable() local
705 if (!khadas_ts050->enabled) in khadas_ts050_panel_disable()
708 err = mipi_dsi_dcs_set_display_off(khadas_ts050->link); in khadas_ts050_panel_disable()
714 khadas_ts050->enabled = false; in khadas_ts050_panel_disable()
770 static int khadas_ts050_panel_add(struct khadas_ts050_panel *khadas_ts050) in khadas_ts050_panel_add() argument
772 struct device *dev = &khadas_ts050->link->dev; in khadas_ts050_panel_add()
775 khadas_ts050->supply = devm_regulator_get(dev, "power"); in khadas_ts050_panel_add()
776 if (IS_ERR(khadas_ts050->supply)) in khadas_ts050_panel_add()
777 return dev_err_probe(dev, PTR_ERR(khadas_ts050->supply), in khadas_ts050_panel_add()
780 khadas_ts050->reset_gpio = devm_gpiod_get(dev, "reset", in khadas_ts050_panel_add()
782 if (IS_ERR(khadas_ts050->reset_gpio)) in khadas_ts050_panel_add()
783 return dev_err_probe(dev, PTR_ERR(khadas_ts050->reset_gpio), in khadas_ts050_panel_add()
786 khadas_ts050->enable_gpio = devm_gpiod_get(dev, "enable", in khadas_ts050_panel_add()
788 if (IS_ERR(khadas_ts050->enable_gpio)) in khadas_ts050_panel_add()
789 return dev_err_probe(dev, PTR_ERR(khadas_ts050->enable_gpio), in khadas_ts050_panel_add()
792 drm_panel_init(&khadas_ts050->base, &khadas_ts050->link->dev, in khadas_ts050_panel_add()
795 err = drm_panel_of_backlight(&khadas_ts050->base); in khadas_ts050_panel_add()
799 drm_panel_add(&khadas_ts050->base); in khadas_ts050_panel_add()
806 struct khadas_ts050_panel *khadas_ts050; in khadas_ts050_panel_probe() local
814 khadas_ts050 = devm_kzalloc(&dsi->dev, sizeof(*khadas_ts050), in khadas_ts050_panel_probe()
816 if (!khadas_ts050) in khadas_ts050_panel_probe()
819 mipi_dsi_set_drvdata(dsi, khadas_ts050); in khadas_ts050_panel_probe()
820 khadas_ts050->link = dsi; in khadas_ts050_panel_probe()
822 err = khadas_ts050_panel_add(khadas_ts050); in khadas_ts050_panel_probe()
828 drm_panel_remove(&khadas_ts050->base); in khadas_ts050_panel_probe()
835 struct khadas_ts050_panel *khadas_ts050 = mipi_dsi_get_drvdata(dsi); in khadas_ts050_panel_remove() local
842 drm_panel_remove(&khadas_ts050->base); in khadas_ts050_panel_remove()
843 drm_panel_disable(&khadas_ts050->base); in khadas_ts050_panel_remove()
844 drm_panel_unprepare(&khadas_ts050->base); in khadas_ts050_panel_remove()
849 struct khadas_ts050_panel *khadas_ts050 = mipi_dsi_get_drvdata(dsi); in khadas_ts050_panel_shutdown() local
851 drm_panel_disable(&khadas_ts050->base); in khadas_ts050_panel_shutdown()
852 drm_panel_unprepare(&khadas_ts050->base); in khadas_ts050_panel_shutdown()