drivers/gpu/drm/bridge/parade-ps8640.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/parade-ps8640.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/parade-ps8640.c- Extension
.c- Size
- 20565 bytes
- Lines
- 754
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/err.hlinux/gpio/consumer.hlinux/i2c.hlinux/module.hlinux/of_graph.hlinux/pm_runtime.hlinux/regmap.hlinux/regulator/consumer.hdrm/display/drm_dp_aux_bus.hdrm/display/drm_dp_helper.hdrm/drm_atomic_state_helper.hdrm/drm_bridge.hdrm/drm_edid.hdrm/drm_mipi_dsi.hdrm/drm_of.hdrm/drm_print.h
Detected Declarations
struct ps8640enum page_addr_offsetenum ps8640_vdo_controlfunction _ps8640_wait_hpd_assertedfunction timefunction ps8640_wait_hpd_assertedfunction ps8640_aux_transfer_msgfunction ps8640_aux_transferfunction ps8640_bridge_vdo_controlfunction ps8640_resumefunction ps8640_suspendfunction ps8640_atomic_pre_enablefunction ps8640_atomic_post_disablefunction ps8640_bridge_attachfunction ps8640_bridge_detachfunction ps8640_runtime_disablefunction ps8640_bridge_get_dsi_resourcesfunction ps8640_bridge_link_panelfunction ps8640_probe
Annotated Snippet
struct ps8640 {
struct drm_bridge bridge;
struct drm_bridge *panel_bridge;
struct drm_dp_aux aux;
struct mipi_dsi_device *dsi;
struct i2c_client *page[MAX_DEVS];
struct regmap *regmap[MAX_DEVS];
struct regulator_bulk_data supplies[2];
struct gpio_desc *gpio_reset;
struct gpio_desc *gpio_powerdown;
struct device_link *link;
bool pre_enabled;
bool need_post_hpd_delay;
struct mutex aux_lock;
};
static const struct regmap_config ps8640_regmap_config[] = {
[PAGE0_DP_CNTL] = {
COMMON_PS8640_REGMAP_CONFIG,
.max_register = 0xbf,
},
[PAGE1_VDO_BDG] = {
COMMON_PS8640_REGMAP_CONFIG,
.max_register = 0xff,
},
[PAGE2_TOP_CNTL] = {
COMMON_PS8640_REGMAP_CONFIG,
.max_register = 0xff,
},
[PAGE3_DSI_CNTL1] = {
COMMON_PS8640_REGMAP_CONFIG,
.max_register = 0xff,
},
[PAGE4_MIPI_PHY] = {
COMMON_PS8640_REGMAP_CONFIG,
.max_register = 0xff,
},
[PAGE5_VPLL] = {
COMMON_PS8640_REGMAP_CONFIG,
.max_register = 0x7f,
},
[PAGE6_DSI_CNTL2] = {
COMMON_PS8640_REGMAP_CONFIG,
.max_register = 0xff,
},
[PAGE7_SPI_CNTL] = {
COMMON_PS8640_REGMAP_CONFIG,
.max_register = 0xff,
},
};
static inline struct ps8640 *bridge_to_ps8640(struct drm_bridge *e)
{
return container_of(e, struct ps8640, bridge);
}
static inline struct ps8640 *aux_to_ps8640(struct drm_dp_aux *aux)
{
return container_of(aux, struct ps8640, aux);
}
static int _ps8640_wait_hpd_asserted(struct ps8640 *ps_bridge, unsigned long wait_us)
{
struct regmap *map = ps_bridge->regmap[PAGE2_TOP_CNTL];
int status;
int ret;
/*
* Apparently something about the firmware in the chip signals that
* HPD goes high by reporting GPIO9 as high (even though HPD isn't
* actually connected to GPIO9).
*/
ret = regmap_read_poll_timeout(map, PAGE2_GPIO_H, status,
status & PS_GPIO9, 20000, wait_us);
/*
* The first time we see HPD go high after a reset we delay an extra
* 50 ms. The best guess is that the MCU is doing "stuff" during this
* time (maybe talking to the panel) and we don't want to interrupt it.
*
* No locking is done around "need_post_hpd_delay". If we're here we
* know we're holding a PM Runtime reference and the only other place
* that touches this is PM Runtime resume.
*/
if (!ret && ps_bridge->need_post_hpd_delay) {
ps_bridge->need_post_hpd_delay = false;
msleep(50);
}
return ret;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/err.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/module.h`, `linux/of_graph.h`, `linux/pm_runtime.h`, `linux/regmap.h`.
- Detected declarations: `struct ps8640`, `enum page_addr_offset`, `enum ps8640_vdo_control`, `function _ps8640_wait_hpd_asserted`, `function time`, `function ps8640_wait_hpd_asserted`, `function ps8640_aux_transfer_msg`, `function ps8640_aux_transfer`, `function ps8640_bridge_vdo_control`, `function ps8640_resume`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.