drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c- Extension
.c- Size
- 26949 bytes
- Lines
- 1290
- Domain
- Driver Families
- Bucket
- drivers/video
- 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/backlight.hlinux/delay.hlinux/err.hlinux/fb.hlinux/gpio/consumer.hlinux/interrupt.hlinux/jiffies.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/sched/signal.hlinux/slab.hlinux/workqueue.hvideo/omapfb_dss.hvideo/mipi_display.h
Detected Declarations
struct panel_drv_datafunction hw_guard_startfunction hw_guard_waitfunction dsicm_dcs_read_1function dsicm_dcs_write_0function dsicm_dcs_write_1function dsicm_sleep_infunction dsicm_sleep_outfunction dsicm_get_idfunction dsicm_set_update_windowfunction dsicm_queue_ulps_workfunction dsicm_cancel_ulps_workfunction dsicm_enter_ulpsfunction dsicm_exit_ulpsfunction dsicm_wake_upfunction dsicm_bl_update_statusfunction dsicm_bl_get_intensityfunction dsicm_get_resolutionfunction dsicm_num_errors_showfunction dsicm_hw_revision_showfunction dsicm_store_ulpsfunction dsicm_show_ulpsfunction dsicm_store_ulps_timeoutfunction dsicm_show_ulps_timeoutfunction dsicm_hw_resetfunction dsicm_power_onfunction dsicm_power_offfunction dsicm_panel_resetfunction dsicm_connectfunction dsicm_disconnectfunction dsicm_enablefunction dsicm_disablefunction dsicm_framedone_cbfunction dsicm_te_isrfunction dsicm_te_timeout_work_callbackfunction dsicm_updatefunction dsicm_syncfunction _dsicm_enable_tefunction dsicm_enable_tefunction dsicm_get_tefunction dsicm_memory_readfunction dsicm_ulps_workfunction dsicm_probefunction dsicm_remove
Annotated Snippet
struct panel_drv_data {
struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct omap_video_timings timings;
struct platform_device *pdev;
struct mutex lock;
struct backlight_device *bldev;
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 */
/* panel HW configuration from DT or platform data */
struct gpio_desc *reset_gpio;
struct gpio_desc *ext_te_gpio;
bool use_dsi_backlight;
struct omap_dsi_pin_config pin_config;
/* runtime variables */
bool enabled;
bool te_enabled;
atomic_t do_update;
int channel;
struct delayed_work te_timeout_work;
bool intro_printed;
bool ulps_enabled;
unsigned ulps_timeout;
struct delayed_work ulps_work;
};
#define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)
static irqreturn_t dsicm_te_isr(int irq, void *data);
static void dsicm_te_timeout_work_callback(struct work_struct *work);
static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable);
static int dsicm_panel_reset(struct panel_drv_data *ddata);
static void dsicm_ulps_work(struct work_struct *work);
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 && time_before_eq(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)
{
struct omap_dss_device *in = ddata->in;
int r;
u8 buf[1];
r = in->ops.dsi->dcs_read(in, ddata->channel, dcs_cmd, buf, 1);
if (r < 0)
return r;
*data = buf[0];
return 0;
}
static int dsicm_dcs_write_0(struct panel_drv_data *ddata, u8 dcs_cmd)
{
struct omap_dss_device *in = ddata->in;
return in->ops.dsi->dcs_write(in, ddata->channel, &dcs_cmd, 1);
}
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/delay.h`, `linux/err.h`, `linux/fb.h`, `linux/gpio/consumer.h`, `linux/interrupt.h`, `linux/jiffies.h`, `linux/mod_devicetable.h`.
- Detected declarations: `struct panel_drv_data`, `function hw_guard_start`, `function hw_guard_wait`, `function dsicm_dcs_read_1`, `function dsicm_dcs_write_0`, `function dsicm_dcs_write_1`, `function dsicm_sleep_in`, `function dsicm_sleep_out`, `function dsicm_get_id`, `function dsicm_set_update_window`.
- Atlas domain: Driver Families / drivers/video.
- 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.