Lines Matching refs:dvi

54 	struct tfp410 *dvi = drm_connector_to_tfp410(connector);  in tfp410_get_modes()  local
58 if (!dvi->ddc) in tfp410_get_modes()
61 edid = drm_get_edid(connector, dvi->ddc); in tfp410_get_modes()
92 struct tfp410 *dvi = drm_connector_to_tfp410(connector); in tfp410_connector_detect() local
94 if (dvi->hpd) { in tfp410_connector_detect()
95 if (gpiod_get_value_cansleep(dvi->hpd)) in tfp410_connector_detect()
101 if (dvi->ddc) { in tfp410_connector_detect()
102 if (drm_probe_ddc(dvi->ddc)) in tfp410_connector_detect()
122 struct tfp410 *dvi = drm_bridge_to_tfp410(bridge); in tfp410_attach() local
126 dev_err(dvi->dev, "Missing encoder\n"); in tfp410_attach()
130 if (dvi->hpd_irq >= 0) in tfp410_attach()
131 dvi->connector.polled = DRM_CONNECTOR_POLL_HPD; in tfp410_attach()
133 dvi->connector.polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; in tfp410_attach()
135 drm_connector_helper_add(&dvi->connector, in tfp410_attach()
137 ret = drm_connector_init_with_ddc(bridge->dev, &dvi->connector, in tfp410_attach()
139 dvi->connector_type, in tfp410_attach()
140 dvi->ddc); in tfp410_attach()
142 dev_err(dvi->dev, "drm_connector_init() failed: %d\n", ret); in tfp410_attach()
146 drm_display_info_set_bus_formats(&dvi->connector.display_info, in tfp410_attach()
147 &dvi->bus_format, 1); in tfp410_attach()
149 drm_connector_attach_encoder(&dvi->connector, in tfp410_attach()
157 struct tfp410 *dvi = drm_bridge_to_tfp410(bridge); in tfp410_enable() local
159 gpiod_set_value_cansleep(dvi->powerdown, 0); in tfp410_enable()
164 struct tfp410 *dvi = drm_bridge_to_tfp410(bridge); in tfp410_disable() local
166 gpiod_set_value_cansleep(dvi->powerdown, 1); in tfp410_disable()
177 struct tfp410 *dvi; in tfp410_hpd_work_func() local
179 dvi = container_of(work, struct tfp410, hpd_work.work); in tfp410_hpd_work_func()
181 if (dvi->bridge.dev) in tfp410_hpd_work_func()
182 drm_helper_hpd_irq_event(dvi->bridge.dev); in tfp410_hpd_work_func()
187 struct tfp410 *dvi = arg; in tfp410_hpd_irq_thread() local
189 mod_delayed_work(system_wq, &dvi->hpd_work, in tfp410_hpd_irq_thread()
202 static int tfp410_parse_timings(struct tfp410 *dvi, bool i2c) in tfp410_parse_timings() argument
204 struct drm_bridge_timings *timings = &dvi->timings; in tfp410_parse_timings()
226 ep = of_graph_get_endpoint_by_regs(dvi->dev->of_node, 0, 0); in tfp410_parse_timings()
252 dvi->bus_format = MEDIA_BUS_FMT_RGB888_2X12_LE; in tfp410_parse_timings()
255 dvi->bus_format = MEDIA_BUS_FMT_RGB888_1X24; in tfp410_parse_timings()
262 of_property_read_u32(dvi->dev->of_node, "ti,deskew", (u32 *)&deskew); in tfp410_parse_timings()
272 static int tfp410_get_connector_properties(struct tfp410 *dvi) in tfp410_get_connector_properties() argument
278 connector_node = of_graph_get_remote_node(dvi->dev->of_node, 1, -1); in tfp410_get_connector_properties()
283 dvi->connector_type = DRM_MODE_CONNECTOR_HDMIA; in tfp410_get_connector_properties()
285 dvi->connector_type = DRM_MODE_CONNECTOR_DVID; in tfp410_get_connector_properties()
287 dvi->hpd = fwnode_get_named_gpiod(&connector_node->fwnode, in tfp410_get_connector_properties()
289 if (IS_ERR(dvi->hpd)) { in tfp410_get_connector_properties()
290 ret = PTR_ERR(dvi->hpd); in tfp410_get_connector_properties()
291 dvi->hpd = NULL; in tfp410_get_connector_properties()
302 dvi->ddc = of_get_i2c_adapter_by_node(ddc_phandle); in tfp410_get_connector_properties()
303 if (dvi->ddc) in tfp410_get_connector_properties()
304 dev_info(dvi->dev, "Connector's ddc i2c bus found\n"); in tfp410_get_connector_properties()
317 struct tfp410 *dvi; in tfp410_init() local
325 dvi = devm_kzalloc(dev, sizeof(*dvi), GFP_KERNEL); in tfp410_init()
326 if (!dvi) in tfp410_init()
328 dev_set_drvdata(dev, dvi); in tfp410_init()
330 dvi->bridge.funcs = &tfp410_bridge_funcs; in tfp410_init()
331 dvi->bridge.of_node = dev->of_node; in tfp410_init()
332 dvi->bridge.timings = &dvi->timings; in tfp410_init()
333 dvi->dev = dev; in tfp410_init()
335 ret = tfp410_parse_timings(dvi, i2c); in tfp410_init()
339 ret = tfp410_get_connector_properties(dvi); in tfp410_init()
343 dvi->powerdown = devm_gpiod_get_optional(dev, "powerdown", in tfp410_init()
345 if (IS_ERR(dvi->powerdown)) { in tfp410_init()
347 return PTR_ERR(dvi->powerdown); in tfp410_init()
350 if (dvi->hpd) in tfp410_init()
351 dvi->hpd_irq = gpiod_to_irq(dvi->hpd); in tfp410_init()
353 dvi->hpd_irq = -ENXIO; in tfp410_init()
355 if (dvi->hpd_irq >= 0) { in tfp410_init()
356 INIT_DELAYED_WORK(&dvi->hpd_work, tfp410_hpd_work_func); in tfp410_init()
358 ret = devm_request_threaded_irq(dev, dvi->hpd_irq, in tfp410_init()
361 "hdmi-hpd", dvi); in tfp410_init()
368 drm_bridge_add(&dvi->bridge); in tfp410_init()
372 i2c_put_adapter(dvi->ddc); in tfp410_init()
373 if (dvi->hpd) in tfp410_init()
374 gpiod_put(dvi->hpd); in tfp410_init()
380 struct tfp410 *dvi = dev_get_drvdata(dev); in tfp410_fini() local
382 if (dvi->hpd_irq >= 0) in tfp410_fini()
383 cancel_delayed_work_sync(&dvi->hpd_work); in tfp410_fini()
385 drm_bridge_remove(&dvi->bridge); in tfp410_fini()
387 if (dvi->ddc) in tfp410_fini()
388 i2c_put_adapter(dvi->ddc); in tfp410_fini()
389 if (dvi->hpd) in tfp410_fini()
390 gpiod_put(dvi->hpd); in tfp410_fini()