Lines Matching +full:edid +full:- +full:emulation
1 // SPDX-License-Identifier: GPL-2.0-only
56 ret = i2c_master_send(ptn_bridge->client, &addr, 1); in ptn3460_read_bytes()
62 ret = i2c_master_recv(ptn_bridge->client, buf, len); in ptn3460_read_bytes()
80 ret = i2c_master_send(ptn_bridge->client, buf, ARRAY_SIZE(buf)); in ptn3460_write_byte()
94 /* Load the selected edid into SRAM (accessed at PTN3460_EDID_ADDR) */ in ptn3460_select_edid()
96 ptn_bridge->edid_emulation); in ptn3460_select_edid()
98 DRM_ERROR("Failed to transfer EDID to sram, ret=%d\n", ret); in ptn3460_select_edid()
102 /* Enable EDID emulation and select the desired EDID */ in ptn3460_select_edid()
104 ptn_bridge->edid_emulation << PTN3460_EDID_EMULATION_SELECTION; in ptn3460_select_edid()
108 DRM_ERROR("Failed to write EDID value, ret=%d\n", ret); in ptn3460_select_edid()
120 if (ptn_bridge->enabled) in ptn3460_pre_enable()
123 gpiod_set_value(ptn_bridge->gpio_pd_n, 1); in ptn3460_pre_enable()
125 gpiod_set_value(ptn_bridge->gpio_rst_n, 0); in ptn3460_pre_enable()
127 gpiod_set_value(ptn_bridge->gpio_rst_n, 1); in ptn3460_pre_enable()
138 DRM_ERROR("Select EDID failed ret=%d\n", ret); in ptn3460_pre_enable()
140 ptn_bridge->enabled = true; in ptn3460_pre_enable()
147 if (!ptn_bridge->enabled) in ptn3460_disable()
150 ptn_bridge->enabled = false; in ptn3460_disable()
152 gpiod_set_value(ptn_bridge->gpio_rst_n, 1); in ptn3460_disable()
153 gpiod_set_value(ptn_bridge->gpio_pd_n, 0); in ptn3460_disable()
163 u8 *edid; in ptn3460_edid_read() local
166 power_off = !ptn_bridge->enabled; in ptn3460_edid_read()
167 ptn3460_pre_enable(&ptn_bridge->bridge); in ptn3460_edid_read()
169 edid = kmalloc(EDID_LENGTH, GFP_KERNEL); in ptn3460_edid_read()
170 if (!edid) { in ptn3460_edid_read()
171 DRM_ERROR("Failed to allocate EDID\n"); in ptn3460_edid_read()
175 ret = ptn3460_read_bytes(ptn_bridge, PTN3460_EDID_ADDR, edid, in ptn3460_edid_read()
178 kfree(edid); in ptn3460_edid_read()
182 drm_edid = drm_edid_alloc(edid, EDID_LENGTH); in ptn3460_edid_read()
186 ptn3460_disable(&ptn_bridge->bridge); in ptn3460_edid_read()
197 drm_edid = ptn3460_edid_read(&ptn_bridge->bridge, connector); in ptn3460_connector_get_modes()
224 ret = drm_bridge_attach(bridge->encoder, ptn_bridge->panel_bridge, in ptn3460_bridge_attach()
232 ptn_bridge->connector.polled = DRM_CONNECTOR_POLL_HPD; in ptn3460_bridge_attach()
233 ret = drm_connector_init(bridge->dev, &ptn_bridge->connector, in ptn3460_bridge_attach()
239 drm_connector_helper_add(&ptn_bridge->connector, in ptn3460_bridge_attach()
241 drm_connector_register(&ptn_bridge->connector); in ptn3460_bridge_attach()
242 drm_connector_attach_encoder(&ptn_bridge->connector, in ptn3460_bridge_attach()
243 bridge->encoder); in ptn3460_bridge_attach()
245 drm_helper_hpd_irq_event(ptn_bridge->connector.dev); in ptn3460_bridge_attach()
259 struct device *dev = &client->dev; in ptn3460_probe()
266 return -ENOMEM; in ptn3460_probe()
269 panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); in ptn3460_probe()
273 ptn_bridge->panel_bridge = panel_bridge; in ptn3460_probe()
274 ptn_bridge->client = client; in ptn3460_probe()
276 ptn_bridge->gpio_pd_n = devm_gpiod_get(&client->dev, "powerdown", in ptn3460_probe()
278 if (IS_ERR(ptn_bridge->gpio_pd_n)) { in ptn3460_probe()
279 ret = PTR_ERR(ptn_bridge->gpio_pd_n); in ptn3460_probe()
288 ptn_bridge->gpio_rst_n = devm_gpiod_get(&client->dev, "reset", in ptn3460_probe()
290 if (IS_ERR(ptn_bridge->gpio_rst_n)) { in ptn3460_probe()
291 ret = PTR_ERR(ptn_bridge->gpio_rst_n); in ptn3460_probe()
296 ret = of_property_read_u32(dev->of_node, "edid-emulation", in ptn3460_probe()
297 &ptn_bridge->edid_emulation); in ptn3460_probe()
299 dev_err(dev, "Can't read EDID emulation value\n"); in ptn3460_probe()
303 ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs; in ptn3460_probe()
304 ptn_bridge->bridge.ops = DRM_BRIDGE_OP_EDID; in ptn3460_probe()
305 ptn_bridge->bridge.type = DRM_MODE_CONNECTOR_LVDS; in ptn3460_probe()
306 ptn_bridge->bridge.of_node = dev->of_node; in ptn3460_probe()
307 drm_bridge_add(&ptn_bridge->bridge); in ptn3460_probe()
318 drm_bridge_remove(&ptn_bridge->bridge); in ptn3460_remove()
345 MODULE_DESCRIPTION("NXP ptn3460 eDP-LVDS converter driver");