Lines Matching refs:output
22 struct tegra_output *output = connector_to_output(connector); in tegra_output_connector_get_modes() local
30 if (output->panel) { in tegra_output_connector_get_modes()
31 err = drm_panel_get_modes(output->panel, connector); in tegra_output_connector_get_modes()
36 if (output->edid) in tegra_output_connector_get_modes()
37 edid = kmemdup(output->edid, sizeof(*edid), GFP_KERNEL); in tegra_output_connector_get_modes()
38 else if (output->ddc) in tegra_output_connector_get_modes()
39 edid = drm_get_edid(connector, output->ddc); in tegra_output_connector_get_modes()
41 cec_notifier_set_phys_addr_from_edid(output->cec, edid); 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
103 if (!output->of_node) in tegra_output_probe()
104 output->of_node = output->dev->of_node; in tegra_output_probe()
106 err = drm_of_find_panel_or_bridge(output->of_node, -1, -1, in tegra_output_probe()
107 &output->panel, &output->bridge); in tegra_output_probe()
111 panel = of_parse_phandle(output->of_node, "nvidia,panel", 0); in tegra_output_probe()
117 WARN_ON(output->panel || output->bridge); in tegra_output_probe()
119 output->panel = of_drm_find_panel(panel); in tegra_output_probe()
122 if (IS_ERR(output->panel)) in tegra_output_probe()
123 return PTR_ERR(output->panel); in tegra_output_probe()
126 output->edid = of_get_property(output->of_node, "nvidia,edid", &size); in tegra_output_probe()
128 ddc = of_parse_phandle(output->of_node, "nvidia,ddc-i2c-bus", 0); in tegra_output_probe()
130 output->ddc = of_get_i2c_adapter_by_node(ddc); in tegra_output_probe()
133 if (!output->ddc) { in tegra_output_probe()
139 output->hpd_gpio = devm_fwnode_gpiod_get(output->dev, in tegra_output_probe()
140 of_fwnode_handle(output->of_node), in tegra_output_probe()
144 if (IS_ERR(output->hpd_gpio)) { in tegra_output_probe()
145 if (PTR_ERR(output->hpd_gpio) != -ENOENT) { in tegra_output_probe()
146 err = PTR_ERR(output->hpd_gpio); in tegra_output_probe()
150 output->hpd_gpio = NULL; in tegra_output_probe()
153 if (output->hpd_gpio) { in tegra_output_probe()
154 err = gpiod_to_irq(output->hpd_gpio); in tegra_output_probe()
156 dev_err(output->dev, "gpiod_to_irq(): %d\n", err); in tegra_output_probe()
160 output->hpd_irq = err; in tegra_output_probe()
165 err = request_threaded_irq(output->hpd_irq, NULL, hpd_irq, in tegra_output_probe()
166 flags, "hpd", output); in tegra_output_probe()
168 dev_err(output->dev, "failed to request IRQ#%u: %d\n", in tegra_output_probe()
169 output->hpd_irq, err); in tegra_output_probe()
173 output->connector.polled = DRM_CONNECTOR_POLL_HPD; in tegra_output_probe()
180 disable_irq(output->hpd_irq); in tegra_output_probe()
186 if (output->ddc) in tegra_output_probe()
187 i2c_put_adapter(output->ddc); in tegra_output_probe()
192 void tegra_output_remove(struct tegra_output *output) in tegra_output_remove() argument
194 if (output->hpd_gpio) in tegra_output_remove()
195 free_irq(output->hpd_irq, output); in tegra_output_remove()
197 if (output->ddc) in tegra_output_remove()
198 i2c_put_adapter(output->ddc); in tegra_output_remove()
201 int tegra_output_init(struct drm_device *drm, struct tegra_output *output) in tegra_output_init() argument
209 if (output->hpd_gpio) in tegra_output_init()
210 enable_irq(output->hpd_irq); in tegra_output_init()
212 connector_type = output->connector.connector_type; in tegra_output_init()
220 cec_fill_conn_info_from_drm(&conn_info, &output->connector); in tegra_output_init()
221 output->cec = cec_notifier_conn_register(output->dev, NULL, in tegra_output_init()
223 if (!output->cec) in tegra_output_init()
230 void tegra_output_exit(struct tegra_output *output) in tegra_output_exit() argument
236 if (output->hpd_gpio) in tegra_output_exit()
237 disable_irq(output->hpd_irq); in tegra_output_exit()
240 void tegra_output_find_possible_crtcs(struct tegra_output *output, in tegra_output_find_possible_crtcs() argument
243 struct device *dev = output->dev; in tegra_output_find_possible_crtcs()
259 output->encoder.possible_crtcs = mask; in tegra_output_find_possible_crtcs()
262 int tegra_output_suspend(struct tegra_output *output) in tegra_output_suspend() argument
264 if (output->hpd_irq) in tegra_output_suspend()
265 disable_irq(output->hpd_irq); in tegra_output_suspend()
270 int tegra_output_resume(struct tegra_output *output) in tegra_output_resume() argument
272 if (output->hpd_irq) in tegra_output_resume()
273 enable_irq(output->hpd_irq); in tegra_output_resume()