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; member
223 * The last bit/clock is Hi-Z turnaround cycle, so we need in tpg110_readwrite_reg()
225 * turn-around cycle. in tpg110_readwrite_reg()
238 ret = spi_sync(tpg->spi, &m); in tpg110_readwrite_reg()
240 dev_err(tpg->dev, "SPI message error %d\n", ret); in tpg110_readwrite_reg()
264 /* De-assert the reset signal */ in tpg110_startup()
265 gpiod_set_value_cansleep(tpg->grestb, 0); in tpg110_startup()
267 dev_dbg(tpg->dev, "de-asserted GRESTB\n"); in tpg110_startup()
273 dev_err(tpg->dev, "failed communication test\n"); in tpg110_startup()
274 return -ENODEV; in tpg110_startup()
278 dev_info(tpg->dev, "TPG110 chip ID: %d version: %d\n", in tpg110_startup()
286 dev_info(tpg->dev, "IN 400x240 RGB -> OUT 800x480 RGB (dual scan)\n"); in tpg110_startup()
289 dev_info(tpg->dev, "IN 480x272 RGB -> OUT 800x480 RGB (dual scan)\n"); in tpg110_startup()
292 dev_info(tpg->dev, "480x640 RGB\n"); in tpg110_startup()
295 dev_info(tpg->dev, "480x272 RGB\n"); in tpg110_startup()
298 dev_info(tpg->dev, "640x480 RGB\n"); in tpg110_startup()
301 dev_info(tpg->dev, "800x480 RGB\n"); in tpg110_startup()
304 dev_err(tpg->dev, "ILLEGAL RESOLUTION 0x%02x\n", val); in tpg110_startup()
316 if (pm->magic == val) { in tpg110_startup()
317 tpg->panel_mode = pm; in tpg110_startup()
322 dev_err(tpg->dev, "unsupported mode (%02x) detected\n", val); in tpg110_startup()
323 return -ENODEV; in tpg110_startup()
327 dev_info(tpg->dev, "resolution and standby is controlled by %s\n", in tpg110_startup()
363 * tpg110_get_modes() - return the appropriate mode
377 connector->display_info.width_mm = tpg->width; in tpg110_get_modes()
378 connector->display_info.height_mm = tpg->height; in tpg110_get_modes()
379 connector->display_info.bus_flags = tpg->panel_mode->bus_flags; in tpg110_get_modes()
381 mode = drm_mode_duplicate(connector->dev, &tpg->panel_mode->mode); in tpg110_get_modes()
383 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in tpg110_get_modes()
385 mode->width_mm = tpg->width; in tpg110_get_modes()
386 mode->height_mm = tpg->height; in tpg110_get_modes()
401 struct device *dev = &spi->dev; in tpg110_probe()
402 struct device_node *np = dev->of_node; in tpg110_probe()
408 return -ENOMEM; in tpg110_probe()
409 tpg->dev = dev; in tpg110_probe()
412 ret = of_property_read_u32(np, "width-mm", &tpg->width); in tpg110_probe()
415 ret = of_property_read_u32(np, "height-mm", &tpg->height); in tpg110_probe()
417 dev_err(dev, "no panel height specified\n"); in tpg110_probe()
420 tpg->grestb = devm_gpiod_get(dev, "grestb", GPIOD_OUT_HIGH); in tpg110_probe()
421 if (IS_ERR(tpg->grestb)) { in tpg110_probe()
423 return -ENODEV; in tpg110_probe()
426 spi->bits_per_word = 8; in tpg110_probe()
427 spi->mode |= SPI_3WIRE_HIZ; in tpg110_probe()
433 tpg->spi = spi; in tpg110_probe()
439 drm_panel_init(&tpg->panel, dev, &tpg110_drm_funcs, in tpg110_probe()
442 ret = drm_panel_of_backlight(&tpg->panel); in tpg110_probe()
448 drm_panel_add(&tpg->panel); in tpg110_probe()
457 drm_panel_remove(&tpg->panel); in tpg110_remove()
470 .name = "tpo-tpg110-panel",