Lines Matching +full:master +full:- +full:dsi

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
36 * TC358762XBG DSI-DPI bridge, and an I2C-connected Atmel ATTINY88-MUR
40 * This driver controls the TC358762 and ATTINY88, presenting a DSI
47 #include <linux/media-bus-format.h>
58 #define RPI_DSI_DRIVER_NAME "rpi-ts-dsi"
83 /* DSI D-PHY Layer Registers */
94 /* DSI PPI Layer Registers */
118 /* DSI Protocol Layer Registers */
140 /* DSI General Registers */
144 /* DSI Application Layer Registers */
161 /* DBI-B Host Registers */
164 /* SPI Master Registers */
193 struct mipi_dsi_device *dsi; member
200 * plugged in and clock re-computed from that.
221 return i2c_smbus_read_byte_data(ts->i2c, reg); in rpi_touchscreen_i2c_read()
229 ret = i2c_smbus_write_byte_data(ts->i2c, reg, val); in rpi_touchscreen_i2c_write()
231 dev_err(&ts->i2c->dev, "I2C write failed: %d\n", ret); in rpi_touchscreen_i2c_write()
245 mipi_dsi_generic_write(ts->dsi, msg, sizeof(msg)); in rpi_touchscreen_write()
327 mode = drm_mode_duplicate(connector->dev, m); in rpi_touchscreen_get_modes()
329 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", in rpi_touchscreen_get_modes()
330 m->hdisplay, m->vdisplay, in rpi_touchscreen_get_modes()
335 mode->type |= DRM_MODE_TYPE_DRIVER; in rpi_touchscreen_get_modes()
338 mode->type |= DRM_MODE_TYPE_PREFERRED; in rpi_touchscreen_get_modes()
346 connector->display_info.bpc = 8; in rpi_touchscreen_get_modes()
347 connector->display_info.width_mm = 154; in rpi_touchscreen_get_modes()
348 connector->display_info.height_mm = 86; in rpi_touchscreen_get_modes()
349 drm_display_info_set_bus_formats(&connector->display_info, in rpi_touchscreen_get_modes()
365 struct device *dev = &i2c->dev; in rpi_touchscreen_probe()
378 return -ENOMEM; in rpi_touchscreen_probe()
382 ts->i2c = i2c; in rpi_touchscreen_probe()
387 return -ENODEV; in rpi_touchscreen_probe()
396 return -ENODEV; in rpi_touchscreen_probe()
402 /* Look up the DSI host. It needs to probe before we do. */ in rpi_touchscreen_probe()
403 endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); in rpi_touchscreen_probe()
405 return -ENODEV; in rpi_touchscreen_probe()
415 return -EPROBE_DEFER; in rpi_touchscreen_probe()
424 ts->dsi = mipi_dsi_device_register_full(host, &info); in rpi_touchscreen_probe()
425 if (IS_ERR(ts->dsi)) { in rpi_touchscreen_probe()
426 dev_err(dev, "DSI device registration failed: %ld\n", in rpi_touchscreen_probe()
427 PTR_ERR(ts->dsi)); in rpi_touchscreen_probe()
428 return PTR_ERR(ts->dsi); in rpi_touchscreen_probe()
431 drm_panel_init(&ts->base, dev, &rpi_touchscreen_funcs, in rpi_touchscreen_probe()
434 /* This appears last, as it's what will unblock the DSI host in rpi_touchscreen_probe()
437 drm_panel_add(&ts->base); in rpi_touchscreen_probe()
443 return -ENODEV; in rpi_touchscreen_probe()
450 mipi_dsi_detach(ts->dsi); in rpi_touchscreen_remove()
452 drm_panel_remove(&ts->base); in rpi_touchscreen_remove()
454 mipi_dsi_device_unregister(ts->dsi); in rpi_touchscreen_remove()
457 static int rpi_touchscreen_dsi_probe(struct mipi_dsi_device *dsi) in rpi_touchscreen_dsi_probe() argument
461 dsi->mode_flags = (MIPI_DSI_MODE_VIDEO | in rpi_touchscreen_dsi_probe()
464 dsi->format = MIPI_DSI_FMT_RGB888; in rpi_touchscreen_dsi_probe()
465 dsi->lanes = 1; in rpi_touchscreen_dsi_probe()
467 ret = mipi_dsi_attach(dsi); in rpi_touchscreen_dsi_probe()
470 dev_err(&dsi->dev, "failed to attach dsi to host: %d\n", ret); in rpi_touchscreen_dsi_probe()
481 { .compatible = "raspberrypi,7inch-touchscreen-panel" },
510 MODULE_DESCRIPTION("Raspberry Pi 7-inch touchscreen driver");