drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c- Extension
.c- Size
- 32592 bytes
- Lines
- 1360
- 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.
- 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/err.hlinux/gpio/consumer.hlinux/i2c.hlinux/interrupt.hlinux/kernel.hlinux/module.hlinux/of_irq.hlinux/of_platform.hlinux/regmap.hlinux/regulator/consumer.hlinux/types.hdrm/display/drm_dp_helper.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_crtc.hdrm/drm_edid.hdrm/drm_print.hdrm/drm_probe_helper.hanalogix-anx78xx.h
Detected Declarations
struct anx78xx_platform_datastruct anx78xxfunction anx78xx_set_bitsfunction anx78xx_clear_bitsfunction anx78xx_aux_transferfunction anx78xx_set_hpdfunction anx78xx_clear_hpdfunction anx78xx_rx_initializationfunction anx78xx_link_phy_initializationfunction anx78xx_xtal_clk_selfunction anx78xx_tx_initializationfunction anx78xx_enable_interruptsfunction anx78xx_poweronfunction anx78xx_powerofffunction anx78xx_startfunction anx78xx_init_pdatafunction anx78xx_dp_link_trainingfunction anx78xx_config_dp_outputfunction anx78xx_send_video_infoframefunction anx78xx_get_downstream_infofunction anx78xx_get_modesfunction anx78xx_detectfunction anx78xx_bridge_attachfunction anx78xx_bridge_detachfunction anx78xx_bridge_mode_validfunction anx78xx_bridge_disablefunction anx78xx_bridge_mode_setfunction anx78xx_bridge_enablefunction anx78xx_hpd_threaded_handlerfunction anx78xx_handle_dp_int_1function anx78xx_handle_common_int_4function anx78xx_handle_hdmi_int_1function anx78xx_intp_threaded_handlerfunction unregister_i2c_dummy_clientsfunction anx78xx_i2c_probefunction anx78xx_i2c_remove
Annotated Snippet
struct anx78xx_platform_data {
struct regulator *dvdd10;
struct gpio_desc *gpiod_hpd;
struct gpio_desc *gpiod_pd;
struct gpio_desc *gpiod_reset;
int hpd_irq;
int intp_irq;
};
struct anx78xx {
struct drm_dp_aux aux;
struct drm_bridge bridge;
struct i2c_client *client;
const struct drm_edid *drm_edid;
struct drm_connector connector;
struct anx78xx_platform_data pdata;
struct mutex lock;
/*
* I2C Slave addresses of ANX7814 are mapped as TX_P0, TX_P1, TX_P2,
* RX_P0 and RX_P1.
*/
struct i2c_client *i2c_dummy[I2C_NUM_ADDRESSES];
struct regmap *map[I2C_NUM_ADDRESSES];
u16 chipid;
u8 dpcd[DP_RECEIVER_CAP_SIZE];
bool powered;
};
static inline struct anx78xx *connector_to_anx78xx(struct drm_connector *c)
{
return container_of(c, struct anx78xx, connector);
}
static inline struct anx78xx *bridge_to_anx78xx(struct drm_bridge *bridge)
{
return container_of(bridge, struct anx78xx, bridge);
}
static int anx78xx_set_bits(struct regmap *map, u8 reg, u8 mask)
{
return regmap_update_bits(map, reg, mask, mask);
}
static int anx78xx_clear_bits(struct regmap *map, u8 reg, u8 mask)
{
return regmap_update_bits(map, reg, mask, 0);
}
static ssize_t anx78xx_aux_transfer(struct drm_dp_aux *aux,
struct drm_dp_aux_msg *msg)
{
struct anx78xx *anx78xx = container_of(aux, struct anx78xx, aux);
return anx_dp_aux_transfer(anx78xx->map[I2C_IDX_TX_P0], msg);
}
static int anx78xx_set_hpd(struct anx78xx *anx78xx)
{
int err;
err = anx78xx_clear_bits(anx78xx->map[I2C_IDX_RX_P0],
SP_TMDS_CTRL_BASE + 7, SP_PD_RT);
if (err)
return err;
err = anx78xx_set_bits(anx78xx->map[I2C_IDX_TX_P2], SP_VID_CTRL3_REG,
SP_HPD_OUT);
if (err)
return err;
return 0;
}
static int anx78xx_clear_hpd(struct anx78xx *anx78xx)
{
int err;
err = anx78xx_clear_bits(anx78xx->map[I2C_IDX_TX_P2], SP_VID_CTRL3_REG,
SP_HPD_OUT);
if (err)
return err;
err = anx78xx_set_bits(anx78xx->map[I2C_IDX_RX_P0],
SP_TMDS_CTRL_BASE + 7, SP_PD_RT);
if (err)
return err;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/err.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/module.h`, `linux/of_irq.h`.
- Detected declarations: `struct anx78xx_platform_data`, `struct anx78xx`, `function anx78xx_set_bits`, `function anx78xx_clear_bits`, `function anx78xx_aux_transfer`, `function anx78xx_set_hpd`, `function anx78xx_clear_hpd`, `function anx78xx_rx_initialization`, `function anx78xx_link_phy_initialization`, `function anx78xx_xtal_clk_sel`.
- 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.
- 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.