Lines Matching refs:ptn_bridge

51 static int ptn3460_read_bytes(struct ptn3460_bridge *ptn_bridge, char addr,  in ptn3460_read_bytes()  argument
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()
71 static int ptn3460_write_byte(struct ptn3460_bridge *ptn_bridge, char addr, in ptn3460_write_byte() argument
80 ret = i2c_master_send(ptn_bridge->client, buf, ARRAY_SIZE(buf)); in ptn3460_write_byte()
89 static int ptn3460_select_edid(struct ptn3460_bridge *ptn_bridge) in ptn3460_select_edid() argument
95 ret = ptn3460_write_byte(ptn_bridge, PTN3460_EDID_SRAM_LOAD_ADDR, in ptn3460_select_edid()
96 ptn_bridge->edid_emulation); in ptn3460_select_edid()
104 ptn_bridge->edid_emulation << PTN3460_EDID_EMULATION_SELECTION; in ptn3460_select_edid()
106 ret = ptn3460_write_byte(ptn_bridge, PTN3460_EDID_EMULATION_ADDR, val); in ptn3460_select_edid()
117 struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge); in ptn3460_pre_enable() local
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()
136 ret = ptn3460_select_edid(ptn_bridge); in ptn3460_pre_enable()
140 ptn_bridge->enabled = true; in ptn3460_pre_enable()
145 struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge); in ptn3460_disable() local
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()
160 struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge); in ptn3460_get_edid() local
165 power_off = !ptn_bridge->enabled; in ptn3460_get_edid()
166 ptn3460_pre_enable(&ptn_bridge->bridge); in ptn3460_get_edid()
174 ret = ptn3460_read_bytes(ptn_bridge, PTN3460_EDID_ADDR, edid, in ptn3460_get_edid()
184 ptn3460_disable(&ptn_bridge->bridge); in ptn3460_get_edid()
191 struct ptn3460_bridge *ptn_bridge = connector_to_ptn3460(connector); in ptn3460_connector_get_modes() local
195 edid = ptn3460_get_edid(&ptn_bridge->bridge, connector); in ptn3460_connector_get_modes()
218 struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge); in ptn3460_bridge_attach() local
222 ret = drm_bridge_attach(bridge->encoder, ptn_bridge->panel_bridge, in ptn3460_bridge_attach()
235 ptn_bridge->connector.polled = DRM_CONNECTOR_POLL_HPD; in ptn3460_bridge_attach()
236 ret = drm_connector_init(bridge->dev, &ptn_bridge->connector, in ptn3460_bridge_attach()
242 drm_connector_helper_add(&ptn_bridge->connector, in ptn3460_bridge_attach()
244 drm_connector_register(&ptn_bridge->connector); in ptn3460_bridge_attach()
245 drm_connector_attach_encoder(&ptn_bridge->connector, in ptn3460_bridge_attach()
248 drm_helper_hpd_irq_event(ptn_bridge->connector.dev); in ptn3460_bridge_attach()
263 struct ptn3460_bridge *ptn_bridge; in ptn3460_probe() local
267 ptn_bridge = devm_kzalloc(dev, sizeof(*ptn_bridge), GFP_KERNEL); in ptn3460_probe()
268 if (!ptn_bridge) { in ptn3460_probe()
276 ptn_bridge->panel_bridge = panel_bridge; in ptn3460_probe()
277 ptn_bridge->client = client; in ptn3460_probe()
279 ptn_bridge->gpio_pd_n = devm_gpiod_get(&client->dev, "powerdown", in ptn3460_probe()
281 if (IS_ERR(ptn_bridge->gpio_pd_n)) { in ptn3460_probe()
282 ret = PTR_ERR(ptn_bridge->gpio_pd_n); in ptn3460_probe()
291 ptn_bridge->gpio_rst_n = devm_gpiod_get(&client->dev, "reset", in ptn3460_probe()
293 if (IS_ERR(ptn_bridge->gpio_rst_n)) { in ptn3460_probe()
294 ret = PTR_ERR(ptn_bridge->gpio_rst_n); in ptn3460_probe()
300 &ptn_bridge->edid_emulation); in ptn3460_probe()
306 ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs; in ptn3460_probe()
307 ptn_bridge->bridge.ops = DRM_BRIDGE_OP_EDID; in ptn3460_probe()
308 ptn_bridge->bridge.type = DRM_MODE_CONNECTOR_LVDS; in ptn3460_probe()
309 ptn_bridge->bridge.of_node = dev->of_node; in ptn3460_probe()
310 drm_bridge_add(&ptn_bridge->bridge); in ptn3460_probe()
312 i2c_set_clientdata(client, ptn_bridge); in ptn3460_probe()
319 struct ptn3460_bridge *ptn_bridge = i2c_get_clientdata(client); in ptn3460_remove() local
321 drm_bridge_remove(&ptn_bridge->bridge); in ptn3460_remove()