Lines Matching +full:panel +full:- +full:dpi
2 * Copyright © 2016-2017 Broadcom
8 * Portions of this file (derived from panel-simple.c) are:
25 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
33 * Raspberry Pi 7" touchscreen panel driver.
35 * The 7" touchscreen consists of a DPI LCD panel, a Toshiba
36 * TC358762XBG DSI-DPI bridge, and an I2C-connected Atmel ATTINY88-MUR
59 #define RPI_DSI_DRIVER_NAME "rpi-ts-dsi"
84 /* DSI D-PHY Layer Registers */
154 /* LCDC/DPI Host Registers */
162 /* DBI-B Host Registers */
201 * plugged in and clock re-computed from that.
215 static struct rpi_touchscreen *panel_to_ts(struct drm_panel *panel) in panel_to_ts() argument
217 return container_of(panel, struct rpi_touchscreen, base); in panel_to_ts()
222 return i2c_smbus_read_byte_data(ts->i2c, reg); in rpi_touchscreen_i2c_read()
230 ret = i2c_smbus_write_byte_data(ts->i2c, reg, val); in rpi_touchscreen_i2c_write()
232 dev_err(&ts->dsi->dev, "I2C write failed: %d\n", ret); in rpi_touchscreen_i2c_write()
246 mipi_dsi_generic_write(ts->dsi, msg, sizeof(msg)); in rpi_touchscreen_write()
251 static int rpi_touchscreen_disable(struct drm_panel *panel) in rpi_touchscreen_disable() argument
253 struct rpi_touchscreen *ts = panel_to_ts(panel); in rpi_touchscreen_disable()
263 static int rpi_touchscreen_noop(struct drm_panel *panel) in rpi_touchscreen_noop() argument
268 static int rpi_touchscreen_enable(struct drm_panel *panel) in rpi_touchscreen_enable() argument
270 struct rpi_touchscreen *ts = panel_to_ts(panel); in rpi_touchscreen_enable()
302 * firmware used for the panel. Runtime rotation in rpi_touchscreen_enable()
311 static int rpi_touchscreen_get_modes(struct drm_panel *panel, in rpi_touchscreen_get_modes() argument
321 mode = drm_mode_duplicate(connector->dev, m); in rpi_touchscreen_get_modes()
323 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", in rpi_touchscreen_get_modes()
324 m->hdisplay, m->vdisplay, in rpi_touchscreen_get_modes()
329 mode->type |= DRM_MODE_TYPE_DRIVER; in rpi_touchscreen_get_modes()
332 mode->type |= DRM_MODE_TYPE_PREFERRED; in rpi_touchscreen_get_modes()
340 connector->display_info.bpc = 8; in rpi_touchscreen_get_modes()
341 connector->display_info.width_mm = 154; in rpi_touchscreen_get_modes()
342 connector->display_info.height_mm = 86; in rpi_touchscreen_get_modes()
343 drm_display_info_set_bus_formats(&connector->display_info, in rpi_touchscreen_get_modes()
360 struct device *dev = &i2c->dev; in rpi_touchscreen_probe()
373 return -ENOMEM; in rpi_touchscreen_probe()
377 ts->i2c = i2c; in rpi_touchscreen_probe()
382 return -ENODEV; in rpi_touchscreen_probe()
391 return -ENODEV; in rpi_touchscreen_probe()
398 endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); in rpi_touchscreen_probe()
400 return -ENODEV; in rpi_touchscreen_probe()
410 return -EPROBE_DEFER; in rpi_touchscreen_probe()
419 ts->dsi = mipi_dsi_device_register_full(host, &info); in rpi_touchscreen_probe()
420 if (IS_ERR(ts->dsi)) { in rpi_touchscreen_probe()
422 PTR_ERR(ts->dsi)); in rpi_touchscreen_probe()
423 return PTR_ERR(ts->dsi); in rpi_touchscreen_probe()
426 drm_panel_init(&ts->base, dev, &rpi_touchscreen_funcs, in rpi_touchscreen_probe()
432 drm_panel_add(&ts->base); in rpi_touchscreen_probe()
438 return -ENODEV; in rpi_touchscreen_probe()
445 mipi_dsi_detach(ts->dsi); in rpi_touchscreen_remove()
447 drm_panel_remove(&ts->base); in rpi_touchscreen_remove()
449 mipi_dsi_device_unregister(ts->dsi); in rpi_touchscreen_remove()
450 kfree(ts->dsi); in rpi_touchscreen_remove()
459 dsi->mode_flags = (MIPI_DSI_MODE_VIDEO | in rpi_touchscreen_dsi_probe()
462 dsi->format = MIPI_DSI_FMT_RGB888; in rpi_touchscreen_dsi_probe()
463 dsi->lanes = 1; in rpi_touchscreen_dsi_probe()
468 dev_err(&dsi->dev, "failed to attach dsi to host: %d\n", ret); in rpi_touchscreen_dsi_probe()
479 { .compatible = "raspberrypi,7inch-touchscreen-panel" },
508 MODULE_DESCRIPTION("Raspberry Pi 7-inch touchscreen driver");