Lines Matching +full:elvss +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0
3 * Magnachip d53e6ea8966 MIPI-DSI panel driver
18 #include <linux/media-bus-format.h>
58 /** @reg_vdd: VDD supply regulator for panel logic */
60 /** @reg_elvdd: ELVDD supply regulator for panel display */
64 /** @bl_dev: pseudo-backlight device for oled panel */
72 #define MAX_BRIGHTNESS (NUM_GAMMA_LEVELS - 1)
142 * Table of elvss values provided in datasheet and corresponds to
168 struct mipi_dbi *dbi = &db->dbi; in ams495qa01_panel_init()
210 ret = regulator_enable(db->reg_vdd); in d53e6ea8966_prepare()
212 dev_err(db->dev, "failed to enable vdd regulator: %d\n", ret); in d53e6ea8966_prepare()
216 if (db->reg_elvdd) { in d53e6ea8966_prepare()
217 ret = regulator_enable(db->reg_elvdd); in d53e6ea8966_prepare()
219 dev_err(db->dev, in d53e6ea8966_prepare()
221 regulator_disable(db->reg_vdd); in d53e6ea8966_prepare()
227 if (db->enable) in d53e6ea8966_prepare()
228 gpiod_set_value_cansleep(db->enable, 1); in d53e6ea8966_prepare()
233 gpiod_set_value_cansleep(db->reset, 1); in d53e6ea8966_prepare()
235 gpiod_set_value_cansleep(db->reset, 0); in d53e6ea8966_prepare()
238 db->panel_info->panel_init_seq(db); in d53e6ea8966_prepare()
246 struct mipi_dbi *dbi = &db->dbi; in d53e6ea8966_enable()
259 struct mipi_dbi *dbi = &db->dbi; in d53e6ea8966_disable()
273 if (db->enable) in d53e6ea8966_unprepare()
274 gpiod_set_value_cansleep(db->enable, 0); in d53e6ea8966_unprepare()
276 gpiod_set_value_cansleep(db->reset, 1); in d53e6ea8966_unprepare()
278 if (db->reg_elvdd) in d53e6ea8966_unprepare()
279 regulator_disable(db->reg_elvdd); in d53e6ea8966_unprepare()
281 regulator_disable(db->reg_vdd); in d53e6ea8966_unprepare()
291 const struct d53e6ea8966_panel_info *panel_info = db->panel_info; in d53e6ea8966_get_modes()
296 for (i = 0; i < panel_info->num_modes; i++) { in d53e6ea8966_get_modes()
297 mode = drm_mode_duplicate(connector->dev, in d53e6ea8966_get_modes()
298 &panel_info->display_modes[i]); in d53e6ea8966_get_modes()
300 return -ENOMEM; in d53e6ea8966_get_modes()
306 connector->display_info.bpc = 8; in d53e6ea8966_get_modes()
307 connector->display_info.width_mm = panel_info->width_mm; in d53e6ea8966_get_modes()
308 connector->display_info.height_mm = panel_info->height_mm; in d53e6ea8966_get_modes()
309 connector->display_info.bus_flags = panel_info->bus_flags; in d53e6ea8966_get_modes()
311 drm_display_info_set_bus_formats(&connector->display_info, in d53e6ea8966_get_modes()
328 struct mipi_dbi *dbi = &db->dbi; in ams495qa01_set_brightness()
347 struct device *dev = db->dev; in ams495qa01_backlight_register()
350 db->bl_dev = devm_backlight_device_register(dev, "panel", dev, db, in ams495qa01_backlight_register()
353 if (IS_ERR(db->bl_dev)) { in ams495qa01_backlight_register()
354 ret = PTR_ERR(db->bl_dev); in ams495qa01_backlight_register()
363 struct device *dev = &spi->dev; in d53e6ea8966_probe()
375 return -ENOMEM; in d53e6ea8966_probe()
379 db->dev = dev; in d53e6ea8966_probe()
381 db->panel_info = of_device_get_match_data(dev); in d53e6ea8966_probe()
382 if (!db->panel_info) in d53e6ea8966_probe()
383 return -EINVAL; in d53e6ea8966_probe()
385 db->reg_vdd = devm_regulator_get(dev, "vdd"); in d53e6ea8966_probe()
386 if (IS_ERR(db->reg_vdd)) in d53e6ea8966_probe()
387 return dev_err_probe(dev, PTR_ERR(db->reg_vdd), in d53e6ea8966_probe()
388 "Failed to get vdd supply\n"); in d53e6ea8966_probe()
390 db->reg_elvdd = devm_regulator_get_optional(dev, "elvdd"); in d53e6ea8966_probe()
391 if (IS_ERR(db->reg_elvdd)) in d53e6ea8966_probe()
392 db->reg_elvdd = NULL; in d53e6ea8966_probe()
394 db->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in d53e6ea8966_probe()
395 if (IS_ERR(db->reset)) { in d53e6ea8966_probe()
396 ret = PTR_ERR(db->reset); in d53e6ea8966_probe()
400 db->enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW); in d53e6ea8966_probe()
401 if (IS_ERR(db->enable)) { in d53e6ea8966_probe()
402 ret = PTR_ERR(db->enable); in d53e6ea8966_probe()
406 ret = mipi_dbi_spi_init(spi, &db->dbi, NULL); in d53e6ea8966_probe()
416 db->dsi_dev = devm_mipi_dsi_device_register_full(dev, dsi_host, &info); in d53e6ea8966_probe()
417 if (IS_ERR(db->dsi_dev)) { in d53e6ea8966_probe()
419 PTR_ERR(db->dsi_dev)); in d53e6ea8966_probe()
420 return PTR_ERR(db->dsi_dev); in d53e6ea8966_probe()
423 db->dsi_dev->lanes = 2; in d53e6ea8966_probe()
424 db->dsi_dev->format = MIPI_DSI_FMT_RGB888; in d53e6ea8966_probe()
425 db->dsi_dev->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in d53e6ea8966_probe()
428 drm_panel_init(&db->panel, dev, &d53e6ea8966_panel_funcs, in d53e6ea8966_probe()
431 if (db->panel_info->backlight_register) { in d53e6ea8966_probe()
432 ret = db->panel_info->backlight_register(db); in d53e6ea8966_probe()
435 db->panel.backlight = db->bl_dev; in d53e6ea8966_probe()
438 drm_panel_add(&db->panel); in d53e6ea8966_probe()
440 ret = devm_mipi_dsi_attach(dev, db->dsi_dev); in d53e6ea8966_probe()
443 drm_panel_remove(&db->panel); in d53e6ea8966_probe()
454 drm_panel_remove(&db->panel); in d53e6ea8966_remove()
510 .name = "d53e6ea8966-panel",