Lines Matching +full:panel +full:- +full:dpi
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Toppoly TD028TTEC1 panel support
9 * Copyright (C) 2006-2007 by OpenMoko, Inc.
12 * Ported and adapted from Neo 1973 U-Boot by:
59 rc = spi_write(ddata->spi_dev, (u8 *)&tx_buf, in jbt_ret_write_0()
62 dev_err(&ddata->spi_dev->dev, in jbt_ret_write_0()
75 rc = spi_write(ddata->spi_dev, (u8 *)tx_buf, in jbt_reg_write_1()
78 dev_err(&ddata->spi_dev->dev, in jbt_reg_write_1()
93 rc = spi_write(ddata->spi_dev, (u8 *)tx_buf, in jbt_reg_write_2()
97 dev_err(&ddata->spi_dev->dev, in jbt_reg_write_2()
160 struct omap_dss_device *in = ddata->in; in td028ttec1_panel_connect()
166 r = in->ops.dpi->connect(in, dssdev); in td028ttec1_panel_connect()
176 struct omap_dss_device *in = ddata->in; in td028ttec1_panel_disconnect()
181 in->ops.dpi->disconnect(in, dssdev); in td028ttec1_panel_disconnect()
187 struct omap_dss_device *in = ddata->in; in td028ttec1_panel_enable()
191 return -ENODEV; in td028ttec1_panel_enable()
196 if (ddata->data_lines) in td028ttec1_panel_enable()
197 in->ops.dpi->set_data_lines(in, ddata->data_lines); in td028ttec1_panel_enable()
198 in->ops.dpi->set_timings(in, &ddata->videomode); in td028ttec1_panel_enable()
200 r = in->ops.dpi->enable(in); in td028ttec1_panel_enable()
204 dev_dbg(dssdev->dev, "td028ttec1_panel_enable() - state %d\n", in td028ttec1_panel_enable()
205 dssdev->state); in td028ttec1_panel_enable()
216 dev_warn(dssdev->dev, "transfer error\n"); in td028ttec1_panel_enable()
287 dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; in td028ttec1_panel_enable()
291 return r ? -EIO : 0; in td028ttec1_panel_enable()
297 struct omap_dss_device *in = ddata->in; in td028ttec1_panel_disable()
302 dev_dbg(dssdev->dev, "td028ttec1_panel_disable()\n"); in td028ttec1_panel_disable()
309 in->ops.dpi->disable(in); in td028ttec1_panel_disable()
311 dssdev->state = OMAP_DSS_DISPLAY_DISABLED; in td028ttec1_panel_disable()
318 struct omap_dss_device *in = ddata->in; in td028ttec1_panel_set_timings()
320 ddata->videomode = *timings; in td028ttec1_panel_set_timings()
321 dssdev->panel.timings = *timings; in td028ttec1_panel_set_timings()
323 in->ops.dpi->set_timings(in, timings); in td028ttec1_panel_set_timings()
331 *timings = ddata->videomode; in td028ttec1_panel_get_timings()
338 struct omap_dss_device *in = ddata->in; in td028ttec1_panel_check_timings()
340 return in->ops.dpi->check_timings(in, timings); in td028ttec1_panel_check_timings()
357 struct device_node *node = spi->dev.of_node; in td028ttec1_probe_of()
358 struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev); in td028ttec1_probe_of()
363 dev_err(&spi->dev, "failed to find video source\n"); in td028ttec1_probe_of()
367 ddata->in = in; in td028ttec1_probe_of()
378 dev_dbg(&spi->dev, "%s\n", __func__); in td028ttec1_panel_probe()
380 if (!spi->dev.of_node) in td028ttec1_panel_probe()
381 return -ENODEV; in td028ttec1_panel_probe()
383 spi->bits_per_word = 9; in td028ttec1_panel_probe()
384 spi->mode = SPI_MODE_3; in td028ttec1_panel_probe()
388 dev_err(&spi->dev, "spi_setup failed: %d\n", r); in td028ttec1_panel_probe()
392 ddata = devm_kzalloc(&spi->dev, sizeof(*ddata), GFP_KERNEL); in td028ttec1_panel_probe()
394 return -ENOMEM; in td028ttec1_panel_probe()
396 dev_set_drvdata(&spi->dev, ddata); in td028ttec1_panel_probe()
398 ddata->spi_dev = spi; in td028ttec1_panel_probe()
404 ddata->videomode = td028ttec1_panel_timings; in td028ttec1_panel_probe()
406 dssdev = &ddata->dssdev; in td028ttec1_panel_probe()
407 dssdev->dev = &spi->dev; in td028ttec1_panel_probe()
408 dssdev->driver = &td028ttec1_ops; in td028ttec1_panel_probe()
409 dssdev->type = OMAP_DISPLAY_TYPE_DPI; in td028ttec1_panel_probe()
410 dssdev->owner = THIS_MODULE; in td028ttec1_panel_probe()
411 dssdev->panel.timings = ddata->videomode; in td028ttec1_panel_probe()
412 dssdev->phy.dpi.data_lines = ddata->data_lines; in td028ttec1_panel_probe()
416 dev_err(&spi->dev, "Failed to register panel\n"); in td028ttec1_panel_probe()
423 omap_dss_put_device(ddata->in); in td028ttec1_panel_probe()
429 struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev); in td028ttec1_panel_remove()
430 struct omap_dss_device *dssdev = &ddata->dssdev; in td028ttec1_panel_remove()
431 struct omap_dss_device *in = ddata->in; in td028ttec1_panel_remove()
433 dev_dbg(&ddata->spi_dev->dev, "%s\n", __func__); in td028ttec1_panel_remove()
466 .name = "panel-tpo-td028ttec1",
475 MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver");