Lines Matching +full:panel +full:- +full:dsi
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree:
4 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
20 struct drm_panel panel; member
21 struct mipi_dsi_device *dsi; member
29 static inline struct sharp_ls060 *to_sharp_ls060(struct drm_panel *panel) in to_sharp_ls060() argument
31 return container_of(panel, struct sharp_ls060, panel); in to_sharp_ls060()
36 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in sharp_ls060_reset()
38 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in sharp_ls060_reset()
40 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in sharp_ls060_reset()
46 struct mipi_dsi_device *dsi = ctx->dsi; in sharp_ls060_on() local
47 struct device *dev = &dsi->dev; in sharp_ls060_on()
50 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in sharp_ls060_on()
52 mipi_dsi_dcs_write_seq(dsi, 0xbb, 0x13); in sharp_ls060_on()
53 mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_MEMORY_START); in sharp_ls060_on()
55 ret = mipi_dsi_dcs_exit_sleep_mode(dsi); in sharp_ls060_on()
62 ret = mipi_dsi_dcs_set_display_on(dsi); in sharp_ls060_on()
74 struct mipi_dsi_device *dsi = ctx->dsi; in sharp_ls060_off() local
75 struct device *dev = &dsi->dev; in sharp_ls060_off()
78 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in sharp_ls060_off()
80 ret = mipi_dsi_dcs_set_display_off(dsi); in sharp_ls060_off()
87 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); in sharp_ls060_off()
97 static int sharp_ls060_prepare(struct drm_panel *panel) in sharp_ls060_prepare() argument
99 struct sharp_ls060 *ctx = to_sharp_ls060(panel); in sharp_ls060_prepare()
100 struct device *dev = &ctx->dsi->dev; in sharp_ls060_prepare()
103 ret = regulator_enable(ctx->vddi_supply); in sharp_ls060_prepare()
107 ret = regulator_enable(ctx->avdd_supply); in sharp_ls060_prepare()
113 ret = regulator_enable(ctx->avee_supply); in sharp_ls060_prepare()
119 ret = regulator_enable(ctx->vddh_supply); in sharp_ls060_prepare()
129 dev_err(dev, "Failed to initialize panel: %d\n", ret); in sharp_ls060_prepare()
136 regulator_disable(ctx->vddh_supply); in sharp_ls060_prepare()
141 regulator_disable(ctx->avee_supply); in sharp_ls060_prepare()
144 regulator_disable(ctx->avdd_supply); in sharp_ls060_prepare()
146 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in sharp_ls060_prepare()
149 regulator_disable(ctx->vddi_supply); in sharp_ls060_prepare()
154 static int sharp_ls060_unprepare(struct drm_panel *panel) in sharp_ls060_unprepare() argument
156 struct sharp_ls060 *ctx = to_sharp_ls060(panel); in sharp_ls060_unprepare()
157 struct device *dev = &ctx->dsi->dev; in sharp_ls060_unprepare()
162 dev_err(dev, "Failed to un-initialize panel: %d\n", ret); in sharp_ls060_unprepare()
164 regulator_disable(ctx->vddh_supply); in sharp_ls060_unprepare()
168 regulator_disable(ctx->avee_supply); in sharp_ls060_unprepare()
169 regulator_disable(ctx->avdd_supply); in sharp_ls060_unprepare()
171 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in sharp_ls060_unprepare()
173 regulator_disable(ctx->vddi_supply); in sharp_ls060_unprepare()
192 static int sharp_ls060_get_modes(struct drm_panel *panel, in sharp_ls060_get_modes() argument
197 mode = drm_mode_duplicate(connector->dev, &sharp_ls060_mode); in sharp_ls060_get_modes()
199 return -ENOMEM; in sharp_ls060_get_modes()
203 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in sharp_ls060_get_modes()
204 connector->display_info.width_mm = mode->width_mm; in sharp_ls060_get_modes()
205 connector->display_info.height_mm = mode->height_mm; in sharp_ls060_get_modes()
217 static int sharp_ls060_probe(struct mipi_dsi_device *dsi) in sharp_ls060_probe() argument
219 struct device *dev = &dsi->dev; in sharp_ls060_probe()
225 return -ENOMEM; in sharp_ls060_probe()
227 ctx->vddi_supply = devm_regulator_get(dev, "vddi"); in sharp_ls060_probe()
228 if (IS_ERR(ctx->vddi_supply)) in sharp_ls060_probe()
229 return PTR_ERR(ctx->vddi_supply); in sharp_ls060_probe()
231 ctx->vddh_supply = devm_regulator_get(dev, "vddh"); in sharp_ls060_probe()
232 if (IS_ERR(ctx->vddh_supply)) in sharp_ls060_probe()
233 return PTR_ERR(ctx->vddh_supply); in sharp_ls060_probe()
235 ctx->avdd_supply = devm_regulator_get(dev, "avdd"); in sharp_ls060_probe()
236 if (IS_ERR(ctx->avdd_supply)) in sharp_ls060_probe()
237 return PTR_ERR(ctx->avdd_supply); in sharp_ls060_probe()
239 ctx->avee_supply = devm_regulator_get(dev, "avee"); in sharp_ls060_probe()
240 if (IS_ERR(ctx->avee_supply)) in sharp_ls060_probe()
241 return PTR_ERR(ctx->avee_supply); in sharp_ls060_probe()
243 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in sharp_ls060_probe()
244 if (IS_ERR(ctx->reset_gpio)) in sharp_ls060_probe()
245 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in sharp_ls060_probe()
246 "Failed to get reset-gpios\n"); in sharp_ls060_probe()
248 ctx->dsi = dsi; in sharp_ls060_probe()
249 mipi_dsi_set_drvdata(dsi, ctx); in sharp_ls060_probe()
251 dsi->lanes = 4; in sharp_ls060_probe()
252 dsi->format = MIPI_DSI_FMT_RGB888; in sharp_ls060_probe()
253 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in sharp_ls060_probe()
257 drm_panel_init(&ctx->panel, dev, &sharp_ls060_panel_funcs, in sharp_ls060_probe()
260 ret = drm_panel_of_backlight(&ctx->panel); in sharp_ls060_probe()
264 drm_panel_add(&ctx->panel); in sharp_ls060_probe()
266 ret = mipi_dsi_attach(dsi); in sharp_ls060_probe()
268 dev_err(dev, "Failed to attach to DSI host: %d\n", ret); in sharp_ls060_probe()
269 drm_panel_remove(&ctx->panel); in sharp_ls060_probe()
276 static void sharp_ls060_remove(struct mipi_dsi_device *dsi) in sharp_ls060_remove() argument
278 struct sharp_ls060 *ctx = mipi_dsi_get_drvdata(dsi); in sharp_ls060_remove()
281 ret = mipi_dsi_detach(dsi); in sharp_ls060_remove()
283 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in sharp_ls060_remove()
285 drm_panel_remove(&ctx->panel); in sharp_ls060_remove()
298 .name = "panel-sharp-ls060t1sx01",
305 MODULE_DESCRIPTION("DRM driver for Sharp LS060T1SX01 1080p video mode dsi panel");