Lines Matching +full:de +full:- +full:assertion
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2020 Marek Vasut <marex@denx.de>
35 #define PPI_D0S_CLRSIPOCOUNT 0x0164 /* Assertion timer for Lane 0 */
36 #define PPI_D1S_CLRSIPOCOUNT 0x0168 /* Assertion timer for Lane 1 */
40 #define DSI_STARTDSI 0x0204 /* START control bit of DSI-TX */
52 #define LCDCTRL_DEPOL BIT(18) /* Polarity of DE signal */
84 int ret = ctx->error; in tc358762_clear_error()
86 ctx->error = 0; in tc358762_clear_error()
92 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in tc358762_write()
96 if (ctx->error) in tc358762_write()
108 ctx->error = ret; in tc358762_write()
133 if (ctx->mode.flags & DRM_MODE_FLAG_NHSYNC) in tc358762_init()
136 if (ctx->mode.flags & DRM_MODE_FLAG_NVSYNC) in tc358762_init()
162 if (!ctx->pre_enabled) in tc358762_post_disable()
165 ctx->pre_enabled = false; in tc358762_post_disable()
167 if (ctx->reset_gpio) in tc358762_post_disable()
168 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in tc358762_post_disable()
170 ret = regulator_disable(ctx->regulator); in tc358762_post_disable()
172 dev_err(ctx->dev, "error disabling regulators (%d)\n", ret); in tc358762_post_disable()
181 ret = regulator_enable(ctx->regulator); in tc358762_pre_enable()
183 dev_err(ctx->dev, "error enabling regulators (%d)\n", ret); in tc358762_pre_enable()
185 if (ctx->reset_gpio) { in tc358762_pre_enable()
186 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in tc358762_pre_enable()
190 ctx->pre_enabled = true; in tc358762_pre_enable()
201 dev_err(ctx->dev, "error initializing bridge (%d)\n", ret); in tc358762_enable()
209 return drm_bridge_attach(bridge->encoder, ctx->panel_bridge, in tc358762_attach()
219 drm_mode_copy(&ctx->mode, mode); in tc358762_bridge_mode_set()
236 struct device *dev = ctx->dev; in tc358762_parse_dt()
238 panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); in tc358762_parse_dt()
242 ctx->panel_bridge = panel_bridge; in tc358762_parse_dt()
245 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in tc358762_parse_dt()
246 if (IS_ERR(ctx->reset_gpio)) in tc358762_parse_dt()
247 return PTR_ERR(ctx->reset_gpio); in tc358762_parse_dt()
254 ctx->regulator = devm_regulator_get(ctx->dev, "vddc"); in tc358762_configure_regulators()
255 if (IS_ERR(ctx->regulator)) in tc358762_configure_regulators()
256 return PTR_ERR(ctx->regulator); in tc358762_configure_regulators()
263 struct device *dev = &dsi->dev; in tc358762_probe()
269 return -ENOMEM; in tc358762_probe()
273 ctx->dev = dev; in tc358762_probe()
274 ctx->pre_enabled = false; in tc358762_probe()
276 /* TODO: Find out how to get dual-lane mode working */ in tc358762_probe()
277 dsi->lanes = 1; in tc358762_probe()
278 dsi->format = MIPI_DSI_FMT_RGB888; in tc358762_probe()
279 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | in tc358762_probe()
290 ctx->bridge.funcs = &tc358762_bridge_funcs; in tc358762_probe()
291 ctx->bridge.type = DRM_MODE_CONNECTOR_DPI; in tc358762_probe()
292 ctx->bridge.of_node = dev->of_node; in tc358762_probe()
293 ctx->bridge.pre_enable_prev_first = true; in tc358762_probe()
295 drm_bridge_add(&ctx->bridge); in tc358762_probe()
299 drm_bridge_remove(&ctx->bridge); in tc358762_probe()
311 drm_bridge_remove(&ctx->bridge); in tc358762_remove()
330 MODULE_AUTHOR("Marek Vasut <marex@denx.de>");
331 MODULE_DESCRIPTION("MIPI-DSI based Driver for TC358762 DSI/DPI Bridge");