Lines Matching +full:vcc_flsh +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0+
19 #include <linux/media-bus-format.h>
65 struct regulator *vcc_flsh; member
111 struct device *dev = dlpc->dev; in dlpc_atomic_enable()
112 struct drm_display_mode *mode = &dlpc->mode; in dlpc_atomic_enable()
113 struct regmap *regmap = dlpc->regmap; in dlpc_atomic_enable()
136 buf[4] = mode->hdisplay & 0xff; in dlpc_atomic_enable()
137 buf[5] = (mode->hdisplay & 0xff00) >> 8; in dlpc_atomic_enable()
138 buf[6] = mode->vdisplay & 0xff; in dlpc_atomic_enable()
139 buf[7] = (mode->vdisplay & 0xff00) >> 8; in dlpc_atomic_enable()
143 buf[4] = mode->hdisplay & 0xff; in dlpc_atomic_enable()
144 buf[5] = (mode->hdisplay & 0xff00) >> 8; in dlpc_atomic_enable()
145 buf[6] = mode->vdisplay & 0xff; in dlpc_atomic_enable()
146 buf[7] = (mode->vdisplay & 0xff00) >> 8; in dlpc_atomic_enable()
150 buf[0] = mode->hdisplay & 0xff; in dlpc_atomic_enable()
151 buf[1] = (mode->hdisplay & 0xff00) >> 8; in dlpc_atomic_enable()
152 buf[2] = mode->vdisplay & 0xff; in dlpc_atomic_enable()
153 buf[3] = (mode->vdisplay & 0xff00) >> 8; in dlpc_atomic_enable()
178 gpiod_set_value(dlpc->enable_gpio, 1); in dlpc_atomic_pre_enable()
182 ret = regulator_enable(dlpc->vcc_intf); in dlpc_atomic_pre_enable()
184 DRM_DEV_ERROR(dlpc->dev, in dlpc_atomic_pre_enable()
187 ret = regulator_enable(dlpc->vcc_flsh); in dlpc_atomic_pre_enable()
189 DRM_DEV_ERROR(dlpc->dev, in dlpc_atomic_pre_enable()
190 "failed to enable VCC_FLSH regulator: %d\n", ret); in dlpc_atomic_pre_enable()
200 regulator_disable(dlpc->vcc_flsh); in dlpc_atomic_post_disable()
201 regulator_disable(dlpc->vcc_intf); in dlpc_atomic_post_disable()
205 gpiod_set_value(dlpc->enable_gpio, 0); in dlpc_atomic_post_disable()
229 /* This is the DSI-end bus format */ in dlpc_atomic_get_input_bus_fmts()
242 drm_mode_copy(&dlpc->mode, adjusted_mode); in dlpc_mode_set()
250 return drm_bridge_attach(bridge->encoder, dlpc->next_bridge, bridge, flags); in dlpc_attach()
267 struct device *dev = dlpc->dev; in dlpc3433_parse_dt()
271 dlpc->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); in dlpc3433_parse_dt()
272 if (IS_ERR(dlpc->enable_gpio)) in dlpc3433_parse_dt()
273 return PTR_ERR(dlpc->enable_gpio); in dlpc3433_parse_dt()
275 dlpc->vcc_intf = devm_regulator_get(dlpc->dev, "vcc_intf"); in dlpc3433_parse_dt()
276 if (IS_ERR(dlpc->vcc_intf)) in dlpc3433_parse_dt()
277 return dev_err_probe(dev, PTR_ERR(dlpc->vcc_intf), in dlpc3433_parse_dt()
278 "failed to get VCC_INTF supply\n"); in dlpc3433_parse_dt()
280 dlpc->vcc_flsh = devm_regulator_get(dlpc->dev, "vcc_flsh"); in dlpc3433_parse_dt()
281 if (IS_ERR(dlpc->vcc_flsh)) in dlpc3433_parse_dt()
282 return dev_err_probe(dev, PTR_ERR(dlpc->vcc_flsh), in dlpc3433_parse_dt()
283 "failed to get VCC_FLSH supply\n"); in dlpc3433_parse_dt()
285 dlpc->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); in dlpc3433_parse_dt()
286 if (IS_ERR(dlpc->next_bridge)) in dlpc3433_parse_dt()
287 return PTR_ERR(dlpc->next_bridge); in dlpc3433_parse_dt()
289 endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, 0); in dlpc3433_parse_dt()
290 dlpc->dsi_lanes = of_property_count_u32_elems(endpoint, "data-lanes"); in dlpc3433_parse_dt()
291 if (dlpc->dsi_lanes < 0 || dlpc->dsi_lanes > 4) { in dlpc3433_parse_dt()
292 ret = -EINVAL; in dlpc3433_parse_dt()
296 dlpc->host_node = of_graph_get_remote_port_parent(endpoint); in dlpc3433_parse_dt()
297 if (!dlpc->host_node) { in dlpc3433_parse_dt()
298 ret = -ENODEV; in dlpc3433_parse_dt()
307 of_node_put(dlpc->host_node); in dlpc3433_parse_dt()
315 struct device *dev = dlpc->dev; in dlpc_host_attach()
323 host = of_find_mipi_dsi_host_by_node(dlpc->host_node); in dlpc_host_attach()
326 return -EPROBE_DEFER; in dlpc_host_attach()
329 dlpc->dsi = mipi_dsi_device_register_full(host, &info); in dlpc_host_attach()
330 if (IS_ERR(dlpc->dsi)) { in dlpc_host_attach()
332 return PTR_ERR(dlpc->dsi); in dlpc_host_attach()
335 dlpc->dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST; in dlpc_host_attach()
336 dlpc->dsi->format = MIPI_DSI_FMT_RGB565; in dlpc_host_attach()
337 dlpc->dsi->lanes = dlpc->dsi_lanes; in dlpc_host_attach()
339 return devm_mipi_dsi_attach(dev, dlpc->dsi); in dlpc_host_attach()
344 struct device *dev = &client->dev; in dlpc3433_probe()
350 return -ENOMEM; in dlpc3433_probe()
352 dlpc->dev = dev; in dlpc3433_probe()
354 dlpc->regmap = devm_regmap_init_i2c(client, &dlpc_regmap_config); in dlpc3433_probe()
355 if (IS_ERR(dlpc->regmap)) in dlpc3433_probe()
356 return PTR_ERR(dlpc->regmap); in dlpc3433_probe()
365 dlpc->bridge.funcs = &dlpc_bridge_funcs; in dlpc3433_probe()
366 dlpc->bridge.of_node = dev->of_node; in dlpc3433_probe()
367 drm_bridge_add(&dlpc->bridge); in dlpc3433_probe()
378 drm_bridge_remove(&dlpc->bridge); in dlpc3433_probe()
386 drm_bridge_remove(&dlpc->bridge); in dlpc3433_remove()
387 of_node_put(dlpc->host_node); in dlpc3433_remove()
407 .name = "ti-dlpc3433",