Lines Matching +full:panel +full:- +full:specific
1 // SPDX-License-Identifier: GPL-2.0
3 * Elida kd35t133 3.5" MIPI-DSI panel driver
8 * Rockteck jh057n00900 5.5" MIPI-DSI panel driver
14 #include <linux/media-bus-format.h>
26 /* Manufacturer specific Commands send via DSI */
41 struct drm_panel panel; member
48 static inline struct kd35t133 *panel_to_kd35t133(struct drm_panel *panel) in panel_to_kd35t133() argument
50 return container_of(panel, struct kd35t133, panel); in panel_to_kd35t133()
56 * Init sequence was supplied by the panel vendor with minimal in kd35t133_init_sequence()
81 static int kd35t133_unprepare(struct drm_panel *panel) in kd35t133_unprepare() argument
83 struct kd35t133 *ctx = panel_to_kd35t133(panel); in kd35t133_unprepare()
84 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_unprepare()
92 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in kd35t133_unprepare()
94 regulator_disable(ctx->iovcc); in kd35t133_unprepare()
95 regulator_disable(ctx->vdd); in kd35t133_unprepare()
100 static int kd35t133_prepare(struct drm_panel *panel) in kd35t133_prepare() argument
102 struct kd35t133 *ctx = panel_to_kd35t133(panel); in kd35t133_prepare()
103 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_prepare()
106 dev_dbg(ctx->dev, "Resetting the panel\n"); in kd35t133_prepare()
107 dsi_ctx.accum_err = regulator_enable(ctx->vdd); in kd35t133_prepare()
109 dev_err(ctx->dev, "Failed to enable vdd supply: %d\n", in kd35t133_prepare()
114 dsi_ctx.accum_err = regulator_enable(ctx->iovcc); in kd35t133_prepare()
116 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", in kd35t133_prepare()
123 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in kd35t133_prepare()
125 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in kd35t133_prepare()
134 dev_dbg(ctx->dev, "Panel init sequence done\n"); in kd35t133_prepare()
145 regulator_disable(ctx->iovcc); in kd35t133_prepare()
147 regulator_disable(ctx->vdd); in kd35t133_prepare()
165 static int kd35t133_get_modes(struct drm_panel *panel, in kd35t133_get_modes() argument
168 struct kd35t133 *ctx = panel_to_kd35t133(panel); in kd35t133_get_modes()
171 mode = drm_mode_duplicate(connector->dev, &default_mode); in kd35t133_get_modes()
173 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in kd35t133_get_modes()
176 return -ENOMEM; in kd35t133_get_modes()
181 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in kd35t133_get_modes()
182 connector->display_info.width_mm = mode->width_mm; in kd35t133_get_modes()
183 connector->display_info.height_mm = mode->height_mm; in kd35t133_get_modes()
189 static enum drm_panel_orientation kd35t133_get_orientation(struct drm_panel *panel) in kd35t133_get_orientation() argument
191 struct kd35t133 *ctx = panel_to_kd35t133(panel); in kd35t133_get_orientation()
193 return ctx->orientation; in kd35t133_get_orientation()
205 struct device *dev = &dsi->dev; in kd35t133_probe()
211 return -ENOMEM; in kd35t133_probe()
213 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in kd35t133_probe()
214 if (IS_ERR(ctx->reset_gpio)) { in kd35t133_probe()
216 return PTR_ERR(ctx->reset_gpio); in kd35t133_probe()
219 ctx->vdd = devm_regulator_get(dev, "vdd"); in kd35t133_probe()
220 if (IS_ERR(ctx->vdd)) { in kd35t133_probe()
221 ret = PTR_ERR(ctx->vdd); in kd35t133_probe()
222 if (ret != -EPROBE_DEFER) in kd35t133_probe()
227 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in kd35t133_probe()
228 if (IS_ERR(ctx->iovcc)) { in kd35t133_probe()
229 ret = PTR_ERR(ctx->iovcc); in kd35t133_probe()
230 if (ret != -EPROBE_DEFER) in kd35t133_probe()
235 ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation); in kd35t133_probe()
237 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); in kd35t133_probe()
243 ctx->dev = dev; in kd35t133_probe()
245 dsi->lanes = 1; in kd35t133_probe()
246 dsi->format = MIPI_DSI_FMT_RGB888; in kd35t133_probe()
247 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in kd35t133_probe()
251 drm_panel_init(&ctx->panel, &dsi->dev, &kd35t133_funcs, in kd35t133_probe()
254 ret = drm_panel_of_backlight(&ctx->panel); in kd35t133_probe()
258 drm_panel_add(&ctx->panel); in kd35t133_probe()
263 drm_panel_remove(&ctx->panel); in kd35t133_probe()
277 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in kd35t133_remove()
279 drm_panel_remove(&ctx->panel); in kd35t133_remove()
290 .name = "panel-elida-kd35t133",
298 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");
299 MODULE_DESCRIPTION("DRM driver for Elida kd35t133 MIPI DSI panel");