drivers/gpu/drm/gma500/cdv_intel_dp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/gma500/cdv_intel_dp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/gma500/cdv_intel_dp.c- Extension
.c- Size
- 56727 bytes
- Lines
- 2095
- 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.
- 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/i2c.hlinux/module.hlinux/slab.hdrm/display/drm_dp_helper.hdrm/drm_crtc.hdrm/drm_crtc_helper.hdrm/drm_edid.hdrm/drm_modeset_helper_vtables.hdrm/drm_print.hdrm/drm_simple_kms_helper.hgma_display.hpsb_drv.hpsb_intel_drv.hpsb_intel_reg.h
Detected Declarations
struct i2c_algo_dp_aux_datastruct cdv_intel_dpstruct ddi_regoffstruct cdv_intel_dp_m_nfunction i2c_algo_dp_aux_transactionfunction readfunction i2c_algo_dp_aux_stopfunction i2c_algo_dp_aux_put_bytefunction i2c_algo_dp_aux_get_bytefunction i2c_algo_dp_aux_xferfunction i2c_algo_dp_aux_functionalityfunction i2c_dp_aux_reset_busfunction i2c_dp_aux_prepare_busfunction i2c_dp_aux_add_busfunction is_edpfunction cdv_intel_dp_max_lane_countfunction cdv_intel_dp_max_link_bwfunction cdv_intel_dp_link_clockfunction cdv_intel_dp_link_requiredfunction cdv_intel_dp_max_data_ratefunction cdv_intel_edp_panel_vdd_onfunction cdv_intel_edp_panel_vdd_offfunction cdv_intel_edp_panel_onfunction cdv_intel_edp_panel_offfunction cdv_intel_edp_backlight_onfunction cdv_intel_edp_backlight_offfunction cdv_intel_dp_mode_validfunction pack_auxfunction unpack_auxfunction cdv_intel_dp_aux_chfunction cdv_intel_dp_aux_native_writefunction cdv_intel_dp_aux_native_write_1function cdv_intel_dp_aux_native_readfunction cdv_intel_dp_i2c_aux_chfunction cdv_intel_dp_i2c_initfunction cdv_intel_fixed_panel_modefunction cdv_intel_dp_mode_fixupfunction cdv_intel_reduce_ratiofunction cdv_intel_dp_compute_m_nfunction cdv_intel_dp_set_m_nfunction cdv_intel_dp_mode_setfunction cdv_intel_dp_sink_dpmsfunction cdv_intel_dp_preparefunction cdv_intel_dp_commitfunction cdv_intel_dp_dpmsfunction cdv_intel_dp_aux_native_read_retryfunction cdv_intel_dp_get_link_statusfunction cdv_intel_dp_link_status
Annotated Snippet
struct i2c_algo_dp_aux_data {
bool running;
u16 address;
int (*aux_ch) (struct i2c_adapter *adapter,
int mode, uint8_t write_byte,
uint8_t *read_byte);
};
/* Run a single AUX_CH I2C transaction, writing/reading data as necessary */
static int
i2c_algo_dp_aux_transaction(struct i2c_adapter *adapter, int mode,
uint8_t write_byte, uint8_t *read_byte)
{
struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
int ret;
ret = (*algo_data->aux_ch)(adapter, mode,
write_byte, read_byte);
return ret;
}
/*
* I2C over AUX CH
*/
/*
* Send the address. If the I2C link is running, this 'restarts'
* the connection with the new address, this is used for doing
* a write followed by a read (as needed for DDC)
*/
static int
i2c_algo_dp_aux_address(struct i2c_adapter *adapter, u16 address, bool reading)
{
struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
int mode = MODE_I2C_START;
if (reading)
mode |= MODE_I2C_READ;
else
mode |= MODE_I2C_WRITE;
algo_data->address = address;
algo_data->running = true;
return i2c_algo_dp_aux_transaction(adapter, mode, 0, NULL);
}
/*
* Stop the I2C transaction. This closes out the link, sending
* a bare address packet with the MOT bit turned off
*/
static void
i2c_algo_dp_aux_stop(struct i2c_adapter *adapter, bool reading)
{
struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
int mode = MODE_I2C_STOP;
if (reading)
mode |= MODE_I2C_READ;
else
mode |= MODE_I2C_WRITE;
if (algo_data->running) {
(void) i2c_algo_dp_aux_transaction(adapter, mode, 0, NULL);
algo_data->running = false;
}
}
/*
* Write a single byte to the current I2C address, the
* I2C link must be running or this returns -EIO
*/
static int
i2c_algo_dp_aux_put_byte(struct i2c_adapter *adapter, u8 byte)
{
struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
if (!algo_data->running)
return -EIO;
return i2c_algo_dp_aux_transaction(adapter, MODE_I2C_WRITE, byte, NULL);
}
/*
* Read a single byte from the current I2C address, the
* I2C link must be running or this returns -EIO
*/
static int
i2c_algo_dp_aux_get_byte(struct i2c_adapter *adapter, u8 *byte_ret)
{
struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
if (!algo_data->running)
Annotation
- Immediate include surface: `linux/i2c.h`, `linux/module.h`, `linux/slab.h`, `drm/display/drm_dp_helper.h`, `drm/drm_crtc.h`, `drm/drm_crtc_helper.h`, `drm/drm_edid.h`, `drm/drm_modeset_helper_vtables.h`.
- Detected declarations: `struct i2c_algo_dp_aux_data`, `struct cdv_intel_dp`, `struct ddi_regoff`, `struct cdv_intel_dp_m_n`, `function i2c_algo_dp_aux_transaction`, `function read`, `function i2c_algo_dp_aux_stop`, `function i2c_algo_dp_aux_put_byte`, `function i2c_algo_dp_aux_get_byte`, `function i2c_algo_dp_aux_xfer`.
- 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.