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
46 #define dsi_dcs_write_seq(dsi, seq...) do { \ argument
49 ret = mipi_dsi_dcs_write_buffer(dsi, d, ARRAY_SIZE(d)); \
56 gpiod_set_value_cansleep(boe->reset_gpio, 0); in boe_bf060y8m_aj0_reset()
58 gpiod_set_value_cansleep(boe->reset_gpio, 1); in boe_bf060y8m_aj0_reset()
60 gpiod_set_value_cansleep(boe->reset_gpio, 0); in boe_bf060y8m_aj0_reset()
66 struct mipi_dsi_device *dsi = boe->dsi; in boe_bf060y8m_aj0_on() local
67 struct device *dev = &dsi->dev; in boe_bf060y8m_aj0_on()
70 dsi_dcs_write_seq(dsi, 0xb0, 0xa5, 0x00); in boe_bf060y8m_aj0_on()
71 dsi_dcs_write_seq(dsi, 0xb2, 0x00, 0x4c); in boe_bf060y8m_aj0_on()
72 dsi_dcs_write_seq(dsi, MIPI_DCS_SET_3D_CONTROL, 0x10); in boe_bf060y8m_aj0_on()
73 dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, DCS_ALLOW_HBM_RANGE); in boe_bf060y8m_aj0_on()
74 dsi_dcs_write_seq(dsi, 0xf8, in boe_bf060y8m_aj0_on()
77 ret = mipi_dsi_dcs_exit_sleep_mode(dsi); in boe_bf060y8m_aj0_on()
84 dsi_dcs_write_seq(dsi, 0xb0, 0xa5, 0x00); in boe_bf060y8m_aj0_on()
85 dsi_dcs_write_seq(dsi, 0xc0, in boe_bf060y8m_aj0_on()
88 dsi_dcs_write_seq(dsi, 0xc1, 0x00, 0x00, 0x00, 0x1f, 0x1f, in boe_bf060y8m_aj0_on()
91 dsi_dcs_write_seq(dsi, 0xe2, 0x20, 0x04, 0x10, 0x12, 0x92, in boe_bf060y8m_aj0_on()
94 dsi_dcs_write_seq(dsi, 0xde, 0x01, 0x2c, 0x00, 0x77, 0x3e); in boe_bf060y8m_aj0_on()
98 ret = mipi_dsi_dcs_set_display_on(dsi); in boe_bf060y8m_aj0_on()
110 struct mipi_dsi_device *dsi = boe->dsi; in boe_bf060y8m_aj0_off() local
111 struct device *dev = &dsi->dev; in boe_bf060y8m_aj0_off()
115 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in boe_bf060y8m_aj0_off()
116 ret = mipi_dsi_dcs_set_display_off(dsi); in boe_bf060y8m_aj0_off()
123 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); in boe_bf060y8m_aj0_off()
129 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in boe_bf060y8m_aj0_off()
137 struct device *dev = &boe->dsi->dev; in boe_bf060y8m_aj0_prepare()
140 if (boe->prepared) in boe_bf060y8m_aj0_prepare()
144 * Enable EL Driving Voltage first - doing that at the beginning in boe_bf060y8m_aj0_prepare()
148 ret = regulator_enable(boe->vregs[BF060Y8M_VREG_EL_VDD].consumer); in boe_bf060y8m_aj0_prepare()
151 ret = regulator_enable(boe->vregs[BF060Y8M_VREG_EL_VSS].consumer); in boe_bf060y8m_aj0_prepare()
155 ret = regulator_enable(boe->vregs[BF060Y8M_VREG_VCC].consumer); in boe_bf060y8m_aj0_prepare()
159 ret = regulator_enable(boe->vregs[BF060Y8M_VREG_VDDIO].consumer); in boe_bf060y8m_aj0_prepare()
163 ret = regulator_enable(boe->vregs[BF060Y8M_VREG_VCI].consumer); in boe_bf060y8m_aj0_prepare()
173 gpiod_set_value_cansleep(boe->reset_gpio, 1); in boe_bf060y8m_aj0_prepare()
177 boe->prepared = true; in boe_bf060y8m_aj0_prepare()
181 regulator_disable(boe->vregs[BF060Y8M_VREG_VDDIO].consumer); in boe_bf060y8m_aj0_prepare()
183 regulator_disable(boe->vregs[BF060Y8M_VREG_VCC].consumer); in boe_bf060y8m_aj0_prepare()
185 regulator_disable(boe->vregs[BF060Y8M_VREG_EL_VSS].consumer); in boe_bf060y8m_aj0_prepare()
187 regulator_disable(boe->vregs[BF060Y8M_VREG_EL_VDD].consumer); in boe_bf060y8m_aj0_prepare()
194 struct device *dev = &boe->dsi->dev; in boe_bf060y8m_aj0_unprepare()
197 if (!boe->prepared) in boe_bf060y8m_aj0_unprepare()
202 dev_err(dev, "Failed to un-initialize panel: %d\n", ret); in boe_bf060y8m_aj0_unprepare()
204 gpiod_set_value_cansleep(boe->reset_gpio, 1); in boe_bf060y8m_aj0_unprepare()
205 ret = regulator_bulk_disable(ARRAY_SIZE(boe->vregs), boe->vregs); in boe_bf060y8m_aj0_unprepare()
207 boe->prepared = false; in boe_bf060y8m_aj0_unprepare()
230 mode = drm_mode_duplicate(connector->dev, &boe_bf060y8m_aj0_mode); in boe_bf060y8m_aj0_get_modes()
232 return -ENOMEM; in boe_bf060y8m_aj0_get_modes()
236 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in boe_bf060y8m_aj0_get_modes()
237 connector->display_info.width_mm = mode->width_mm; in boe_bf060y8m_aj0_get_modes()
238 connector->display_info.height_mm = mode->height_mm; in boe_bf060y8m_aj0_get_modes()
252 struct mipi_dsi_device *dsi = bl_get_data(bl); in boe_bf060y8m_aj0_bl_update_status() local
256 ret = mipi_dsi_dcs_set_display_brightness(dsi, brightness); in boe_bf060y8m_aj0_bl_update_status()
265 struct mipi_dsi_device *dsi = bl_get_data(bl); in boe_bf060y8m_aj0_bl_get_brightness() local
269 ret = mipi_dsi_dcs_get_display_brightness(dsi, &brightness); in boe_bf060y8m_aj0_bl_get_brightness()
282 boe_bf060y8m_aj0_create_backlight(struct mipi_dsi_device *dsi) in boe_bf060y8m_aj0_create_backlight() argument
284 struct device *dev = &dsi->dev; in boe_bf060y8m_aj0_create_backlight()
292 return devm_backlight_device_register(dev, dev_name(dev), dev, dsi, in boe_bf060y8m_aj0_create_backlight()
302 boe->vregs[BF060Y8M_VREG_VCC].supply = "vcc"; in boe_bf060y8m_aj0_init_vregs()
303 boe->vregs[BF060Y8M_VREG_VDDIO].supply = "vddio"; in boe_bf060y8m_aj0_init_vregs()
304 boe->vregs[BF060Y8M_VREG_VCI].supply = "vci"; in boe_bf060y8m_aj0_init_vregs()
305 boe->vregs[BF060Y8M_VREG_EL_VDD].supply = "elvdd"; in boe_bf060y8m_aj0_init_vregs()
306 boe->vregs[BF060Y8M_VREG_EL_VSS].supply = "elvss"; in boe_bf060y8m_aj0_init_vregs()
307 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(boe->vregs), in boe_bf060y8m_aj0_init_vregs()
308 boe->vregs); in boe_bf060y8m_aj0_init_vregs()
314 vreg = boe->vregs[BF060Y8M_VREG_VCC].consumer; in boe_bf060y8m_aj0_init_vregs()
319 vreg = boe->vregs[BF060Y8M_VREG_VDDIO].consumer; in boe_bf060y8m_aj0_init_vregs()
324 vreg = boe->vregs[BF060Y8M_VREG_VCI].consumer; in boe_bf060y8m_aj0_init_vregs()
329 vreg = boe->vregs[BF060Y8M_VREG_EL_VDD].consumer; in boe_bf060y8m_aj0_init_vregs()
334 /* ELVSS is negative: -5.00V to -1.40V */ in boe_bf060y8m_aj0_init_vregs()
335 vreg = boe->vregs[BF060Y8M_VREG_EL_VSS].consumer; in boe_bf060y8m_aj0_init_vregs()
346 * be fixed-regulator which, at the time of writing, does not in boe_bf060y8m_aj0_init_vregs()
349 vreg = boe->vregs[BF060Y8M_VREG_VDDIO].consumer; in boe_bf060y8m_aj0_init_vregs()
353 boe->vregs[1].supply, ret); in boe_bf060y8m_aj0_init_vregs()
355 vreg = boe->vregs[BF060Y8M_VREG_VCI].consumer; in boe_bf060y8m_aj0_init_vregs()
359 boe->vregs[2].supply, ret); in boe_bf060y8m_aj0_init_vregs()
364 static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi) in boe_bf060y8m_aj0_probe() argument
366 struct device *dev = &dsi->dev; in boe_bf060y8m_aj0_probe()
372 return -ENOMEM; in boe_bf060y8m_aj0_probe()
379 boe->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS); in boe_bf060y8m_aj0_probe()
380 if (IS_ERR(boe->reset_gpio)) in boe_bf060y8m_aj0_probe()
381 return dev_err_probe(dev, PTR_ERR(boe->reset_gpio), in boe_bf060y8m_aj0_probe()
382 "Failed to get reset-gpios\n"); in boe_bf060y8m_aj0_probe()
384 boe->dsi = dsi; in boe_bf060y8m_aj0_probe()
385 mipi_dsi_set_drvdata(dsi, boe); in boe_bf060y8m_aj0_probe()
387 dsi->lanes = 4; in boe_bf060y8m_aj0_probe()
388 dsi->format = MIPI_DSI_FMT_RGB888; in boe_bf060y8m_aj0_probe()
389 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_NO_EOT_PACKET | in boe_bf060y8m_aj0_probe()
394 drm_panel_init(&boe->panel, dev, &boe_bf060y8m_aj0_panel_funcs, in boe_bf060y8m_aj0_probe()
397 boe->panel.backlight = boe_bf060y8m_aj0_create_backlight(dsi); in boe_bf060y8m_aj0_probe()
398 if (IS_ERR(boe->panel.backlight)) in boe_bf060y8m_aj0_probe()
399 return dev_err_probe(dev, PTR_ERR(boe->panel.backlight), in boe_bf060y8m_aj0_probe()
402 drm_panel_add(&boe->panel); in boe_bf060y8m_aj0_probe()
404 ret = mipi_dsi_attach(dsi); in boe_bf060y8m_aj0_probe()
406 dev_err(dev, "Failed to attach to DSI host: %d\n", ret); in boe_bf060y8m_aj0_probe()
413 static void boe_bf060y8m_aj0_remove(struct mipi_dsi_device *dsi) in boe_bf060y8m_aj0_remove() argument
415 struct boe_bf060y8m_aj0 *boe = mipi_dsi_get_drvdata(dsi); in boe_bf060y8m_aj0_remove()
418 ret = mipi_dsi_detach(dsi); in boe_bf060y8m_aj0_remove()
420 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in boe_bf060y8m_aj0_remove()
422 drm_panel_remove(&boe->panel); in boe_bf060y8m_aj0_remove()
426 { .compatible = "boe,bf060y8m-aj0" },
435 .name = "panel-sw43404-boe-fhd-amoled",
442 MODULE_DESCRIPTION("BOE BF060Y8M-AJ0 MIPI-DSI OLED panel");