Lines Matching refs:ret

43 	int ret;  in otm8009a_dcs_write()  local
45 ret = mipi_dsi_dcs_write(cfg->mipi_dsi, cfg->channel, cmd, buf, len); in otm8009a_dcs_write()
46 if (ret < 0) { in otm8009a_dcs_write()
47 LOG_ERR("DCS 0x%x write failed! (%d)", cmd, ret); in otm8009a_dcs_write()
48 return ret; in otm8009a_dcs_write()
58 int ret; in otm8009a_mcs_write() local
61 ret = mipi_dsi_dcs_write(cfg->mipi_dsi, cfg->channel, OTM8009A_MCS_ADRSFT, &scmd, 1); in otm8009a_mcs_write()
62 if (ret < 0) { in otm8009a_mcs_write()
63 return ret; in otm8009a_mcs_write()
66 ret = mipi_dsi_dcs_write(cfg->mipi_dsi, cfg->channel, cmd >> 8, buf, len); in otm8009a_mcs_write()
67 if (ret < 0) { in otm8009a_mcs_write()
68 return ret; in otm8009a_mcs_write()
78 int ret; in otm8009a_check_id() local
80 ret = mipi_dsi_dcs_read(cfg->mipi_dsi, cfg->channel, OTM8009A_CMD_ID1, &id, sizeof(id)); in otm8009a_check_id()
81 if (ret != sizeof(id)) { in otm8009a_check_id()
82 LOG_ERR("Read panel ID failed! (%d)", ret); in otm8009a_check_id()
98 int ret; in otm8009a_configure() local
173 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_CMD2_ENA1, buf, 3); in otm8009a_configure()
174 if (ret < 0) { in otm8009a_configure()
175 return ret; in otm8009a_configure()
181 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_CMD2_ENA2, buf, 2); in otm8009a_configure()
182 if (ret < 0) { in otm8009a_configure()
183 return ret; in otm8009a_configure()
189 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_SD_PCH_CTRL, buf, 2); in otm8009a_configure()
190 if (ret < 0) { in otm8009a_configure()
191 return ret; in otm8009a_configure()
196 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_NO_DOC1, buf, 1); in otm8009a_configure()
197 if (ret < 0) { in otm8009a_configure()
198 return ret; in otm8009a_configure()
205 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PWR_CTRL4, buf, 2); in otm8009a_configure()
206 if (ret < 0) { in otm8009a_configure()
207 return ret; in otm8009a_configure()
215 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PWR_CTRL2, pwr_ctrl2, sizeof(pwr_ctrl2)); in otm8009a_configure()
216 if (ret < 0) { in otm8009a_configure()
217 return ret; in otm8009a_configure()
223 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_P_DRV_M, buf, 1); in otm8009a_configure()
224 if (ret < 0) { in otm8009a_configure()
225 return ret; in otm8009a_configure()
231 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_VCOMDC, buf, 1); in otm8009a_configure()
232 if (ret < 0) { in otm8009a_configure()
233 return ret; in otm8009a_configure()
239 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_OSC_ADJ, buf, 1); in otm8009a_configure()
240 if (ret < 0) { in otm8009a_configure()
241 return ret; in otm8009a_configure()
246 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_RGB_VID_SET, buf, 1); in otm8009a_configure()
247 if (ret < 0) { in otm8009a_configure()
248 return ret; in otm8009a_configure()
254 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GVDDSET, buf, 2); in otm8009a_configure()
255 if (ret < 0) { in otm8009a_configure()
256 return ret; in otm8009a_configure()
260 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_SD_CTRL, sd_ctrl, sizeof(sd_ctrl)); in otm8009a_configure()
261 if (ret < 0) { in otm8009a_configure()
262 return ret; in otm8009a_configure()
268 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANSET, buf, 2); in otm8009a_configure()
269 if (ret < 0) { in otm8009a_configure()
270 return ret; in otm8009a_configure()
274 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GOAVST, goavst, sizeof(goavst)); in otm8009a_configure()
275 if (ret < 0) { in otm8009a_configure()
276 return ret; in otm8009a_configure()
280 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GOACLKA1, goaclka1, sizeof(goaclka1)); in otm8009a_configure()
281 if (ret < 0) { in otm8009a_configure()
282 return ret; in otm8009a_configure()
286 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GOACLKA2, goaclka2, sizeof(goaclka2)); in otm8009a_configure()
287 if (ret < 0) { in otm8009a_configure()
288 return ret; in otm8009a_configure()
292 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GOACLKA3, goaclka3, sizeof(goaclka3)); in otm8009a_configure()
293 if (ret < 0) { in otm8009a_configure()
294 return ret; in otm8009a_configure()
298 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GOACLKA4, goaclka4, sizeof(goaclka4)); in otm8009a_configure()
299 if (ret < 0) { in otm8009a_configure()
300 return ret; in otm8009a_configure()
304 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GOAECLK, goaeclk, sizeof(goaeclk)); in otm8009a_configure()
305 if (ret < 0) { in otm8009a_configure()
306 return ret; in otm8009a_configure()
311 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GOAPT1, buf, 1); in otm8009a_configure()
312 if (ret < 0) { in otm8009a_configure()
313 return ret; in otm8009a_configure()
320 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GOATGOPT, buf, 3); in otm8009a_configure()
321 if (ret < 0) { in otm8009a_configure()
322 return ret; in otm8009a_configure()
327 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_NO_DOC2, buf, 1); in otm8009a_configure()
328 if (ret < 0) { in otm8009a_configure()
329 return ret; in otm8009a_configure()
333 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANCTRLSET1, panctrlset1, sizeof(panctrlset1)); in otm8009a_configure()
334 if (ret < 0) { in otm8009a_configure()
335 return ret; in otm8009a_configure()
338 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANCTRLSET2, panctrlset2, sizeof(panctrlset2)); in otm8009a_configure()
339 if (ret < 0) { in otm8009a_configure()
340 return ret; in otm8009a_configure()
343 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANCTRLSET3, panctrlset3, sizeof(panctrlset3)); in otm8009a_configure()
344 if (ret < 0) { in otm8009a_configure()
345 return ret; in otm8009a_configure()
348 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANCTRLSET4, panctrlset4, sizeof(panctrlset4)); in otm8009a_configure()
349 if (ret < 0) { in otm8009a_configure()
350 return ret; in otm8009a_configure()
353 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANCTRLSET5, panctrlset5, sizeof(panctrlset5)); in otm8009a_configure()
354 if (ret < 0) { in otm8009a_configure()
355 return ret; in otm8009a_configure()
358 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANCTRLSET6, panctrlset6, sizeof(panctrlset6)); in otm8009a_configure()
359 if (ret < 0) { in otm8009a_configure()
360 return ret; in otm8009a_configure()
363 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANCTRLSET7, panctrlset7, sizeof(panctrlset7)); in otm8009a_configure()
364 if (ret < 0) { in otm8009a_configure()
365 return ret; in otm8009a_configure()
368 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANCTRLSET8, panctrlset8, sizeof(panctrlset8)); in otm8009a_configure()
369 if (ret < 0) { in otm8009a_configure()
370 return ret; in otm8009a_configure()
373 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANU2D1, panu2d1, sizeof(panu2d1)); in otm8009a_configure()
374 if (ret < 0) { in otm8009a_configure()
375 return ret; in otm8009a_configure()
378 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANU2D2, panu2d2, sizeof(panu2d2)); in otm8009a_configure()
379 if (ret < 0) { in otm8009a_configure()
380 return ret; in otm8009a_configure()
383 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PANU2D3, panu2d3, sizeof(panu2d3)); in otm8009a_configure()
384 if (ret < 0) { in otm8009a_configure()
385 return ret; in otm8009a_configure()
388 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PAND2U1, pand2u1, sizeof(pand2u1)); in otm8009a_configure()
389 if (ret < 0) { in otm8009a_configure()
390 return ret; in otm8009a_configure()
393 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PAND2U2, pand2u2, sizeof(pand2u2)); in otm8009a_configure()
394 if (ret < 0) { in otm8009a_configure()
395 return ret; in otm8009a_configure()
398 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PAND2U3, pand2u3, sizeof(pand2u3)); in otm8009a_configure()
399 if (ret < 0) { in otm8009a_configure()
400 return ret; in otm8009a_configure()
409 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PWR_CTRL1, buf, 4); in otm8009a_configure()
410 if (ret < 0) { in otm8009a_configure()
411 return ret; in otm8009a_configure()
416 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_NO_DOC3, buf, 1); in otm8009a_configure()
417 if (ret < 0) { in otm8009a_configure()
418 return ret; in otm8009a_configure()
424 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_PWM_PARA3, buf, 1); in otm8009a_configure()
425 if (ret < 0) { in otm8009a_configure()
426 return ret; in otm8009a_configure()
430 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GMCT2_2P, pgamma, sizeof(pgamma)); in otm8009a_configure()
431 if (ret < 0) { in otm8009a_configure()
432 return ret; in otm8009a_configure()
436 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_GMCT2_2N, ngamma, sizeof(ngamma)); in otm8009a_configure()
437 if (ret < 0) { in otm8009a_configure()
438 return ret; in otm8009a_configure()
445 ret = otm8009a_mcs_write(dev, OTM8009A_MCS_CMD2_ENA1, buf, 3); in otm8009a_configure()
446 if (ret < 0) { in otm8009a_configure()
447 return ret; in otm8009a_configure()
451 ret = otm8009a_dcs_write(dev, MIPI_DCS_EXIT_SLEEP_MODE, NULL, 0); in otm8009a_configure()
452 if (ret < 0) { in otm8009a_configure()
453 return ret; in otm8009a_configure()
471 ret = otm8009a_dcs_write(dev, MIPI_DCS_SET_PIXEL_FORMAT, buf, 1); in otm8009a_configure()
472 if (ret < 0) { in otm8009a_configure()
473 return ret; in otm8009a_configure()
487 ret = otm8009a_dcs_write(dev, MIPI_DCS_SET_ADDRESS_MODE, buf, 1); in otm8009a_configure()
488 if (ret < 0) { in otm8009a_configure()
489 return ret; in otm8009a_configure()
495 ret = otm8009a_dcs_write(dev, MIPI_DCS_SET_COLUMN_ADDRESS, buf, 4); in otm8009a_configure()
496 if (ret < 0) { in otm8009a_configure()
497 return ret; in otm8009a_configure()
503 ret = otm8009a_dcs_write(dev, MIPI_DCS_SET_PAGE_ADDRESS, buf, 4); in otm8009a_configure()
504 if (ret < 0) { in otm8009a_configure()
505 return ret; in otm8009a_configure()
510 ret = otm8009a_dcs_write(dev, MIPI_DCS_WRITE_CONTROL_DISPLAY, buf, 1); in otm8009a_configure()
511 if (ret < 0) { in otm8009a_configure()
512 return ret; in otm8009a_configure()
517 ret = otm8009a_dcs_write(dev, MIPI_DCS_WRITE_POWER_SAVE, buf, 1); in otm8009a_configure()
518 if (ret < 0) { in otm8009a_configure()
519 return ret; in otm8009a_configure()
524 ret = otm8009a_dcs_write(dev, MIPI_DCS_SET_CABC_MIN_BRIGHTNESS, buf, 1); in otm8009a_configure()
525 if (ret < 0) { in otm8009a_configure()
526 return ret; in otm8009a_configure()
531 ret = otm8009a_dcs_write(dev, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, buf, 1); in otm8009a_configure()
532 if (ret < 0) { in otm8009a_configure()
533 return ret; in otm8009a_configure()
537 ret = otm8009a_dcs_write(dev, MIPI_DCS_SET_DISPLAY_ON, NULL, 0); in otm8009a_configure()
538 if (ret < 0) { in otm8009a_configure()
539 return ret; in otm8009a_configure()
543 ret = otm8009a_dcs_write(dev, MIPI_DCS_WRITE_MEMORY_START, NULL, 0); in otm8009a_configure()
544 if (ret < 0) { in otm8009a_configure()
545 return ret; in otm8009a_configure()
554 int ret; in otm8009a_blanking_on() local
557 ret = gpio_pin_set_dt(&cfg->backlight, 0); in otm8009a_blanking_on()
558 if (ret) { in otm8009a_blanking_on()
559 LOG_ERR("Disable backlight failed! (%d)", ret); in otm8009a_blanking_on()
560 return ret; in otm8009a_blanking_on()
570 int ret; in otm8009a_blanking_off() local
573 ret = gpio_pin_set_dt(&cfg->backlight, 1); in otm8009a_blanking_off()
574 if (ret) { in otm8009a_blanking_off()
575 LOG_ERR("Enable backlight failed! (%d)", ret); in otm8009a_blanking_off()
576 return ret; in otm8009a_blanking_off()
621 int ret; in otm8009a_init() local
628 ret = gpio_pin_configure_dt(&cfg->reset, GPIO_OUTPUT_INACTIVE); in otm8009a_init()
629 if (ret < 0) { in otm8009a_init()
630 LOG_ERR("Reset display failed! (%d)", ret); in otm8009a_init()
631 return ret; in otm8009a_init()
634 ret = gpio_pin_set_dt(&cfg->reset, 1); in otm8009a_init()
635 if (ret < 0) { in otm8009a_init()
636 LOG_ERR("Enable display failed! (%d)", ret); in otm8009a_init()
637 return ret; in otm8009a_init()
675 ret = mipi_dsi_attach(cfg->mipi_dsi, cfg->channel, &mdev); in otm8009a_init()
676 if (ret < 0) { in otm8009a_init()
677 LOG_ERR("MIPI-DSI attach failed! (%d)", ret); in otm8009a_init()
678 return ret; in otm8009a_init()
681 ret = otm8009a_check_id(dev); in otm8009a_init()
682 if (ret) { in otm8009a_init()
683 LOG_ERR("Panel ID check failed! (%d)", ret); in otm8009a_init()
684 return ret; in otm8009a_init()
687 ret = otm8009a_configure(dev); in otm8009a_init()
688 if (ret) { in otm8009a_init()
689 LOG_ERR("DSI init sequence failed! (%d)", ret); in otm8009a_init()
690 return ret; in otm8009a_init()
693 ret = otm8009a_blanking_off(dev); in otm8009a_init()
694 if (ret) { in otm8009a_init()
695 LOG_ERR("Display blanking off failed! (%d)", ret); in otm8009a_init()
696 return ret; in otm8009a_init()