Lines Matching +full:dual +full:- +full:dsi +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0
38 /* DSI layer registers */
39 #define DSI_STARTDSI 0x0204 /* START control bit of DSI-TX */
56 /* Lane enable PPI and DSI register bits */
73 int ret = ctx->error; in tc358762_clear_error()
75 ctx->error = 0; in tc358762_clear_error()
81 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in tc358762_write() local
85 if (ctx->error) in tc358762_write()
95 ret = mipi_dsi_generic_write(dsi, data, sizeof(data)); in tc358762_write()
97 ctx->error = ret; in tc358762_write()
137 if (!ctx->pre_enabled) in tc358762_post_disable()
140 ctx->pre_enabled = false; in tc358762_post_disable()
142 ret = regulator_disable(ctx->regulator); in tc358762_post_disable()
144 dev_err(ctx->dev, "error disabling regulators (%d)\n", ret); in tc358762_post_disable()
152 ret = regulator_enable(ctx->regulator); in tc358762_pre_enable()
154 dev_err(ctx->dev, "error enabling regulators (%d)\n", ret); in tc358762_pre_enable()
158 dev_err(ctx->dev, "error initializing bridge (%d)\n", ret); in tc358762_pre_enable()
160 ctx->pre_enabled = true; in tc358762_pre_enable()
168 return drm_bridge_attach(bridge->encoder, ctx->panel_bridge, in tc358762_attach()
181 struct device *dev = ctx->dev; in tc358762_parse_dt()
185 ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, NULL); in tc358762_parse_dt()
194 ctx->panel_bridge = panel_bridge; in tc358762_parse_dt()
201 ctx->regulator = devm_regulator_get(ctx->dev, "vddc"); in tc358762_configure_regulators()
202 if (IS_ERR(ctx->regulator)) in tc358762_configure_regulators()
203 return PTR_ERR(ctx->regulator); in tc358762_configure_regulators()
208 static int tc358762_probe(struct mipi_dsi_device *dsi) in tc358762_probe() argument
210 struct device *dev = &dsi->dev; in tc358762_probe()
216 return -ENOMEM; in tc358762_probe()
218 mipi_dsi_set_drvdata(dsi, ctx); in tc358762_probe()
220 ctx->dev = dev; in tc358762_probe()
221 ctx->pre_enabled = false; in tc358762_probe()
223 /* TODO: Find out how to get dual-lane mode working */ in tc358762_probe()
224 dsi->lanes = 1; in tc358762_probe()
225 dsi->format = MIPI_DSI_FMT_RGB888; in tc358762_probe()
226 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | in tc358762_probe()
237 ctx->bridge.funcs = &tc358762_bridge_funcs; in tc358762_probe()
238 ctx->bridge.type = DRM_MODE_CONNECTOR_DPI; in tc358762_probe()
239 ctx->bridge.of_node = dev->of_node; in tc358762_probe()
241 drm_bridge_add(&ctx->bridge); in tc358762_probe()
243 ret = mipi_dsi_attach(dsi); in tc358762_probe()
245 drm_bridge_remove(&ctx->bridge); in tc358762_probe()
246 dev_err(dev, "failed to attach dsi\n"); in tc358762_probe()
252 static int tc358762_remove(struct mipi_dsi_device *dsi) in tc358762_remove() argument
254 struct tc358762 *ctx = mipi_dsi_get_drvdata(dsi); in tc358762_remove()
256 mipi_dsi_detach(dsi); in tc358762_remove()
257 drm_bridge_remove(&ctx->bridge); in tc358762_remove()
279 MODULE_DESCRIPTION("MIPI-DSI based Driver for TC358762 DSI/DPI Bridge");