drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c- Extension
.c- Size
- 14209 bytes
- Lines
- 550
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/component.hlinux/mfd/syscon.hlinux/of.hlinux/of_graph.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hlinux/reset.hlinux/clk.hvideo/of_videomode.hvideo/videomode.hdrm/display/drm_dp_helper.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_bridge_connector.hdrm/bridge/analogix_dp.hdrm/drm_of.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/drm_simple_kms_helper.hrockchip_drm_drv.h
Detected Declarations
struct rockchip_grf_reg_fieldstruct rockchip_dp_chip_datastruct rockchip_dp_devicefunction DPfunction rockchip_grf_writefunction rockchip_grf_field_writefunction rockchip_dp_pre_initfunction rockchip_dp_poweronfunction rockchip_dp_powerdownfunction rockchip_dp_drm_encoder_mode_fixupfunction rockchip_dp_drm_encoder_mode_setfunction rockchip_dp_drm_encoder_enablefunction rockchip_dp_drm_encoder_disablefunction rockchip_dp_drm_encoder_atomic_checkfunction rockchip_dp_of_probefunction rockchip_dp_drm_create_encoderfunction rockchip_dp_bindfunction rockchip_dp_unbindfunction rockchip_dp_probefunction rockchip_dp_removefunction rockchip_dp_suspendfunction rockchip_dp_resume
Annotated Snippet
struct rockchip_grf_reg_field {
u32 reg;
u32 lsb;
u32 msb;
bool valid;
};
/**
* struct rockchip_dp_chip_data - splite the grf setting of kind of chips
* @lcdc_sel: grf register field of lcdc_sel
* @edp_mode: grf register field of edp_mode
* @chip_type: specific chip type
* @reg: register base address
*/
struct rockchip_dp_chip_data {
const struct rockchip_grf_reg_field lcdc_sel;
const struct rockchip_grf_reg_field edp_mode;
u32 chip_type;
u32 reg;
};
struct rockchip_dp_device {
struct drm_device *drm_dev;
struct device *dev;
struct rockchip_encoder encoder;
struct drm_display_mode mode;
struct clk *pclk;
struct clk *grfclk;
struct regmap *grf;
struct reset_control *rst;
struct reset_control *apbrst;
const struct rockchip_dp_chip_data *data;
struct analogix_dp_device *adp;
struct analogix_dp_plat_data plat_data;
};
static struct rockchip_dp_device *encoder_to_dp(struct drm_encoder *encoder)
{
struct rockchip_encoder *rkencoder = to_rockchip_encoder(encoder);
return container_of(rkencoder, struct rockchip_dp_device, encoder);
}
static struct rockchip_dp_device *pdata_encoder_to_dp(struct analogix_dp_plat_data *plat_data)
{
return container_of(plat_data, struct rockchip_dp_device, plat_data);
}
static int rockchip_grf_write(struct regmap *grf, u32 reg, u32 mask, u32 val)
{
return regmap_write(grf, reg, (mask << 16) | (val & mask));
}
static int rockchip_grf_field_write(struct regmap *grf,
const struct rockchip_grf_reg_field *field,
u32 val)
{
u32 mask;
if (!field->valid)
return 0;
mask = GENMASK(field->msb, field->lsb);
val <<= field->lsb;
return rockchip_grf_write(grf, field->reg, mask, val);
}
static int rockchip_dp_pre_init(struct rockchip_dp_device *dp)
{
reset_control_assert(dp->rst);
usleep_range(10, 20);
reset_control_deassert(dp->rst);
reset_control_assert(dp->apbrst);
usleep_range(10, 20);
reset_control_deassert(dp->apbrst);
return 0;
}
static int rockchip_dp_poweron(struct analogix_dp_plat_data *plat_data)
{
struct rockchip_dp_device *dp = pdata_encoder_to_dp(plat_data);
int ret;
ret = clk_prepare_enable(dp->pclk);
Annotation
- Immediate include surface: `linux/component.h`, `linux/mfd/syscon.h`, `linux/of.h`, `linux/of_graph.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `linux/regmap.h`, `linux/reset.h`.
- Detected declarations: `struct rockchip_grf_reg_field`, `struct rockchip_dp_chip_data`, `struct rockchip_dp_device`, `function DP`, `function rockchip_grf_write`, `function rockchip_grf_field_write`, `function rockchip_dp_pre_init`, `function rockchip_dp_poweron`, `function rockchip_dp_powerdown`, `function rockchip_dp_drm_encoder_mode_fixup`.
- 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.