drivers/gpu/drm/tegra/dpaux.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tegra/dpaux.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tegra/dpaux.c- Extension
.c- Size
- 19089 bytes
- Lines
- 823
- 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.
- 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/clk.hlinux/delay.hlinux/interrupt.hlinux/io.hlinux/module.hlinux/of.hlinux/pinctrl/pinconf-generic.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.hlinux/platform_device.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/reset.hlinux/workqueue.hdrm/display/drm_dp_helper.hdrm/display/drm_dp_aux_bus.hdrm/drm_panel.hdp.hdpaux.hdrm.htrace.h
Detected Declarations
struct tegra_dpaux_socstruct tegra_dpauxenum tegra_dpaux_functionsfunction tegra_dpaux_readlfunction tegra_dpaux_writelfunction tegra_dpaux_write_fifofunction tegra_dpaux_read_fifofunction tegra_dpaux_transferfunction tegra_dpaux_hotplugfunction tegra_dpaux_irqfunction tegra_dpaux_pad_power_downfunction tegra_dpaux_pad_power_upfunction tegra_dpaux_pad_configfunction tegra_dpaux_get_groups_countfunction tegra_dpaux_get_group_pinsfunction tegra_dpaux_get_functions_countfunction tegra_dpaux_get_function_groupsfunction tegra_dpaux_set_muxfunction tegra_dpaux_probefunction tegra_dpaux_removefunction tegra_dpaux_suspendfunction tegra_dpaux_resumefunction list_for_each_entryfunction drm_dp_aux_attachfunction drm_dp_aux_detachfunction drm_dp_aux_detectfunction drm_dp_aux_enablefunction drm_dp_aux_disable
Annotated Snippet
struct tegra_dpaux_soc {
unsigned int cmh;
unsigned int drvz;
unsigned int drvi;
};
struct tegra_dpaux {
struct drm_dp_aux aux;
struct device *dev;
const struct tegra_dpaux_soc *soc;
void __iomem *regs;
int irq;
struct tegra_output *output;
struct reset_control *rst;
struct clk *clk_parent;
struct clk *clk;
struct regulator *vdd;
struct completion complete;
struct work_struct work;
struct list_head list;
#ifdef CONFIG_GENERIC_PINCONF
struct pinctrl_dev *pinctrl;
struct pinctrl_desc desc;
#endif
};
static inline struct tegra_dpaux *to_dpaux(struct drm_dp_aux *aux)
{
return container_of(aux, struct tegra_dpaux, aux);
}
static inline struct tegra_dpaux *work_to_dpaux(struct work_struct *work)
{
return container_of(work, struct tegra_dpaux, work);
}
static inline u32 tegra_dpaux_readl(struct tegra_dpaux *dpaux,
unsigned int offset)
{
u32 value = readl(dpaux->regs + (offset << 2));
trace_dpaux_readl(dpaux->dev, offset, value);
return value;
}
static inline void tegra_dpaux_writel(struct tegra_dpaux *dpaux,
u32 value, unsigned int offset)
{
trace_dpaux_writel(dpaux->dev, offset, value);
writel(value, dpaux->regs + (offset << 2));
}
static void tegra_dpaux_write_fifo(struct tegra_dpaux *dpaux, const u8 *buffer,
size_t size)
{
size_t i, j;
for (i = 0; i < DIV_ROUND_UP(size, 4); i++) {
size_t num = min_t(size_t, size - i * 4, 4);
u32 value = 0;
for (j = 0; j < num; j++)
value |= buffer[i * 4 + j] << (j * 8);
tegra_dpaux_writel(dpaux, value, DPAUX_DP_AUXDATA_WRITE(i));
}
}
static void tegra_dpaux_read_fifo(struct tegra_dpaux *dpaux, u8 *buffer,
size_t size)
{
size_t i, j;
for (i = 0; i < DIV_ROUND_UP(size, 4); i++) {
size_t num = min_t(size_t, size - i * 4, 4);
u32 value;
value = tegra_dpaux_readl(dpaux, DPAUX_DP_AUXDATA_READ(i));
for (j = 0; j < num; j++)
buffer[i * 4 + j] = value >> (j * 8);
}
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/interrupt.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/pinctrl/pinconf-generic.h`, `linux/pinctrl/pinctrl.h`.
- Detected declarations: `struct tegra_dpaux_soc`, `struct tegra_dpaux`, `enum tegra_dpaux_functions`, `function tegra_dpaux_readl`, `function tegra_dpaux_writel`, `function tegra_dpaux_write_fifo`, `function tegra_dpaux_read_fifo`, `function tegra_dpaux_transfer`, `function tegra_dpaux_hotplug`, `function tegra_dpaux_irq`.
- 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.