Lines Matching +full:de +full:- +full:asserts
1 // SPDX-License-Identifier: GPL-2.0
41 * struct tpg110_panel_mode - lookup struct for the supported modes
63 * struct tpg110 - state container for the TPG110 panel
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 return -ENOMEM; in tpg110_get_modes()
385 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in tpg110_get_modes()
387 mode->width_mm = tpg->width; in tpg110_get_modes()
388 mode->height_mm = tpg->height; in tpg110_get_modes()
403 struct device *dev = &spi->dev; in tpg110_probe()
404 struct device_node *np = dev->of_node; in tpg110_probe()
410 return -ENOMEM; in tpg110_probe()
411 tpg->dev = dev; in tpg110_probe()
414 ret = of_property_read_u32(np, "width-mm", &tpg->width); in tpg110_probe()
417 ret = of_property_read_u32(np, "height-mm", &tpg->height); in tpg110_probe()
421 /* This asserts the GRESTB signal, putting the display into reset */ in tpg110_probe()
422 tpg->grestb = devm_gpiod_get(dev, "grestb", GPIOD_OUT_HIGH); in tpg110_probe()
423 if (IS_ERR(tpg->grestb)) { in tpg110_probe()
425 return -ENODEV; in tpg110_probe()
428 spi->bits_per_word = 8; in tpg110_probe()
429 spi->mode |= SPI_3WIRE_HIZ; in tpg110_probe()
435 tpg->spi = spi; in tpg110_probe()
441 drm_panel_init(&tpg->panel, dev, &tpg110_drm_funcs, in tpg110_probe()
444 ret = drm_panel_of_backlight(&tpg->panel); in tpg110_probe()
450 drm_panel_add(&tpg->panel); in tpg110_probe()
459 drm_panel_remove(&tpg->panel); in tpg110_remove()
479 .name = "tpo-tpg110-panel",