Lines Matching +full:level +full:- +full:shifter
1 // SPDX-License-Identifier: GPL-2.0
3 * TPD12S015 HDMI ESD protection & level shifter chip driver
7 * Based on the omapdrm-specific encoder-opa362 driver
47 return -EINVAL; in tpd12s015_attach()
49 ret = drm_bridge_attach(bridge->encoder, tpd->next_bridge, in tpd12s015_attach()
54 gpiod_set_value_cansleep(tpd->ls_oe_gpio, 1); in tpd12s015_attach()
56 /* DC-DC converter needs at max 300us to get to 90% of 5V. */ in tpd12s015_attach()
66 gpiod_set_value_cansleep(tpd->ls_oe_gpio, 0); in tpd12s015_detach()
73 if (gpiod_get_value_cansleep(tpd->hpd_gpio)) in tpd12s015_detect()
83 gpiod_set_value_cansleep(tpd->ct_cp_hpd_gpio, 1); in tpd12s015_hpd_enable()
90 gpiod_set_value_cansleep(tpd->ct_cp_hpd_gpio, 0); in tpd12s015_hpd_disable()
104 struct drm_bridge *bridge = &tpd->bridge; in tpd12s015_hpd_isr()
118 tpd = devm_kzalloc(&pdev->dev, sizeof(*tpd), GFP_KERNEL); in tpd12s015_probe()
120 return -ENOMEM; in tpd12s015_probe()
124 tpd->bridge.funcs = &tpd12s015_bridge_funcs; in tpd12s015_probe()
125 tpd->bridge.of_node = pdev->dev.of_node; in tpd12s015_probe()
126 tpd->bridge.type = DRM_MODE_CONNECTOR_HDMIA; in tpd12s015_probe()
127 tpd->bridge.ops = DRM_BRIDGE_OP_DETECT; in tpd12s015_probe()
130 node = of_graph_get_remote_node(pdev->dev.of_node, 1, -1); in tpd12s015_probe()
132 return -ENODEV; in tpd12s015_probe()
134 tpd->next_bridge = of_drm_find_bridge(node); in tpd12s015_probe()
137 if (!tpd->next_bridge) in tpd12s015_probe()
138 return -EPROBE_DEFER; in tpd12s015_probe()
141 gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 0, in tpd12s015_probe()
146 tpd->ct_cp_hpd_gpio = gpio; in tpd12s015_probe()
148 gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 1, in tpd12s015_probe()
153 tpd->ls_oe_gpio = gpio; in tpd12s015_probe()
155 gpio = devm_gpiod_get_index(&pdev->dev, NULL, 2, GPIOD_IN); in tpd12s015_probe()
159 tpd->hpd_gpio = gpio; in tpd12s015_probe()
161 /* Register the IRQ if the HPD GPIO is IRQ-capable. */ in tpd12s015_probe()
162 tpd->hpd_irq = gpiod_to_irq(tpd->hpd_gpio); in tpd12s015_probe()
163 if (tpd->hpd_irq >= 0) { in tpd12s015_probe()
164 ret = devm_request_threaded_irq(&pdev->dev, tpd->hpd_irq, NULL, in tpd12s015_probe()
173 tpd->bridge.ops |= DRM_BRIDGE_OP_HPD; in tpd12s015_probe()
177 drm_bridge_add(&tpd->bridge); in tpd12s015_probe()
186 drm_bridge_remove(&tpd->bridge); in tpd12s015_remove()
208 MODULE_DESCRIPTION("TPD12S015 HDMI level shifter and ESD protection driver");