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_edid_read() local
166 power_off = !ptn_bridge->enabled; in ptn3460_edid_read()
167 ptn3460_pre_enable(&ptn_bridge->bridge); in ptn3460_edid_read()
175 ret = ptn3460_read_bytes(ptn_bridge, PTN3460_EDID_ADDR, edid, in ptn3460_edid_read()
186 ptn3460_disable(&ptn_bridge->bridge); in ptn3460_edid_read()
193 struct ptn3460_bridge *ptn_bridge = connector_to_ptn3460(connector); in ptn3460_connector_get_modes() local
197 drm_edid = ptn3460_edid_read(&ptn_bridge->bridge, connector); in ptn3460_connector_get_modes()
220 struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge); in ptn3460_bridge_attach() local
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()
245 drm_helper_hpd_irq_event(ptn_bridge->connector.dev); in ptn3460_bridge_attach()
260 struct ptn3460_bridge *ptn_bridge; in ptn3460_probe() local
264 ptn_bridge = devm_kzalloc(dev, sizeof(*ptn_bridge), GFP_KERNEL); in ptn3460_probe()
265 if (!ptn_bridge) { 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()
297 &ptn_bridge->edid_emulation); 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()
309 i2c_set_clientdata(client, ptn_bridge); in ptn3460_probe()
316 struct ptn3460_bridge *ptn_bridge = i2c_get_clientdata(client); in ptn3460_remove() local
318 drm_bridge_remove(&ptn_bridge->bridge); in ptn3460_remove()