drivers/gpu/drm/panel/panel-sony-td4353-jdi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-sony-td4353-jdi.c- Extension
.c- Size
- 7137 bytes
- Lines
- 260
- 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/delay.hlinux/gpio/consumer.hlinux/module.hlinux/of.hlinux/regulator/consumer.hvideo/mipi_display.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.h
Detected Declarations
struct sony_td4353_jdifunction sony_td4353_jdi_onfunction sony_td4353_jdi_offfunction sony_td4353_assert_reset_gpiosfunction sony_td4353_jdi_preparefunction sony_td4353_jdi_unpreparefunction sony_td4353_jdi_get_modesfunction sony_td4353_jdi_probefunction sony_td4353_jdi_remove
Annotated Snippet
struct sony_td4353_jdi {
struct drm_panel panel;
struct mipi_dsi_device *dsi;
struct regulator_bulk_data supplies[3];
struct gpio_desc *panel_reset_gpio;
struct gpio_desc *touch_reset_gpio;
int type;
};
static inline struct sony_td4353_jdi *to_sony_td4353_jdi(struct drm_panel *panel)
{
return container_of(panel, struct sony_td4353_jdi, panel);
}
static int sony_td4353_jdi_on(struct sony_td4353_jdi *ctx)
{
struct mipi_dsi_device *dsi = ctx->dsi;
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
dsi->mode_flags |= MIPI_DSI_MODE_LPM;
mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0x0000, 1080 - 1);
mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0x0000, 2160 - 1);
mipi_dsi_dcs_set_tear_scanline_multi(&dsi_ctx, 0);
mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_SET_ADDRESS_MODE, 0x00);
mipi_dsi_dcs_set_pixel_format_multi(&dsi_ctx, 0x77);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_SET_PARTIAL_ROWS,
0x00, 0x00, 0x08, 0x6f);
mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 70);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_MEMORY_START);
mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
return dsi_ctx.accum_err;
}
static void sony_td4353_jdi_off(struct sony_td4353_jdi *ctx)
{
struct mipi_dsi_device *dsi = ctx->dsi;
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 22);
mipi_dsi_dcs_set_tear_off_multi(&dsi_ctx);
mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 80);
}
static void sony_td4353_assert_reset_gpios(struct sony_td4353_jdi *ctx, int mode)
{
gpiod_set_value_cansleep(ctx->touch_reset_gpio, mode);
gpiod_set_value_cansleep(ctx->panel_reset_gpio, mode);
usleep_range(5000, 5100);
}
static int sony_td4353_jdi_prepare(struct drm_panel *panel)
{
struct sony_td4353_jdi *ctx = to_sony_td4353_jdi(panel);
int ret;
ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
if (ret < 0)
return ret;
msleep(100);
sony_td4353_assert_reset_gpios(ctx, 1);
ret = sony_td4353_jdi_on(ctx);
if (ret < 0) {
sony_td4353_assert_reset_gpios(ctx, 0);
regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
return ret;
}
return 0;
}
static int sony_td4353_jdi_unprepare(struct drm_panel *panel)
{
struct sony_td4353_jdi *ctx = to_sony_td4353_jdi(panel);
sony_td4353_jdi_off(ctx);
sony_td4353_assert_reset_gpios(ctx, 0);
Annotation
- Immediate include surface: `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `video/mipi_display.h`, `drm/drm_mipi_dsi.h`, `drm/drm_modes.h`.
- Detected declarations: `struct sony_td4353_jdi`, `function sony_td4353_jdi_on`, `function sony_td4353_jdi_off`, `function sony_td4353_assert_reset_gpios`, `function sony_td4353_jdi_prepare`, `function sony_td4353_jdi_unprepare`, `function sony_td4353_jdi_get_modes`, `function sony_td4353_jdi_probe`, `function sony_td4353_jdi_remove`.
- 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.