drivers/gpu/drm/bridge/ssd2825.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/ssd2825.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/ssd2825.c- Extension
.c- Size
- 21480 bytes
- Lines
- 776
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/delay.hlinux/device.hlinux/err.hlinux/kernel.hlinux/module.hlinux/mod_devicetable.hlinux/mutex.hlinux/of.hlinux/regulator/consumer.hlinux/spi/spi.hlinux/units.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_drv.hdrm/drm_mipi_dsi.hdrm/drm_of.hdrm/drm_panel.hvideo/mipi_display.h
Detected Declarations
struct ssd2825_dsi_outputstruct ssd2825_privfunction ssd2825_write_rawfunction ssd2825_write_regfunction ssd2825_write_dsifunction ssd2825_read_rawfunction ssd2825_read_regfunction ssd2825_dsi_host_attachfunction Videofunction ssd2825_dsi_host_detachfunction ssd2825_dsi_host_transferfunction ssd2825_hw_resetfunction construct_pll_configfunction ssd2825_setup_pllfunction ssd2825_bridge_atomic_pre_enablefunction ssd2825_bridge_atomic_enablefunction ssd2825_bridge_atomic_disablefunction ssd2825_bridge_attachfunction ssd2825_bridge_mode_validfunction ssd2825_mode_fixupfunction ssd2825_probefunction ssd2825_remove
Annotated Snippet
struct ssd2825_dsi_output {
struct mipi_dsi_device *dev;
struct drm_panel *panel;
struct drm_bridge *bridge;
};
struct ssd2825_priv {
struct spi_device *spi;
struct device *dev;
struct gpio_desc *reset_gpio;
struct regulator_bulk_data *supplies;
struct clk *tx_clk;
struct mipi_dsi_host dsi_host;
struct drm_bridge bridge;
struct ssd2825_dsi_output output;
struct mutex mlock; /* for host transfer operations */
u32 pd_lines; /* number of Parallel Port Input Data Lines */
u32 dsi_lanes; /* number of DSI Lanes */
/* Parameters for PLL programming */
u32 pll_freq_kbps; /* PLL in kbps */
u32 nibble_freq_khz; /* PLL div by 4 */
u32 hzd; /* HS Zero Delay in ns*/
u32 hpd; /* HS Prepare Delay is ns */
};
static inline struct ssd2825_priv *dsi_host_to_ssd2825(struct mipi_dsi_host *host)
{
return container_of(host, struct ssd2825_priv, dsi_host);
}
static inline struct ssd2825_priv *bridge_to_ssd2825(struct drm_bridge *bridge)
{
return container_of(bridge, struct ssd2825_priv, bridge);
}
static int ssd2825_write_raw(struct ssd2825_priv *priv, u8 high_byte, u8 low_byte)
{
struct spi_device *spi = priv->spi;
u8 tx_buf[2];
/*
* Low byte is the value, high byte defines type of
* write cycle, 0 for command and 1 for data.
*/
tx_buf[0] = low_byte;
tx_buf[1] = high_byte;
return spi_write(spi, tx_buf, 2);
}
static int ssd2825_write_reg(struct ssd2825_priv *priv, u8 reg, u16 command)
{
u8 datal = (command & 0x00FF);
u8 datah = (command & 0xFF00) >> 8;
int ret;
/* Command write cycle */
ret = ssd2825_write_raw(priv, SSD2825_COM_BYTE, reg);
if (ret)
return ret;
/* Data write cycle bits 7-0 */
ret = ssd2825_write_raw(priv, SSD2825_DAT_BYTE, datal);
if (ret)
return ret;
/* Data write cycle bits 15-8 */
ret = ssd2825_write_raw(priv, SSD2825_DAT_BYTE, datah);
if (ret)
return ret;
return 0;
}
static int ssd2825_write_dsi(struct ssd2825_priv *priv, const u8 *command, int len)
{
int ret, i;
ret = ssd2825_write_reg(priv, SSD2825_PACKET_SIZE_CTRL_REG_1, len);
if (ret)
return ret;
ret = ssd2825_write_raw(priv, SSD2825_COM_BYTE, SSD2825_PACKET_DROP_REG);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/device.h`, `linux/err.h`, `linux/kernel.h`, `linux/module.h`, `linux/mod_devicetable.h`, `linux/mutex.h`.
- Detected declarations: `struct ssd2825_dsi_output`, `struct ssd2825_priv`, `function ssd2825_write_raw`, `function ssd2825_write_reg`, `function ssd2825_write_dsi`, `function ssd2825_read_raw`, `function ssd2825_read_reg`, `function ssd2825_dsi_host_attach`, `function Video`, `function ssd2825_dsi_host_detach`.
- 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.