Lines Matching defs:nt

150 	struct nt35560 *nt = bl_get_data(bl);
151 struct mipi_dsi_device *dsi = to_mipi_dsi_device(nt->dev);
165 dev_err(nt->dev, "failed to disable display backlight (%d)\n", ret);
178 dev_dbg(nt->dev, "calculated duty cycle %02x\n", pwm_ratio);
182 dev_err(nt->dev, "failed to set display PWM ratio (%d)\n", ret);
198 dev_err(nt->dev, "failed to unlock CMD 2 (%d)\n", ret);
204 dev_err(nt->dev, "failed to enter page 1 (%d)\n", ret);
210 dev_err(nt->dev, "failed to disable MTP reload (%d)\n", ret);
215 dev_err(nt->dev, "failed to set PWM divisor (%d)\n", ret);
221 dev_err(nt->dev, "failed to lock CMD 2 (%d)\n", ret);
230 dev_err(nt->dev, "failed to enable display backlight (%d)\n", ret);
247 static int nt35560_read_id(struct nt35560 *nt)
249 struct mipi_dsi_device *dsi = to_mipi_dsi_device(nt->dev);
256 dev_err(nt->dev, "could not vendor ID byte\n");
261 dev_err(nt->dev, "could not read device version byte\n");
266 dev_err(nt->dev, "could not read panel ID byte\n");
271 dev_err(nt->dev, "device vendor ID is zero\n");
281 dev_info(nt->dev, "MTP vendor: %02x, version: %02x, panel: %02x\n",
285 dev_info(nt->dev, "unknown vendor: %02x, version: %02x, panel: %02x\n",
293 static int nt35560_power_on(struct nt35560 *nt)
297 ret = regulator_enable(nt->supply);
299 dev_err(nt->dev, "failed to enable supply (%d)\n", ret);
304 gpiod_set_value_cansleep(nt->reset_gpio, 1);
307 gpiod_set_value_cansleep(nt->reset_gpio, 0);
313 static void nt35560_power_off(struct nt35560 *nt)
316 gpiod_set_value_cansleep(nt->reset_gpio, 1);
319 regulator_disable(nt->supply);
324 struct nt35560 *nt = panel_to_nt35560(panel);
325 struct mipi_dsi_device *dsi = to_mipi_dsi_device(nt->dev);
329 ret = nt35560_power_on(nt);
333 ret = nt35560_read_id(nt);
335 dev_err(nt->dev, "failed to read panel ID (%d)\n", ret);
343 dev_err(nt->dev, "failed to enable vblank TE (%d)\n", ret);
360 dev_err(nt->dev, "failed to set MDDI (%d)\n", ret);
367 dev_err(nt->dev, "failed to exit sleep mode (%d)\n", ret);
374 dev_err(nt->dev, "failed to turn display on (%d)\n", ret);
377 if (nt->video_mode) {
381 dev_err(nt->dev, "failed to turn on peripheral\n");
389 nt35560_power_off(nt);
395 struct nt35560 *nt = panel_to_nt35560(panel);
396 struct mipi_dsi_device *dsi = to_mipi_dsi_device(nt->dev);
401 dev_err(nt->dev, "failed to turn display off (%d)\n", ret);
408 dev_err(nt->dev, "failed to enter sleep mode (%d)\n", ret);
413 nt35560_power_off(nt);
422 struct nt35560 *nt = panel_to_nt35560(panel);
423 const struct nt35560_config *conf = nt->conf;
426 if (nt->video_mode)
456 struct nt35560 *nt;
459 nt = devm_kzalloc(dev, sizeof(struct nt35560), GFP_KERNEL);
460 if (!nt)
462 nt->video_mode = of_property_read_bool(dev->of_node,
465 mipi_dsi_set_drvdata(dsi, nt);
466 nt->dev = dev;
468 nt->conf = of_device_get_match_data(dev);
469 if (!nt->conf) {
485 if (nt->video_mode)
494 nt->supply = devm_regulator_get(dev, "vddi");
495 if (IS_ERR(nt->supply))
496 return PTR_ERR(nt->supply);
499 nt->reset_gpio = devm_gpiod_get_optional(dev, "reset",
501 if (IS_ERR(nt->reset_gpio))
502 return dev_err_probe(dev, PTR_ERR(nt->reset_gpio),
505 drm_panel_init(&nt->panel, dev, &nt35560_drm_funcs,
508 nt->panel.backlight = devm_backlight_device_register(dev, "nt35560", dev, nt,
510 if (IS_ERR(nt->panel.backlight))
511 return dev_err_probe(dev, PTR_ERR(nt->panel.backlight),
514 drm_panel_add(&nt->panel);
518 drm_panel_remove(&nt->panel);
527 struct nt35560 *nt = mipi_dsi_get_drvdata(dsi);
530 drm_panel_remove(&nt->panel);