Lines Matching refs:jdi

48 static int jdi_panel_init(struct jdi_panel *jdi)  in jdi_panel_init()  argument
50 struct mipi_dsi_device *dsi = jdi->dsi; in jdi_panel_init()
51 struct device *dev = &jdi->dsi->dev; in jdi_panel_init()
68 ret = mipi_dsi_dcs_set_column_address(dsi, 0, jdi->mode->hdisplay - 1); in jdi_panel_init()
74 ret = mipi_dsi_dcs_set_page_address(dsi, 0, jdi->mode->vdisplay - 1); in jdi_panel_init()
138 static int jdi_panel_on(struct jdi_panel *jdi) in jdi_panel_on() argument
140 struct mipi_dsi_device *dsi = jdi->dsi; in jdi_panel_on()
141 struct device *dev = &jdi->dsi->dev; in jdi_panel_on()
153 static void jdi_panel_off(struct jdi_panel *jdi) in jdi_panel_off() argument
155 struct mipi_dsi_device *dsi = jdi->dsi; in jdi_panel_off()
156 struct device *dev = &jdi->dsi->dev; in jdi_panel_off()
174 struct jdi_panel *jdi = to_jdi_panel(panel); in jdi_panel_disable() local
176 backlight_disable(jdi->backlight); in jdi_panel_disable()
183 struct jdi_panel *jdi = to_jdi_panel(panel); in jdi_panel_unprepare() local
184 struct device *dev = &jdi->dsi->dev; in jdi_panel_unprepare()
187 jdi_panel_off(jdi); in jdi_panel_unprepare()
189 ret = regulator_bulk_disable(ARRAY_SIZE(jdi->supplies), jdi->supplies); in jdi_panel_unprepare()
193 gpiod_set_value(jdi->enable_gpio, 0); in jdi_panel_unprepare()
195 gpiod_set_value(jdi->reset_gpio, 1); in jdi_panel_unprepare()
197 gpiod_set_value(jdi->dcdc_en_gpio, 0); in jdi_panel_unprepare()
204 struct jdi_panel *jdi = to_jdi_panel(panel); in jdi_panel_prepare() local
205 struct device *dev = &jdi->dsi->dev; in jdi_panel_prepare()
208 ret = regulator_bulk_enable(ARRAY_SIZE(jdi->supplies), jdi->supplies); in jdi_panel_prepare()
216 gpiod_set_value(jdi->dcdc_en_gpio, 1); in jdi_panel_prepare()
219 gpiod_set_value(jdi->reset_gpio, 0); in jdi_panel_prepare()
222 gpiod_set_value(jdi->enable_gpio, 1); in jdi_panel_prepare()
225 ret = jdi_panel_init(jdi); in jdi_panel_prepare()
231 ret = jdi_panel_on(jdi); in jdi_panel_prepare()
240 ret = regulator_bulk_disable(ARRAY_SIZE(jdi->supplies), jdi->supplies); in jdi_panel_prepare()
244 gpiod_set_value(jdi->enable_gpio, 0); in jdi_panel_prepare()
246 gpiod_set_value(jdi->reset_gpio, 1); in jdi_panel_prepare()
248 gpiod_set_value(jdi->dcdc_en_gpio, 0); in jdi_panel_prepare()
255 struct jdi_panel *jdi = to_jdi_panel(panel); in jdi_panel_enable() local
257 backlight_enable(jdi->backlight); in jdi_panel_enable()
279 struct jdi_panel *jdi = to_jdi_panel(panel); in jdi_panel_get_modes() local
280 struct device *dev = &jdi->dsi->dev; in jdi_panel_get_modes()
367 static int jdi_panel_add(struct jdi_panel *jdi) in jdi_panel_add() argument
369 struct device *dev = &jdi->dsi->dev; in jdi_panel_add()
373 jdi->mode = &default_mode; in jdi_panel_add()
375 for (i = 0; i < ARRAY_SIZE(jdi->supplies); i++) in jdi_panel_add()
376 jdi->supplies[i].supply = regulator_names[i]; in jdi_panel_add()
378 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(jdi->supplies), in jdi_panel_add()
379 jdi->supplies); in jdi_panel_add()
384 jdi->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); in jdi_panel_add()
385 if (IS_ERR(jdi->enable_gpio)) { in jdi_panel_add()
386 return dev_err_probe(dev, PTR_ERR(jdi->enable_gpio), in jdi_panel_add()
390 jdi->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in jdi_panel_add()
391 if (IS_ERR(jdi->reset_gpio)) in jdi_panel_add()
392 return dev_err_probe(dev, PTR_ERR(jdi->reset_gpio), in jdi_panel_add()
395 jdi->dcdc_en_gpio = devm_gpiod_get(dev, "dcdc-en", GPIOD_OUT_LOW); in jdi_panel_add()
396 if (IS_ERR(jdi->dcdc_en_gpio)) in jdi_panel_add()
397 return dev_err_probe(dev, PTR_ERR(jdi->dcdc_en_gpio), in jdi_panel_add()
400 jdi->backlight = drm_panel_create_dsi_backlight(jdi->dsi); in jdi_panel_add()
401 if (IS_ERR(jdi->backlight)) in jdi_panel_add()
402 return dev_err_probe(dev, PTR_ERR(jdi->backlight), in jdi_panel_add()
405 drm_panel_init(&jdi->base, &jdi->dsi->dev, &jdi_panel_funcs, in jdi_panel_add()
408 drm_panel_add(&jdi->base); in jdi_panel_add()
413 static void jdi_panel_del(struct jdi_panel *jdi) in jdi_panel_del() argument
415 if (jdi->base.dev) in jdi_panel_del()
416 drm_panel_remove(&jdi->base); in jdi_panel_del()
421 struct jdi_panel *jdi; in jdi_panel_probe() local
429 jdi = devm_kzalloc(&dsi->dev, sizeof(*jdi), GFP_KERNEL); in jdi_panel_probe()
430 if (!jdi) in jdi_panel_probe()
433 mipi_dsi_set_drvdata(dsi, jdi); in jdi_panel_probe()
435 jdi->dsi = dsi; in jdi_panel_probe()
437 ret = jdi_panel_add(jdi); in jdi_panel_probe()
443 jdi_panel_del(jdi); in jdi_panel_probe()
452 struct jdi_panel *jdi = mipi_dsi_get_drvdata(dsi); in jdi_panel_remove() local
460 jdi_panel_del(jdi); in jdi_panel_remove()