Lines Matching +full:power +full:- +full:supplies
1 // SPDX-License-Identifier: GPL-2.0
8 * - Vinay Simha BN <simhavcs@gmail.com>
9 * - Sumit Semwal <sumit.semwal@linaro.org>
10 * - Guillaume La Roque <glaroque@baylibre.com>
34 POWER = 1 enumerator
42 struct gpio_desc *enable_gpio; /* Power IC supply enable */
45 struct regulator_bulk_data supplies[2]; member
55 struct mipi_dsi_device *dsi = stk->dsi; in stk_panel_init()
56 struct device *dev = &stk->dsi->dev; in stk_panel_init()
95 ret = mipi_dsi_dcs_set_column_address(dsi, 0, stk->mode->hdisplay - 1); in stk_panel_init()
101 ret = mipi_dsi_dcs_set_page_address(dsi, 0, stk->mode->vdisplay - 1); in stk_panel_init()
112 struct mipi_dsi_device *dsi = stk->dsi; in stk_panel_on()
113 struct device *dev = &stk->dsi->dev; in stk_panel_on()
127 struct mipi_dsi_device *dsi = stk->dsi; in stk_panel_off()
128 struct device *dev = &stk->dsi->dev; in stk_panel_off()
131 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in stk_panel_off()
148 if (!stk->prepared) in stk_panel_unprepare()
152 regulator_bulk_disable(ARRAY_SIZE(stk->supplies), stk->supplies); in stk_panel_unprepare()
153 gpiod_set_value(stk->reset_gpio, 0); in stk_panel_unprepare()
154 gpiod_set_value(stk->enable_gpio, 1); in stk_panel_unprepare()
156 stk->prepared = false; in stk_panel_unprepare()
164 struct device *dev = &stk->dsi->dev; in stk_panel_prepare()
167 if (stk->prepared) in stk_panel_prepare()
170 gpiod_set_value(stk->reset_gpio, 0); in stk_panel_prepare()
171 gpiod_set_value(stk->enable_gpio, 0); in stk_panel_prepare()
172 ret = regulator_enable(stk->supplies[IOVCC].consumer); in stk_panel_prepare()
177 ret = regulator_enable(stk->supplies[POWER].consumer); in stk_panel_prepare()
182 gpiod_set_value(stk->enable_gpio, 1); in stk_panel_prepare()
184 gpiod_set_value(stk->reset_gpio, 1); in stk_panel_prepare()
198 stk->prepared = true; in stk_panel_prepare()
203 regulator_disable(stk->supplies[POWER].consumer); in stk_panel_prepare()
205 regulator_disable(stk->supplies[IOVCC].consumer); in stk_panel_prepare()
206 gpiod_set_value(stk->reset_gpio, 0); in stk_panel_prepare()
207 gpiod_set_value(stk->enable_gpio, 0); in stk_panel_prepare()
231 mode = drm_mode_duplicate(connector->dev, &default_mode); in stk_panel_get_modes()
233 dev_err(panel->dev, "failed to add mode %ux%ux@%u\n", in stk_panel_get_modes()
236 return -ENOMEM; in stk_panel_get_modes()
241 connector->display_info.width_mm = default_mode.width_mm; in stk_panel_get_modes()
242 connector->display_info.height_mm = default_mode.height_mm; in stk_panel_get_modes()
252 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in dsi_dcs_bl_get_brightness()
257 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in dsi_dcs_bl_get_brightness()
264 struct device *dev = &dsi->dev; in dsi_dcs_bl_update_status()
267 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in dsi_dcs_bl_update_status()
268 ret = mipi_dsi_dcs_set_display_brightness(dsi, bl->props.brightness); in dsi_dcs_bl_update_status()
274 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in dsi_dcs_bl_update_status()
286 struct device *dev = &dsi->dev; in drm_panel_create_dsi_backlight()
311 struct device *dev = &stk->dsi->dev; in stk_panel_add()
314 stk->mode = &default_mode; in stk_panel_add()
316 stk->supplies[IOVCC].supply = "iovcc"; in stk_panel_add()
317 stk->supplies[POWER].supply = "power"; in stk_panel_add()
318 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(stk->supplies), stk->supplies); in stk_panel_add()
324 stk->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in stk_panel_add()
325 if (IS_ERR(stk->reset_gpio)) { in stk_panel_add()
326 ret = PTR_ERR(stk->reset_gpio); in stk_panel_add()
327 dev_err(dev, "cannot get reset-gpios %d\n", ret); in stk_panel_add()
331 stk->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); in stk_panel_add()
332 if (IS_ERR(stk->enable_gpio)) { in stk_panel_add()
333 ret = PTR_ERR(stk->enable_gpio); in stk_panel_add()
334 dev_err(dev, "cannot get enable-gpio %d\n", ret); in stk_panel_add()
338 stk->backlight = drm_panel_create_dsi_backlight(stk->dsi); in stk_panel_add()
339 if (IS_ERR(stk->backlight)) { in stk_panel_add()
340 ret = PTR_ERR(stk->backlight); in stk_panel_add()
345 drm_panel_init(&stk->base, &stk->dsi->dev, &stk_panel_funcs, in stk_panel_add()
348 drm_panel_add(&stk->base); in stk_panel_add()
358 dsi->lanes = 4; in stk_panel_probe()
359 dsi->format = MIPI_DSI_FMT_RGB888; in stk_panel_probe()
360 dsi->mode_flags = (MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM); in stk_panel_probe()
362 stk = devm_kzalloc(&dsi->dev, sizeof(*stk), GFP_KERNEL); in stk_panel_probe()
364 return -ENOMEM; in stk_panel_probe()
368 stk->dsi = dsi; in stk_panel_probe()
376 drm_panel_remove(&stk->base); in stk_panel_probe()
388 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", in stk_panel_remove()
391 drm_panel_remove(&stk->base); in stk_panel_remove()
396 .name = "panel-startek-kd070fhfid015",