drivers/gpu/drm/bridge/thc63lvd1024.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/thc63lvd1024.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/thc63lvd1024.c- Extension
.c- Size
- 5559 bytes
- Lines
- 244
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/gpio/consumer.hlinux/module.hlinux/of.hlinux/of_graph.hlinux/platform_device.hlinux/regulator/consumer.hlinux/slab.hdrm/drm_bridge.hdrm/drm_panel.h
Detected Declarations
struct thc63_devenum thc63_portsfunction thc63_attachfunction thc63_mode_validfunction thc63_enablefunction thc63_disablefunction thc63_parse_dtfunction thc63_gpio_initfunction thc63_probefunction thc63_remove
Annotated Snippet
struct thc63_dev {
struct device *dev;
struct regulator *vcc;
struct gpio_desc *pdwn;
struct gpio_desc *oe;
struct drm_bridge bridge;
struct drm_bridge_timings timings;
};
static inline struct thc63_dev *to_thc63(struct drm_bridge *bridge)
{
return container_of(bridge, struct thc63_dev, bridge);
}
static int thc63_attach(struct drm_bridge *bridge,
struct drm_encoder *encoder,
enum drm_bridge_attach_flags flags)
{
struct thc63_dev *thc63 = to_thc63(bridge);
return drm_bridge_attach(encoder, thc63->bridge.next_bridge, bridge, flags);
}
static enum drm_mode_status thc63_mode_valid(struct drm_bridge *bridge,
const struct drm_display_info *info,
const struct drm_display_mode *mode)
{
struct thc63_dev *thc63 = to_thc63(bridge);
unsigned int min_freq;
unsigned int max_freq;
/*
* The THC63LVD1024 pixel rate range is 8 to 135 MHz in all modes but
* dual-in, single-out where it is 40 to 150 MHz. As dual-in, dual-out
* isn't supported by the driver yet, simply derive the limits from the
* input mode.
*/
if (thc63->timings.dual_link) {
min_freq = 40000;
max_freq = 150000;
} else {
min_freq = 8000;
max_freq = 135000;
}
if (mode->clock < min_freq)
return MODE_CLOCK_LOW;
if (mode->clock > max_freq)
return MODE_CLOCK_HIGH;
return MODE_OK;
}
static void thc63_enable(struct drm_bridge *bridge)
{
struct thc63_dev *thc63 = to_thc63(bridge);
int ret;
ret = regulator_enable(thc63->vcc);
if (ret) {
dev_err(thc63->dev,
"Failed to enable regulator \"vcc\": %d\n", ret);
return;
}
gpiod_set_value(thc63->pdwn, 0);
gpiod_set_value(thc63->oe, 1);
}
static void thc63_disable(struct drm_bridge *bridge)
{
struct thc63_dev *thc63 = to_thc63(bridge);
int ret;
gpiod_set_value(thc63->oe, 0);
gpiod_set_value(thc63->pdwn, 1);
ret = regulator_disable(thc63->vcc);
if (ret)
dev_err(thc63->dev,
"Failed to disable regulator \"vcc\": %d\n", ret);
}
static const struct drm_bridge_funcs thc63_bridge_func = {
.attach = thc63_attach,
Annotation
- Immediate include surface: `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/of_graph.h`, `linux/platform_device.h`, `linux/regulator/consumer.h`, `linux/slab.h`, `drm/drm_bridge.h`.
- Detected declarations: `struct thc63_dev`, `enum thc63_ports`, `function thc63_attach`, `function thc63_mode_valid`, `function thc63_enable`, `function thc63_disable`, `function thc63_parse_dt`, `function thc63_gpio_init`, `function thc63_probe`, `function thc63_remove`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.