Lines Matching full:lvds
3 * Generic LVDS panel driver
51 struct panel_lvds *lvds = to_panel_lvds(panel); in panel_lvds_unprepare() local
53 if (lvds->enable_gpio) in panel_lvds_unprepare()
54 gpiod_set_value_cansleep(lvds->enable_gpio, 0); in panel_lvds_unprepare()
56 if (lvds->supply) in panel_lvds_unprepare()
57 regulator_disable(lvds->supply); in panel_lvds_unprepare()
64 struct panel_lvds *lvds = to_panel_lvds(panel); in panel_lvds_prepare() local
66 if (lvds->supply) { in panel_lvds_prepare()
69 err = regulator_enable(lvds->supply); in panel_lvds_prepare()
71 dev_err(lvds->dev, "failed to enable supply: %d\n", in panel_lvds_prepare()
77 if (lvds->enable_gpio) in panel_lvds_prepare()
78 gpiod_set_value_cansleep(lvds->enable_gpio, 1); in panel_lvds_prepare()
86 struct panel_lvds *lvds = to_panel_lvds(panel); in panel_lvds_get_modes() local
93 drm_display_mode_from_videomode(&lvds->video_mode, mode); in panel_lvds_get_modes()
97 connector->display_info.width_mm = lvds->width; in panel_lvds_get_modes()
98 connector->display_info.height_mm = lvds->height; in panel_lvds_get_modes()
100 &lvds->bus_format, 1); in panel_lvds_get_modes()
101 connector->display_info.bus_flags = lvds->data_mirror in panel_lvds_get_modes()
104 drm_connector_set_panel_orientation(connector, lvds->orientation); in panel_lvds_get_modes()
115 static int panel_lvds_parse_dt(struct panel_lvds *lvds) in panel_lvds_parse_dt() argument
117 struct device_node *np = lvds->dev->of_node; in panel_lvds_parse_dt()
122 ret = of_drm_get_panel_orientation(np, &lvds->orientation); in panel_lvds_parse_dt()
124 dev_err(lvds->dev, "%pOF: failed to get orientation %d\n", np, ret); in panel_lvds_parse_dt()
130 dev_err(lvds->dev, "%pOF: problems parsing panel-timing (%d)\n", in panel_lvds_parse_dt()
135 videomode_from_timing(&timing, &lvds->video_mode); in panel_lvds_parse_dt()
137 ret = of_property_read_u32(np, "width-mm", &lvds->width); in panel_lvds_parse_dt()
139 dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n", in panel_lvds_parse_dt()
143 ret = of_property_read_u32(np, "height-mm", &lvds->height); in panel_lvds_parse_dt()
145 dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n", in panel_lvds_parse_dt()
150 of_property_read_string(np, "label", &lvds->label); in panel_lvds_parse_dt()
154 dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n", in panel_lvds_parse_dt()
160 lvds->bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG; in panel_lvds_parse_dt()
162 lvds->bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA; in panel_lvds_parse_dt()
164 lvds->bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG; in panel_lvds_parse_dt()
166 dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n", in panel_lvds_parse_dt()
171 lvds->data_mirror = of_property_read_bool(np, "data-mirror"); in panel_lvds_parse_dt()
178 struct panel_lvds *lvds; in panel_lvds_probe() local
181 lvds = devm_kzalloc(&pdev->dev, sizeof(*lvds), GFP_KERNEL); in panel_lvds_probe()
182 if (!lvds) in panel_lvds_probe()
185 lvds->dev = &pdev->dev; in panel_lvds_probe()
187 ret = panel_lvds_parse_dt(lvds); in panel_lvds_probe()
191 lvds->supply = devm_regulator_get_optional(lvds->dev, "power"); in panel_lvds_probe()
192 if (IS_ERR(lvds->supply)) { in panel_lvds_probe()
193 ret = PTR_ERR(lvds->supply); in panel_lvds_probe()
197 dev_err(lvds->dev, "failed to request regulator: %d\n", in panel_lvds_probe()
202 lvds->supply = NULL; in panel_lvds_probe()
206 lvds->enable_gpio = devm_gpiod_get_optional(lvds->dev, "enable", in panel_lvds_probe()
208 if (IS_ERR(lvds->enable_gpio)) { in panel_lvds_probe()
209 ret = PTR_ERR(lvds->enable_gpio); in panel_lvds_probe()
210 dev_err(lvds->dev, "failed to request %s GPIO: %d\n", in panel_lvds_probe()
215 lvds->reset_gpio = devm_gpiod_get_optional(lvds->dev, "reset", in panel_lvds_probe()
217 if (IS_ERR(lvds->reset_gpio)) { in panel_lvds_probe()
218 ret = PTR_ERR(lvds->reset_gpio); in panel_lvds_probe()
219 dev_err(lvds->dev, "failed to request %s GPIO: %d\n", in panel_lvds_probe()
226 * way for panels that don't care about power supply ordering. LVDS in panel_lvds_probe()
232 drm_panel_init(&lvds->panel, lvds->dev, &panel_lvds_funcs, in panel_lvds_probe()
235 ret = drm_panel_of_backlight(&lvds->panel); in panel_lvds_probe()
239 drm_panel_add(&lvds->panel); in panel_lvds_probe()
241 dev_set_drvdata(lvds->dev, lvds); in panel_lvds_probe()
247 struct panel_lvds *lvds = dev_get_drvdata(&pdev->dev); in panel_lvds_remove() local
249 drm_panel_remove(&lvds->panel); in panel_lvds_remove()
251 drm_panel_disable(&lvds->panel); in panel_lvds_remove()
257 { .compatible = "panel-lvds", },
267 .name = "panel-lvds",
275 MODULE_DESCRIPTION("LVDS Panel Driver");