drivers/gpu/drm/bridge/ti-tpd12s015.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/ti-tpd12s015.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/ti-tpd12s015.c- Extension
.c- Size
- 5219 bytes
- Lines
- 215
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/gpio/consumer.hlinux/interrupt.hlinux/module.hlinux/mutex.hlinux/of.hlinux/of_graph.hlinux/platform_device.hdrm/drm_bridge.h
Detected Declarations
struct tpd12s015_devicefunction tpd12s015_attachfunction tpd12s015_detachfunction tpd12s015_detectfunction tpd12s015_bridge_detectfunction tpd12s015_hpd_enablefunction tpd12s015_hpd_disablefunction tpd12s015_hpd_isrfunction tpd12s015_probefunction tpd12s015_remove
Annotated Snippet
struct tpd12s015_device {
struct drm_bridge bridge;
struct gpio_desc *ct_cp_hpd_gpio;
struct gpio_desc *ls_oe_gpio;
struct gpio_desc *hpd_gpio;
int hpd_irq;
};
static inline struct tpd12s015_device *to_tpd12s015(struct drm_bridge *bridge)
{
return container_of(bridge, struct tpd12s015_device, bridge);
}
static int tpd12s015_attach(struct drm_bridge *bridge,
struct drm_encoder *encoder,
enum drm_bridge_attach_flags flags)
{
struct tpd12s015_device *tpd = to_tpd12s015(bridge);
int ret;
if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
return -EINVAL;
ret = drm_bridge_attach(encoder, tpd->bridge.next_bridge,
bridge, flags);
if (ret < 0)
return ret;
gpiod_set_value_cansleep(tpd->ls_oe_gpio, 1);
/* DC-DC converter needs at max 300us to get to 90% of 5V. */
usleep_range(300, 1000);
return 0;
}
static void tpd12s015_detach(struct drm_bridge *bridge)
{
struct tpd12s015_device *tpd = to_tpd12s015(bridge);
gpiod_set_value_cansleep(tpd->ls_oe_gpio, 0);
}
static enum drm_connector_status tpd12s015_detect(struct drm_bridge *bridge)
{
struct tpd12s015_device *tpd = to_tpd12s015(bridge);
if (gpiod_get_value_cansleep(tpd->hpd_gpio))
return connector_status_connected;
else
return connector_status_disconnected;
}
static enum drm_connector_status
tpd12s015_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connector)
{
return tpd12s015_detect(bridge);
}
static void tpd12s015_hpd_enable(struct drm_bridge *bridge)
{
struct tpd12s015_device *tpd = to_tpd12s015(bridge);
gpiod_set_value_cansleep(tpd->ct_cp_hpd_gpio, 1);
}
static void tpd12s015_hpd_disable(struct drm_bridge *bridge)
{
struct tpd12s015_device *tpd = to_tpd12s015(bridge);
gpiod_set_value_cansleep(tpd->ct_cp_hpd_gpio, 0);
}
static const struct drm_bridge_funcs tpd12s015_bridge_funcs = {
.attach = tpd12s015_attach,
.detach = tpd12s015_detach,
.detect = tpd12s015_bridge_detect,
.hpd_enable = tpd12s015_hpd_enable,
.hpd_disable = tpd12s015_hpd_disable,
};
static irqreturn_t tpd12s015_hpd_isr(int irq, void *data)
{
struct tpd12s015_device *tpd = data;
struct drm_bridge *bridge = &tpd->bridge;
drm_bridge_hpd_notify(bridge, tpd12s015_detect(bridge));
return IRQ_HANDLED;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/gpio/consumer.h`, `linux/interrupt.h`, `linux/module.h`, `linux/mutex.h`, `linux/of.h`, `linux/of_graph.h`, `linux/platform_device.h`.
- Detected declarations: `struct tpd12s015_device`, `function tpd12s015_attach`, `function tpd12s015_detach`, `function tpd12s015_detect`, `function tpd12s015_bridge_detect`, `function tpd12s015_hpd_enable`, `function tpd12s015_hpd_disable`, `function tpd12s015_hpd_isr`, `function tpd12s015_probe`, `function tpd12s015_remove`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.