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()
161 if (!ctx->pre_enabled) in tc358762_post_disable()
164 ctx->pre_enabled = false; in tc358762_post_disable()
166 if (ctx->reset_gpio) in tc358762_post_disable()
167 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in tc358762_post_disable()
169 ret = regulator_disable(ctx->regulator); in tc358762_post_disable()
171 dev_err(ctx->dev, "error disabling regulators (%d)\n", ret); in tc358762_post_disable()
179 ret = regulator_enable(ctx->regulator); in tc358762_pre_enable()
181 dev_err(ctx->dev, "error enabling regulators (%d)\n", ret); in tc358762_pre_enable()
183 if (ctx->reset_gpio) { in tc358762_pre_enable()
184 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in tc358762_pre_enable()
188 ctx->pre_enabled = true; in tc358762_pre_enable()
198 dev_err(ctx->dev, "error initializing bridge (%d)\n", ret); in tc358762_enable()
206 return drm_bridge_attach(bridge->encoder, ctx->panel_bridge, in tc358762_attach()
216 drm_mode_copy(&ctx->mode, mode); in tc358762_bridge_mode_set()
233 struct device *dev = ctx->dev; in tc358762_parse_dt()
235 panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); in tc358762_parse_dt()
239 ctx->panel_bridge = panel_bridge; in tc358762_parse_dt()
242 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in tc358762_parse_dt()
243 if (IS_ERR(ctx->reset_gpio)) in tc358762_parse_dt()
244 return PTR_ERR(ctx->reset_gpio); in tc358762_parse_dt()
251 ctx->regulator = devm_regulator_get(ctx->dev, "vddc"); in tc358762_configure_regulators()
252 if (IS_ERR(ctx->regulator)) in tc358762_configure_regulators()
253 return PTR_ERR(ctx->regulator); in tc358762_configure_regulators()
260 struct device *dev = &dsi->dev; in tc358762_probe()
266 return -ENOMEM; in tc358762_probe()
270 ctx->dev = dev; in tc358762_probe()
271 ctx->pre_enabled = false; in tc358762_probe()
273 /* TODO: Find out how to get dual-lane mode working */ in tc358762_probe()
274 dsi->lanes = 1; in tc358762_probe()
275 dsi->format = MIPI_DSI_FMT_RGB888; in tc358762_probe()
276 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | in tc358762_probe()
287 ctx->bridge.funcs = &tc358762_bridge_funcs; in tc358762_probe()
288 ctx->bridge.type = DRM_MODE_CONNECTOR_DPI; in tc358762_probe()
289 ctx->bridge.of_node = dev->of_node; in tc358762_probe()
290 ctx->bridge.pre_enable_prev_first = true; in tc358762_probe()
292 drm_bridge_add(&ctx->bridge); in tc358762_probe()
296 drm_bridge_remove(&ctx->bridge); in tc358762_probe()
308 drm_bridge_remove(&ctx->bridge); in tc358762_remove()
327 MODULE_AUTHOR("Marek Vasut <marex@denx.de>");
328 MODULE_DESCRIPTION("MIPI-DSI based Driver for TC358762 DSI/DPI Bridge");