]> Gentwo Git Trees - linux/.git/commit
drm/imagination: Use pwrseq for TH1520 GPU power management
authorMichal Wilczynski <m.wilczynski@samsung.com>
Thu, 21 Aug 2025 22:20:15 +0000 (00:20 +0200)
committerMatt Coster <matt.coster@imgtec.com>
Mon, 1 Sep 2025 11:11:00 +0000 (12:11 +0100)
commite38e8391f30b41c5a24bb46dc6ef4161921e782d
tree1cafb37d13fdd93e2e97cdd9d62b6d7cd8b133d2
parentcf87f93847dea607e8a35983cb006ef8493f8065
drm/imagination: Use pwrseq for TH1520 GPU power management

Update the Imagination PVR DRM driver to leverage the pwrseq framework
for managing the complex power sequence of the GPU on the T-HEAD TH1520
SoC.

To cleanly separate platform-specific logic from the generic driver,
this patch introduces an `init` callback to the `pwr_power_sequence_ops`
struct. This allows for different power management strategies to be
selected at probe time based on the device's compatible string.

A `pvr_device_data` struct, associated with each compatible in the
of_device_id table, points to the appropriate ops table (manual or
pwrseq).

At probe time, the driver now calls the `->init()` op. For pwrseq-based
platforms, this callback calls `devm_pwrseq_get("gpu-power")`, deferring
probe if the sequencer is not yet available. For other platforms, it
falls back to the existing manual clock and reset handling. The runtime
PM callbacks continue to call the appropriate functions via the ops
table.

Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Link: https://lore.kernel.org/r/20250822-apr_14_for_sending-v13-1-af656f7cc6c3@samsung.com
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
drivers/gpu/drm/imagination/pvr_device.c
drivers/gpu/drm/imagination/pvr_device.h
drivers/gpu/drm/imagination/pvr_drv.c
drivers/gpu/drm/imagination/pvr_power.c
drivers/gpu/drm/imagination/pvr_power.h