Lines Matching +full:panel +full:- +full:specific
1 // SPDX-License-Identifier: GPL-2.0
3 * Xinpeng xpp055c272 5.5" MIPI-DSI panel driver
8 * Rockteck jh057n00900 5.5" MIPI-DSI panel driver
21 #include <linux/media-bus-format.h>
26 /* Manufacturer specific Commands send via DSI */
51 struct drm_panel panel; member
57 static inline struct xpp055c272 *panel_to_xpp055c272(struct drm_panel *panel) in panel_to_xpp055c272() argument
59 return container_of(panel, struct xpp055c272, panel); in panel_to_xpp055c272()
64 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xpp055c272_init_sequence()
65 struct device *dev = ctx->dev; in xpp055c272_init_sequence()
68 * Init sequence was supplied by the panel vendor without much in xpp055c272_init_sequence()
128 dev_dbg(dev, "Panel init sequence done\n"); in xpp055c272_init_sequence()
132 static int xpp055c272_unprepare(struct drm_panel *panel) in xpp055c272_unprepare() argument
134 struct xpp055c272 *ctx = panel_to_xpp055c272(panel); in xpp055c272_unprepare()
135 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xpp055c272_unprepare()
140 dev_err(ctx->dev, "failed to set display off: %d\n", ret); in xpp055c272_unprepare()
144 dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret); in xpp055c272_unprepare()
148 regulator_disable(ctx->iovcc); in xpp055c272_unprepare()
149 regulator_disable(ctx->vci); in xpp055c272_unprepare()
154 static int xpp055c272_prepare(struct drm_panel *panel) in xpp055c272_prepare() argument
156 struct xpp055c272 *ctx = panel_to_xpp055c272(panel); in xpp055c272_prepare()
157 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xpp055c272_prepare()
160 dev_dbg(ctx->dev, "Resetting the panel\n"); in xpp055c272_prepare()
161 ret = regulator_enable(ctx->vci); in xpp055c272_prepare()
163 dev_err(ctx->dev, "Failed to enable vci supply: %d\n", ret); in xpp055c272_prepare()
166 ret = regulator_enable(ctx->iovcc); in xpp055c272_prepare()
168 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in xpp055c272_prepare()
172 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in xpp055c272_prepare()
175 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in xpp055c272_prepare()
182 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in xpp055c272_prepare()
188 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in xpp055c272_prepare()
197 dev_err(ctx->dev, "Failed to set display on: %d\n", ret); in xpp055c272_prepare()
206 regulator_disable(ctx->iovcc); in xpp055c272_prepare()
208 regulator_disable(ctx->vci); in xpp055c272_prepare()
226 static int xpp055c272_get_modes(struct drm_panel *panel, in xpp055c272_get_modes() argument
229 struct xpp055c272 *ctx = panel_to_xpp055c272(panel); in xpp055c272_get_modes()
232 mode = drm_mode_duplicate(connector->dev, &default_mode); in xpp055c272_get_modes()
234 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in xpp055c272_get_modes()
237 return -ENOMEM; in xpp055c272_get_modes()
242 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in xpp055c272_get_modes()
243 connector->display_info.width_mm = mode->width_mm; in xpp055c272_get_modes()
244 connector->display_info.height_mm = mode->height_mm; in xpp055c272_get_modes()
258 struct device *dev = &dsi->dev; in xpp055c272_probe()
264 return -ENOMEM; in xpp055c272_probe()
266 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in xpp055c272_probe()
267 if (IS_ERR(ctx->reset_gpio)) in xpp055c272_probe()
268 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in xpp055c272_probe()
271 ctx->vci = devm_regulator_get(dev, "vci"); in xpp055c272_probe()
272 if (IS_ERR(ctx->vci)) in xpp055c272_probe()
273 return dev_err_probe(dev, PTR_ERR(ctx->vci), in xpp055c272_probe()
276 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in xpp055c272_probe()
277 if (IS_ERR(ctx->iovcc)) in xpp055c272_probe()
278 return dev_err_probe(dev, PTR_ERR(ctx->iovcc), in xpp055c272_probe()
283 ctx->dev = dev; in xpp055c272_probe()
285 dsi->lanes = 4; in xpp055c272_probe()
286 dsi->format = MIPI_DSI_FMT_RGB888; in xpp055c272_probe()
287 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in xpp055c272_probe()
290 drm_panel_init(&ctx->panel, &dsi->dev, &xpp055c272_funcs, in xpp055c272_probe()
293 ret = drm_panel_of_backlight(&ctx->panel); in xpp055c272_probe()
297 drm_panel_add(&ctx->panel); in xpp055c272_probe()
302 drm_panel_remove(&ctx->panel); in xpp055c272_probe()
316 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in xpp055c272_remove()
318 drm_panel_remove(&ctx->panel); in xpp055c272_remove()
329 .name = "panel-xinpeng-xpp055c272",
337 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");
338 MODULE_DESCRIPTION("DRM driver for Xinpeng xpp055c272 MIPI DSI panel");