Lines Matching +full:vcc +full:- +full:dsi +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0-only
3 * BOE BF060Y8M-AJ0 5.99" MIPI-DSI OLED Panel on SW43404 DriverIC
34 struct mipi_dsi_device *dsi; member
48 gpiod_set_value_cansleep(boe->reset_gpio, 0); in boe_bf060y8m_aj0_reset()
50 gpiod_set_value_cansleep(boe->reset_gpio, 1); in boe_bf060y8m_aj0_reset()
52 gpiod_set_value_cansleep(boe->reset_gpio, 0); in boe_bf060y8m_aj0_reset()
58 struct mipi_dsi_device *dsi = boe->dsi; in boe_bf060y8m_aj0_on() local
59 struct device *dev = &dsi->dev; in boe_bf060y8m_aj0_on()
62 mipi_dsi_dcs_write_seq(dsi, 0xb0, 0xa5, 0x00); in boe_bf060y8m_aj0_on()
63 mipi_dsi_dcs_write_seq(dsi, 0xb2, 0x00, 0x4c); in boe_bf060y8m_aj0_on()
64 mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_3D_CONTROL, 0x10); in boe_bf060y8m_aj0_on()
65 mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, DCS_ALLOW_HBM_RANGE); in boe_bf060y8m_aj0_on()
66 mipi_dsi_dcs_write_seq(dsi, 0xf8, in boe_bf060y8m_aj0_on()
69 ret = mipi_dsi_dcs_exit_sleep_mode(dsi); in boe_bf060y8m_aj0_on()
76 mipi_dsi_dcs_write_seq(dsi, 0xb0, 0xa5, 0x00); in boe_bf060y8m_aj0_on()
77 mipi_dsi_dcs_write_seq(dsi, 0xc0, in boe_bf060y8m_aj0_on()
80 mipi_dsi_dcs_write_seq(dsi, 0xc1, 0x00, 0x00, 0x00, 0x1f, 0x1f, in boe_bf060y8m_aj0_on()
83 mipi_dsi_dcs_write_seq(dsi, 0xe2, 0x20, 0x04, 0x10, 0x12, 0x92, in boe_bf060y8m_aj0_on()
86 mipi_dsi_dcs_write_seq(dsi, 0xde, 0x01, 0x2c, 0x00, 0x77, 0x3e); in boe_bf060y8m_aj0_on()
90 ret = mipi_dsi_dcs_set_display_on(dsi); in boe_bf060y8m_aj0_on()
102 struct mipi_dsi_device *dsi = boe->dsi; in boe_bf060y8m_aj0_off() local
103 struct device *dev = &dsi->dev; in boe_bf060y8m_aj0_off()
107 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in boe_bf060y8m_aj0_off()
108 ret = mipi_dsi_dcs_set_display_off(dsi); in boe_bf060y8m_aj0_off()
115 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); in boe_bf060y8m_aj0_off()
121 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in boe_bf060y8m_aj0_off()
129 struct device *dev = &boe->dsi->dev; in boe_bf060y8m_aj0_prepare()
132 if (boe->prepared) in boe_bf060y8m_aj0_prepare()
136 * Enable EL Driving Voltage first - doing that at the beginning in boe_bf060y8m_aj0_prepare()
140 ret = regulator_enable(boe->vregs[BF060Y8M_VREG_EL_VDD].consumer); in boe_bf060y8m_aj0_prepare()
143 ret = regulator_enable(boe->vregs[BF060Y8M_VREG_EL_VSS].consumer); in boe_bf060y8m_aj0_prepare()
147 ret = regulator_enable(boe->vregs[BF060Y8M_VREG_VCC].consumer); in boe_bf060y8m_aj0_prepare()
151 ret = regulator_enable(boe->vregs[BF060Y8M_VREG_VDDIO].consumer); in boe_bf060y8m_aj0_prepare()
155 ret = regulator_enable(boe->vregs[BF060Y8M_VREG_VCI].consumer); in boe_bf060y8m_aj0_prepare()
165 gpiod_set_value_cansleep(boe->reset_gpio, 1); in boe_bf060y8m_aj0_prepare()
169 boe->prepared = true; in boe_bf060y8m_aj0_prepare()
173 regulator_disable(boe->vregs[BF060Y8M_VREG_VDDIO].consumer); in boe_bf060y8m_aj0_prepare()
175 regulator_disable(boe->vregs[BF060Y8M_VREG_VCC].consumer); in boe_bf060y8m_aj0_prepare()
177 regulator_disable(boe->vregs[BF060Y8M_VREG_EL_VSS].consumer); in boe_bf060y8m_aj0_prepare()
179 regulator_disable(boe->vregs[BF060Y8M_VREG_EL_VDD].consumer); in boe_bf060y8m_aj0_prepare()
186 struct device *dev = &boe->dsi->dev; in boe_bf060y8m_aj0_unprepare()
189 if (!boe->prepared) in boe_bf060y8m_aj0_unprepare()
194 dev_err(dev, "Failed to un-initialize panel: %d\n", ret); in boe_bf060y8m_aj0_unprepare()
196 gpiod_set_value_cansleep(boe->reset_gpio, 1); in boe_bf060y8m_aj0_unprepare()
197 ret = regulator_bulk_disable(ARRAY_SIZE(boe->vregs), boe->vregs); in boe_bf060y8m_aj0_unprepare()
199 boe->prepared = false; in boe_bf060y8m_aj0_unprepare()
222 mode = drm_mode_duplicate(connector->dev, &boe_bf060y8m_aj0_mode); in boe_bf060y8m_aj0_get_modes()
224 return -ENOMEM; in boe_bf060y8m_aj0_get_modes()
228 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in boe_bf060y8m_aj0_get_modes()
229 connector->display_info.width_mm = mode->width_mm; in boe_bf060y8m_aj0_get_modes()
230 connector->display_info.height_mm = mode->height_mm; in boe_bf060y8m_aj0_get_modes()
244 struct mipi_dsi_device *dsi = bl_get_data(bl); in boe_bf060y8m_aj0_bl_update_status() local
248 ret = mipi_dsi_dcs_set_display_brightness(dsi, brightness); in boe_bf060y8m_aj0_bl_update_status()
257 struct mipi_dsi_device *dsi = bl_get_data(bl); in boe_bf060y8m_aj0_bl_get_brightness() local
261 ret = mipi_dsi_dcs_get_display_brightness(dsi, &brightness); in boe_bf060y8m_aj0_bl_get_brightness()
274 boe_bf060y8m_aj0_create_backlight(struct mipi_dsi_device *dsi) in boe_bf060y8m_aj0_create_backlight() argument
276 struct device *dev = &dsi->dev; in boe_bf060y8m_aj0_create_backlight()
284 return devm_backlight_device_register(dev, dev_name(dev), dev, dsi, in boe_bf060y8m_aj0_create_backlight()
294 boe->vregs[BF060Y8M_VREG_VCC].supply = "vcc"; in boe_bf060y8m_aj0_init_vregs()
295 boe->vregs[BF060Y8M_VREG_VDDIO].supply = "vddio"; in boe_bf060y8m_aj0_init_vregs()
296 boe->vregs[BF060Y8M_VREG_VCI].supply = "vci"; in boe_bf060y8m_aj0_init_vregs()
297 boe->vregs[BF060Y8M_VREG_EL_VDD].supply = "elvdd"; in boe_bf060y8m_aj0_init_vregs()
298 boe->vregs[BF060Y8M_VREG_EL_VSS].supply = "elvss"; in boe_bf060y8m_aj0_init_vregs()
299 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(boe->vregs), in boe_bf060y8m_aj0_init_vregs()
300 boe->vregs); in boe_bf060y8m_aj0_init_vregs()
306 vreg = boe->vregs[BF060Y8M_VREG_VCC].consumer; in boe_bf060y8m_aj0_init_vregs()
311 vreg = boe->vregs[BF060Y8M_VREG_VDDIO].consumer; in boe_bf060y8m_aj0_init_vregs()
316 vreg = boe->vregs[BF060Y8M_VREG_VCI].consumer; in boe_bf060y8m_aj0_init_vregs()
321 vreg = boe->vregs[BF060Y8M_VREG_EL_VDD].consumer; in boe_bf060y8m_aj0_init_vregs()
326 /* ELVSS is negative: -5.00V to -1.40V */ in boe_bf060y8m_aj0_init_vregs()
327 vreg = boe->vregs[BF060Y8M_VREG_EL_VSS].consumer; in boe_bf060y8m_aj0_init_vregs()
338 * be fixed-regulator which, at the time of writing, does not in boe_bf060y8m_aj0_init_vregs()
341 vreg = boe->vregs[BF060Y8M_VREG_VDDIO].consumer; in boe_bf060y8m_aj0_init_vregs()
345 boe->vregs[1].supply, ret); in boe_bf060y8m_aj0_init_vregs()
347 vreg = boe->vregs[BF060Y8M_VREG_VCI].consumer; in boe_bf060y8m_aj0_init_vregs()
351 boe->vregs[2].supply, ret); in boe_bf060y8m_aj0_init_vregs()
356 static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi) in boe_bf060y8m_aj0_probe() argument
358 struct device *dev = &dsi->dev; in boe_bf060y8m_aj0_probe()
364 return -ENOMEM; in boe_bf060y8m_aj0_probe()
371 boe->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS); in boe_bf060y8m_aj0_probe()
372 if (IS_ERR(boe->reset_gpio)) in boe_bf060y8m_aj0_probe()
373 return dev_err_probe(dev, PTR_ERR(boe->reset_gpio), in boe_bf060y8m_aj0_probe()
374 "Failed to get reset-gpios\n"); in boe_bf060y8m_aj0_probe()
376 boe->dsi = dsi; in boe_bf060y8m_aj0_probe()
377 mipi_dsi_set_drvdata(dsi, boe); in boe_bf060y8m_aj0_probe()
379 dsi->lanes = 4; in boe_bf060y8m_aj0_probe()
380 dsi->format = MIPI_DSI_FMT_RGB888; in boe_bf060y8m_aj0_probe()
381 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_NO_EOT_PACKET | in boe_bf060y8m_aj0_probe()
386 drm_panel_init(&boe->panel, dev, &boe_bf060y8m_aj0_panel_funcs, in boe_bf060y8m_aj0_probe()
389 boe->panel.backlight = boe_bf060y8m_aj0_create_backlight(dsi); in boe_bf060y8m_aj0_probe()
390 if (IS_ERR(boe->panel.backlight)) in boe_bf060y8m_aj0_probe()
391 return dev_err_probe(dev, PTR_ERR(boe->panel.backlight), in boe_bf060y8m_aj0_probe()
394 drm_panel_add(&boe->panel); in boe_bf060y8m_aj0_probe()
396 ret = mipi_dsi_attach(dsi); in boe_bf060y8m_aj0_probe()
398 dev_err(dev, "Failed to attach to DSI host: %d\n", ret); in boe_bf060y8m_aj0_probe()
405 static void boe_bf060y8m_aj0_remove(struct mipi_dsi_device *dsi) in boe_bf060y8m_aj0_remove() argument
407 struct boe_bf060y8m_aj0 *boe = mipi_dsi_get_drvdata(dsi); in boe_bf060y8m_aj0_remove()
410 ret = mipi_dsi_detach(dsi); in boe_bf060y8m_aj0_remove()
412 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in boe_bf060y8m_aj0_remove()
414 drm_panel_remove(&boe->panel); in boe_bf060y8m_aj0_remove()
418 { .compatible = "boe,bf060y8m-aj0" },
427 .name = "panel-sw43404-boe-fhd-amoled",
434 MODULE_DESCRIPTION("BOE BF060Y8M-AJ0 MIPI-DSI OLED panel");