drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c- Extension
.c- Size
- 12169 bytes
- Lines
- 478
- 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.
- 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/module.hlinux/of.hlinux/regulator/consumer.hvideo/mipi_display.hdrm/drm_crtc.hdrm/drm_mipi_dsi.hdrm/drm_panel.h
Detected Declarations
struct jdi_panelfunction jdi_wait_framesfunction jdi_panel_disablefunction jdi_panel_unpreparefunction jdi_setup_symmetrical_splitfunction jdi_write_dcdc_registersfunction jdi_panel_preparefunction jdi_panel_enablefunction jdi_panel_get_modesfunction jdi_panel_addfunction jdi_panel_delfunction jdi_panel_dsi_probefunction jdi_panel_dsi_removefunction jdi_panel_dsi_shutdown
Annotated Snippet
struct jdi_panel {
struct drm_panel base;
struct mipi_dsi_device *link1;
struct mipi_dsi_device *link2;
struct regulator *supply;
struct regulator *ddi_supply;
struct backlight_device *backlight;
struct gpio_desc *enable_gpio;
struct gpio_desc *reset_gpio;
const struct drm_display_mode *mode;
};
static inline struct jdi_panel *to_panel_jdi(struct drm_panel *panel)
{
return container_of(panel, struct jdi_panel, base);
}
static void jdi_wait_frames(struct jdi_panel *jdi, unsigned int frames)
{
unsigned int refresh = drm_mode_vrefresh(jdi->mode);
if (WARN_ON(frames > refresh))
return;
msleep(1000 / (refresh / frames));
}
static int jdi_panel_disable(struct drm_panel *panel)
{
struct jdi_panel *jdi = to_panel_jdi(panel);
backlight_disable(jdi->backlight);
jdi_wait_frames(jdi, 2);
return 0;
}
static int jdi_panel_unprepare(struct drm_panel *panel)
{
struct jdi_panel *jdi = to_panel_jdi(panel);
/*
* One context per panel since we'll continue trying to shut down the
* other panel even if one isn't responding.
*/
struct mipi_dsi_multi_context dsi_ctx1 = { .dsi = jdi->link1 };
struct mipi_dsi_multi_context dsi_ctx2 = { .dsi = jdi->link2 };
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx1);
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx2);
/* Specified by JDI @ 50ms, subject to change */
msleep(50);
/* Doesn't hurt to try sleep mode even if display off fails */
dsi_ctx1.accum_err = 0;
dsi_ctx2.accum_err = 0;
mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx1);
mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx2);
/* Specified by JDI @ 150ms, subject to change */
msleep(150);
gpiod_set_value(jdi->reset_gpio, 1);
/* T4 = 1ms */
usleep_range(1000, 3000);
gpiod_set_value(jdi->enable_gpio, 0);
/* T5 = 2ms */
usleep_range(2000, 4000);
regulator_disable(jdi->ddi_supply);
/* T6 = 2ms plus some time to discharge capacitors */
usleep_range(7000, 9000);
regulator_disable(jdi->supply);
/* Specified by JDI @ 20ms, subject to change */
msleep(20);
return 0;
}
static void jdi_setup_symmetrical_split(struct mipi_dsi_multi_context *dsi_ctx,
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `video/mipi_display.h`, `drm/drm_crtc.h`.
- Detected declarations: `struct jdi_panel`, `function jdi_wait_frames`, `function jdi_panel_disable`, `function jdi_panel_unprepare`, `function jdi_setup_symmetrical_split`, `function jdi_write_dcdc_registers`, `function jdi_panel_prepare`, `function jdi_panel_enable`, `function jdi_panel_get_modes`, `function jdi_panel_add`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.