Lines Matching +full:height +full:- +full:mm
1 // SPDX-License-Identifier: GPL-2.0
7 * display is actually connected to it, so the width and height of that
41 * struct tpg110_panel_mode - lookup struct for the supported modes
63 * struct tpg110 - state container for the TPG110 panel
83 * @width: the width of this panel in mm
87 * @height: the height of this panel in mm
89 u32 height;
223 * The last bit/clock is Hi-Z turnaround cycle, so we need
225 * turn-around cycle.
238 ret = spi_sync(tpg->spi, &m);
240 dev_err(tpg->dev, "SPI message error %d\n", ret);
264 /* De-assert the reset signal */
265 gpiod_set_value_cansleep(tpg->grestb, 0);
267 dev_dbg(tpg->dev, "de-asserted GRESTB\n");
273 dev_err(tpg->dev, "failed communication test\n");
274 return -ENODEV;
278 dev_info(tpg->dev, "TPG110 chip ID: %d version: %d\n",
286 dev_info(tpg->dev, "IN 400x240 RGB -> OUT 800x480 RGB (dual scan)\n");
289 dev_info(tpg->dev, "IN 480x272 RGB -> OUT 800x480 RGB (dual scan)\n");
292 dev_info(tpg->dev, "480x640 RGB\n");
295 dev_info(tpg->dev, "480x272 RGB\n");
298 dev_info(tpg->dev, "640x480 RGB\n");
301 dev_info(tpg->dev, "800x480 RGB\n");
304 dev_err(tpg->dev, "ILLEGAL RESOLUTION 0x%02x\n", val);
316 if (pm->magic == val) {
317 tpg->panel_mode = pm;
322 dev_err(tpg->dev, "unsupported mode (%02x) detected\n", val);
323 return -ENODEV;
327 dev_info(tpg->dev, "resolution and standby is controlled by %s\n",
363 * tpg110_get_modes() - return the appropriate mode
377 connector->display_info.width_mm = tpg->width;
378 connector->display_info.height_mm = tpg->height;
379 connector->display_info.bus_flags = tpg->panel_mode->bus_flags;
381 mode = drm_mode_duplicate(connector->dev, &tpg->panel_mode->mode);
383 return -ENOMEM;
385 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
387 mode->width_mm = tpg->width;
388 mode->height_mm = tpg->height;
403 struct device *dev = &spi->dev;
404 struct device_node *np = dev->of_node;
413 tpg->dev = dev;
416 ret = of_property_read_u32(np, "width-mm", &tpg->width);
419 ret = of_property_read_u32(np, "height-mm", &tpg->height);
421 dev_err(dev, "no panel height specified\n");
424 tpg->grestb = devm_gpiod_get(dev, "grestb", GPIOD_OUT_HIGH);
425 if (IS_ERR(tpg->grestb)) {
427 return -ENODEV;
430 spi->bits_per_word = 8;
431 spi->mode |= SPI_3WIRE_HIZ;
437 tpg->spi = spi;
443 ret = drm_panel_of_backlight(&tpg->panel);
449 drm_panel_add(&tpg->panel);
458 drm_panel_remove(&tpg->panel);
478 .name = "tpo-tpg110-panel",