Lines Matching full:output
23 struct tegra_output *output = connector_to_output(connector); in tegra_output_connector_get_modes() local
31 if (output->panel) { in tegra_output_connector_get_modes()
32 err = drm_panel_get_modes(output->panel, connector); in tegra_output_connector_get_modes()
37 if (output->drm_edid) in tegra_output_connector_get_modes()
38 drm_edid = drm_edid_dup(output->drm_edid); in tegra_output_connector_get_modes()
39 else if (output->ddc) in tegra_output_connector_get_modes()
40 drm_edid = drm_edid_read_ddc(connector, output->ddc); in tegra_output_connector_get_modes()
43 cec_notifier_set_phys_addr(output->cec, in tegra_output_connector_get_modes()
55 struct tegra_output *output = connector_to_output(connector); in tegra_output_connector_detect() local
58 if (output->hpd_gpio) { in tegra_output_connector_detect()
59 if (gpiod_get_value(output->hpd_gpio) == 0) in tegra_output_connector_detect()
64 if (!output->panel) in tegra_output_connector_detect()
71 cec_notifier_phys_addr_invalidate(output->cec); in tegra_output_connector_detect()
78 struct tegra_output *output = connector_to_output(connector); in tegra_output_connector_destroy() local
80 if (output->cec) in tegra_output_connector_destroy()
81 cec_notifier_conn_unregister(output->cec); in tegra_output_connector_destroy()
89 struct tegra_output *output = data; in hpd_irq() local
91 if (output->connector.dev) in hpd_irq()
92 drm_helper_hpd_irq_event(output->connector.dev); in hpd_irq()
97 int tegra_output_probe(struct tegra_output *output) in tegra_output_probe() argument
104 if (!output->of_node) in tegra_output_probe()
105 output->of_node = output->dev->of_node; in tegra_output_probe()
107 err = drm_of_find_panel_or_bridge(output->of_node, -1, -1, in tegra_output_probe()
108 &output->panel, &output->bridge); in tegra_output_probe()
112 panel = of_parse_phandle(output->of_node, "nvidia,panel", 0); in tegra_output_probe()
118 WARN_ON(output->panel || output->bridge); in tegra_output_probe()
120 output->panel = of_drm_find_panel(panel); in tegra_output_probe()
123 if (IS_ERR(output->panel)) in tegra_output_probe()
124 return PTR_ERR(output->panel); in tegra_output_probe()
127 ddc = of_parse_phandle(output->of_node, "nvidia,ddc-i2c-bus", 0); in tegra_output_probe()
129 output->ddc = of_get_i2c_adapter_by_node(ddc); in tegra_output_probe()
132 if (!output->ddc) { in tegra_output_probe()
138 edid = of_get_property(output->of_node, "nvidia,edid", &size); in tegra_output_probe()
139 output->drm_edid = drm_edid_alloc(edid, size); in tegra_output_probe()
141 output->hpd_gpio = devm_fwnode_gpiod_get(output->dev, in tegra_output_probe()
142 of_fwnode_handle(output->of_node), in tegra_output_probe()
146 if (IS_ERR(output->hpd_gpio)) { in tegra_output_probe()
147 if (PTR_ERR(output->hpd_gpio) != -ENOENT) { in tegra_output_probe()
148 err = PTR_ERR(output->hpd_gpio); in tegra_output_probe()
152 output->hpd_gpio = NULL; in tegra_output_probe()
155 if (output->hpd_gpio) { in tegra_output_probe()
156 err = gpiod_to_irq(output->hpd_gpio); in tegra_output_probe()
158 dev_err(output->dev, "gpiod_to_irq(): %d\n", err); in tegra_output_probe()
162 output->hpd_irq = err; in tegra_output_probe()
167 err = request_threaded_irq(output->hpd_irq, NULL, hpd_irq, in tegra_output_probe()
168 flags, "hpd", output); in tegra_output_probe()
170 dev_err(output->dev, "failed to request IRQ#%u: %d\n", in tegra_output_probe()
171 output->hpd_irq, err); in tegra_output_probe()
175 output->connector.polled = DRM_CONNECTOR_POLL_HPD; in tegra_output_probe()
182 disable_irq(output->hpd_irq); in tegra_output_probe()
188 if (output->ddc) in tegra_output_probe()
189 i2c_put_adapter(output->ddc); in tegra_output_probe()
191 drm_edid_free(output->drm_edid); in tegra_output_probe()
196 void tegra_output_remove(struct tegra_output *output) in tegra_output_remove() argument
198 if (output->hpd_gpio) in tegra_output_remove()
199 free_irq(output->hpd_irq, output); in tegra_output_remove()
201 if (output->ddc) in tegra_output_remove()
202 i2c_put_adapter(output->ddc); in tegra_output_remove()
204 drm_edid_free(output->drm_edid); in tegra_output_remove()
207 int tegra_output_init(struct drm_device *drm, struct tegra_output *output) in tegra_output_init() argument
215 if (output->hpd_gpio) in tegra_output_init()
216 enable_irq(output->hpd_irq); in tegra_output_init()
218 connector_type = output->connector.connector_type; in tegra_output_init()
226 cec_fill_conn_info_from_drm(&conn_info, &output->connector); in tegra_output_init()
227 output->cec = cec_notifier_conn_register(output->dev, NULL, in tegra_output_init()
229 if (!output->cec) in tegra_output_init()
236 void tegra_output_exit(struct tegra_output *output) in tegra_output_exit() argument
242 if (output->hpd_gpio) in tegra_output_exit()
243 disable_irq(output->hpd_irq); in tegra_output_exit()
246 void tegra_output_find_possible_crtcs(struct tegra_output *output, in tegra_output_find_possible_crtcs() argument
249 struct device *dev = output->dev; in tegra_output_find_possible_crtcs()
261 dev_warn(dev, "missing output definition for heads in DT\n"); in tegra_output_find_possible_crtcs()
265 output->encoder.possible_crtcs = mask; in tegra_output_find_possible_crtcs()
268 int tegra_output_suspend(struct tegra_output *output) in tegra_output_suspend() argument
270 if (output->hpd_irq) in tegra_output_suspend()
271 disable_irq(output->hpd_irq); in tegra_output_suspend()
276 int tegra_output_resume(struct tegra_output *output) in tegra_output_resume() argument
278 if (output->hpd_irq) in tegra_output_resume()
279 enable_irq(output->hpd_irq); in tegra_output_resume()