drivers/gpu/drm/panel/panel-dsi-cm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-dsi-cm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-dsi-cm.c- Extension
.c- Size
- 13959 bytes
- Lines
- 651
- 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/backlight.hlinux/delay.hlinux/gpio/consumer.hlinux/jiffies.hlinux/module.hlinux/of.hlinux/regulator/consumer.hdrm/drm_connector.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.hvideo/mipi_display.h
Detected Declarations
struct dsic_panel_datastruct panel_drv_datafunction dsicm_bl_powerfunction hw_guard_startfunction hw_guard_waitfunction dsicm_dcs_read_1function dsicm_dcs_write_1function dsicm_sleep_infunction dsicm_sleep_outfunction dsicm_get_idfunction dsicm_set_update_windowfunction dsicm_bl_update_statusfunction dsicm_bl_get_intensityfunction num_dsi_errors_showfunction hw_revision_showfunction dsicm_hw_resetfunction dsicm_power_onfunction dsicm_power_offfunction dsicm_preparefunction dsicm_enablefunction dsicm_unpreparefunction dsicm_disablefunction dsicm_get_modesfunction dsicm_probe_offunction dsicm_probefunction dsicm_remove
Annotated Snippet
struct dsic_panel_data {
u32 xres;
u32 yres;
u32 refresh;
u32 width_mm;
u32 height_mm;
u32 max_hs_rate;
u32 max_lp_rate;
bool te_support;
};
struct panel_drv_data {
struct mipi_dsi_device *dsi;
struct drm_panel panel;
struct drm_display_mode mode;
struct mutex lock;
struct backlight_device *bldev;
struct backlight_device *extbldev;
unsigned long hw_guard_end; /* next value of jiffies when we can
* issue the next sleep in/out command
*/
unsigned long hw_guard_wait; /* max guard time in jiffies */
const struct dsic_panel_data *panel_data;
struct gpio_desc *reset_gpio;
struct regulator_bulk_data supplies[DCS_REGULATOR_SUPPLY_NUM];
bool use_dsi_backlight;
/* runtime variables */
bool enabled;
bool intro_printed;
};
static inline struct panel_drv_data *panel_to_ddata(struct drm_panel *panel)
{
return container_of(panel, struct panel_drv_data, panel);
}
static void dsicm_bl_power(struct panel_drv_data *ddata, bool enable)
{
struct backlight_device *backlight;
if (ddata->bldev)
backlight = ddata->bldev;
else if (ddata->extbldev)
backlight = ddata->extbldev;
else
return;
if (enable)
backlight_enable(backlight);
else
backlight_disable(backlight);
}
static void hw_guard_start(struct panel_drv_data *ddata, int guard_msec)
{
ddata->hw_guard_wait = msecs_to_jiffies(guard_msec);
ddata->hw_guard_end = jiffies + ddata->hw_guard_wait;
}
static void hw_guard_wait(struct panel_drv_data *ddata)
{
unsigned long wait = ddata->hw_guard_end - jiffies;
if ((long)wait > 0 && wait <= ddata->hw_guard_wait) {
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(wait);
}
}
static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data)
{
return mipi_dsi_dcs_read(ddata->dsi, dcs_cmd, data, 1);
}
static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param)
{
return mipi_dsi_dcs_write(ddata->dsi, dcs_cmd, ¶m, 1);
}
static int dsicm_sleep_in(struct panel_drv_data *ddata)
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/jiffies.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `drm/drm_connector.h`.
- Detected declarations: `struct dsic_panel_data`, `struct panel_drv_data`, `function dsicm_bl_power`, `function hw_guard_start`, `function hw_guard_wait`, `function dsicm_dcs_read_1`, `function dsicm_dcs_write_1`, `function dsicm_sleep_in`, `function dsicm_sleep_out`, `function dsicm_get_id`.
- 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.