drivers/gpu/drm/bridge/inno-hdmi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/inno-hdmi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/inno-hdmi.c- Extension
.c- Size
- 31008 bytes
- Lines
- 1142
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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.
- 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/irq.hlinux/clk.hlinux/delay.hlinux/err.hlinux/i2c.hlinux/hdmi.hlinux/mfd/syscon.hlinux/mod_devicetable.hlinux/module.hlinux/mutex.hlinux/platform_device.hlinux/regmap.hdrm/bridge/inno_hdmi.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_edid.hdrm/drm_of.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/drm_simple_kms_helper.hdrm/display/drm_hdmi_helper.hdrm/display/drm_hdmi_state_helper.h
Detected Declarations
struct inno_hdmi_i2cstruct inno_hdmifunction inno_hdmi_find_phy_configfunction hdmi_readbfunction hdmi_writebfunction hdmi_modbfunction inno_hdmi_i2c_initfunction inno_hdmi_sys_powerfunction inno_hdmi_standbyfunction inno_hdmi_power_upfunction inno_hdmi_init_hwfunction inno_hdmi_bridge_clear_avi_infoframefunction inno_hdmi_bridge_write_avi_infoframefunction inno_hdmi_bridge_clear_hdmi_infoframefunction inno_hdmi_bridge_write_hdmi_infoframefunction inno_hdmi_config_video_cscfunction inno_hdmi_config_video_timingfunction inno_hdmi_setupfunction inno_hdmi_bridge_mode_validfunction inno_hdmi_bridge_detectfunction inno_hdmi_bridge_edid_readfunction inno_hdmi_bridge_atomic_enablefunction inno_hdmi_bridge_atomic_disablefunction inno_hdmi_i2c_irqfunction inno_hdmi_hardirqfunction inno_hdmi_irqfunction inno_hdmi_i2c_readfunction inno_hdmi_i2c_writefunction inno_hdmi_i2c_xferfunction inno_hdmi_i2c_funcexport inno_hdmi_bind
Annotated Snippet
struct inno_hdmi_i2c {
struct i2c_adapter adap;
u8 ddc_addr;
u8 segment_addr;
struct mutex lock;
struct completion cmp;
};
struct inno_hdmi {
struct device *dev;
struct drm_bridge bridge;
struct clk *pclk;
struct clk *refclk;
void __iomem *regs;
struct regmap *grf;
struct inno_hdmi_i2c *i2c;
struct i2c_adapter *ddc;
const struct inno_hdmi_plat_data *plat_data;
};
enum {
CSC_RGB_0_255_TO_ITU601_16_235_8BIT,
CSC_RGB_0_255_TO_ITU709_16_235_8BIT,
CSC_RGB_0_255_TO_RGB_16_235_8BIT,
};
static const char coeff_csc[][24] = {
/*
* RGB2YUV:601 SD mode:
* Cb = -0.291G - 0.148R + 0.439B + 128
* Y = 0.504G + 0.257R + 0.098B + 16
* Cr = -0.368G + 0.439R - 0.071B + 128
*/
{
0x11, 0x5f, 0x01, 0x82, 0x10, 0x23, 0x00, 0x80,
0x02, 0x1c, 0x00, 0xa1, 0x00, 0x36, 0x00, 0x1e,
0x11, 0x29, 0x10, 0x59, 0x01, 0x82, 0x00, 0x80
},
/*
* RGB2YUV:709 HD mode:
* Cb = - 0.338G - 0.101R + 0.439B + 128
* Y = 0.614G + 0.183R + 0.062B + 16
* Cr = - 0.399G + 0.439R - 0.040B + 128
*/
{
0x11, 0x98, 0x01, 0xc1, 0x10, 0x28, 0x00, 0x80,
0x02, 0x74, 0x00, 0xbb, 0x00, 0x3f, 0x00, 0x10,
0x11, 0x5a, 0x10, 0x67, 0x01, 0xc1, 0x00, 0x80
},
/*
* RGB[0:255]2RGB[16:235]:
* R' = R x (235-16)/255 + 16;
* G' = G x (235-16)/255 + 16;
* B' = B x (235-16)/255 + 16;
*/
{
0x00, 0x00, 0x03, 0x6F, 0x00, 0x00, 0x00, 0x10,
0x03, 0x6F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
0x00, 0x00, 0x00, 0x00, 0x03, 0x6F, 0x00, 0x10
},
};
static struct inno_hdmi *bridge_to_inno_hdmi(struct drm_bridge *bridge)
{
return container_of(bridge, struct inno_hdmi, bridge);
}
static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi,
unsigned long pixelclk)
{
const struct inno_hdmi_phy_config *phy_configs = hdmi->plat_data->phy_configs;
int i;
for (i = 0; phy_configs[i].pixelclock != ~0UL; i++) {
if (pixelclk <= phy_configs[i].pixelclock)
return i;
}
DRM_DEV_DEBUG(hdmi->dev, "No phy configuration for pixelclock %lu\n",
pixelclk);
return -EINVAL;
}
static inline u8 hdmi_readb(struct inno_hdmi *hdmi, u16 offset)
{
return readl_relaxed(hdmi->regs + (offset) * 0x04);
Annotation
- Immediate include surface: `linux/irq.h`, `linux/clk.h`, `linux/delay.h`, `linux/err.h`, `linux/i2c.h`, `linux/hdmi.h`, `linux/mfd/syscon.h`, `linux/mod_devicetable.h`.
- Detected declarations: `struct inno_hdmi_i2c`, `struct inno_hdmi`, `function inno_hdmi_find_phy_config`, `function hdmi_readb`, `function hdmi_writeb`, `function hdmi_modb`, `function inno_hdmi_i2c_init`, `function inno_hdmi_sys_power`, `function inno_hdmi_standby`, `function inno_hdmi_power_up`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration 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.