Lines Matching +full:panel +full:- +full:dsi

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com
20 struct mipi_dsi_device *dsi; member
27 static inline struct osd101t2587_panel *ti_osd_panel(struct drm_panel *panel) in ti_osd_panel() argument
29 return container_of(panel, struct osd101t2587_panel, base); in ti_osd_panel()
32 static int osd101t2587_panel_disable(struct drm_panel *panel) in osd101t2587_panel_disable() argument
34 struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel); in osd101t2587_panel_disable()
37 ret = mipi_dsi_shutdown_peripheral(osd101t2587->dsi); in osd101t2587_panel_disable()
42 static int osd101t2587_panel_unprepare(struct drm_panel *panel) in osd101t2587_panel_unprepare() argument
44 struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel); in osd101t2587_panel_unprepare()
46 regulator_disable(osd101t2587->supply); in osd101t2587_panel_unprepare()
51 static int osd101t2587_panel_prepare(struct drm_panel *panel) in osd101t2587_panel_prepare() argument
53 struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel); in osd101t2587_panel_prepare()
55 return regulator_enable(osd101t2587->supply); in osd101t2587_panel_prepare()
58 static int osd101t2587_panel_enable(struct drm_panel *panel) in osd101t2587_panel_enable() argument
60 struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel); in osd101t2587_panel_enable()
63 ret = mipi_dsi_turn_on_peripheral(osd101t2587->dsi); in osd101t2587_panel_enable()
83 static int osd101t2587_panel_get_modes(struct drm_panel *panel, in osd101t2587_panel_get_modes() argument
86 struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel); in osd101t2587_panel_get_modes()
89 mode = drm_mode_duplicate(connector->dev, osd101t2587->default_mode); in osd101t2587_panel_get_modes()
91 dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", in osd101t2587_panel_get_modes()
92 osd101t2587->default_mode->hdisplay, in osd101t2587_panel_get_modes()
93 osd101t2587->default_mode->vdisplay, in osd101t2587_panel_get_modes()
94 drm_mode_vrefresh(osd101t2587->default_mode)); in osd101t2587_panel_get_modes()
95 return -ENOMEM; in osd101t2587_panel_get_modes()
102 connector->display_info.width_mm = 217; in osd101t2587_panel_get_modes()
103 connector->display_info.height_mm = 136; in osd101t2587_panel_get_modes()
118 .compatible = "osddisplays,osd101t2587-53ts",
128 struct device *dev = &osd101t2587->dsi->dev; in osd101t2587_panel_add()
131 osd101t2587->supply = devm_regulator_get(dev, "power"); in osd101t2587_panel_add()
132 if (IS_ERR(osd101t2587->supply)) in osd101t2587_panel_add()
133 return PTR_ERR(osd101t2587->supply); in osd101t2587_panel_add()
135 drm_panel_init(&osd101t2587->base, &osd101t2587->dsi->dev, in osd101t2587_panel_add()
138 ret = drm_panel_of_backlight(&osd101t2587->base); in osd101t2587_panel_add()
142 drm_panel_add(&osd101t2587->base); in osd101t2587_panel_add()
147 static int osd101t2587_panel_probe(struct mipi_dsi_device *dsi) in osd101t2587_panel_probe() argument
153 id = of_match_node(osd101t2587_of_match, dsi->dev.of_node); in osd101t2587_panel_probe()
155 return -ENODEV; in osd101t2587_panel_probe()
157 dsi->lanes = 4; in osd101t2587_panel_probe()
158 dsi->format = MIPI_DSI_FMT_RGB888; in osd101t2587_panel_probe()
159 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | in osd101t2587_panel_probe()
164 osd101t2587 = devm_kzalloc(&dsi->dev, sizeof(*osd101t2587), GFP_KERNEL); in osd101t2587_panel_probe()
166 return -ENOMEM; in osd101t2587_panel_probe()
168 mipi_dsi_set_drvdata(dsi, osd101t2587); in osd101t2587_panel_probe()
170 osd101t2587->dsi = dsi; in osd101t2587_panel_probe()
171 osd101t2587->default_mode = id->data; in osd101t2587_panel_probe()
177 ret = mipi_dsi_attach(dsi); in osd101t2587_panel_probe()
179 drm_panel_remove(&osd101t2587->base); in osd101t2587_panel_probe()
184 static void osd101t2587_panel_remove(struct mipi_dsi_device *dsi) in osd101t2587_panel_remove() argument
186 struct osd101t2587_panel *osd101t2587 = mipi_dsi_get_drvdata(dsi); in osd101t2587_panel_remove()
189 drm_panel_remove(&osd101t2587->base); in osd101t2587_panel_remove()
191 ret = mipi_dsi_detach(dsi); in osd101t2587_panel_remove()
193 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); in osd101t2587_panel_remove()
198 .name = "panel-osd-osd101t2587-53ts",
207 MODULE_DESCRIPTION("OSD101T2587-53TS DSI panel");