Re: [PATCH v2 1/2] clk: qcom: gdsc: add LEGACY_FOOTSWITCH support for MSM8x60
From: Dmitry Baryshkov
Date: Sat Jun 06 2026 - 11:19:05 EST
On Sat, Jun 06, 2026 at 02:34:26PM +0200, Herman van Hazendonk wrote:
> The MSM8x60 family (MSM8260, MSM8660, APQ8060) ships an older
> footswitch (FS / "GFS") block that pre-dates the GDSC programming
> model the existing driver was designed around. Adding GDSC entries
> for that family's MMCC power domains needs the driver to understand
> the legacy register layout:
>
> - the CLAMP, ENABLE and RETENTION bits live in the main GDSCR
> register rather than in a separate clamp_io_ctrl;
> - there is no power-status bit, so software cannot poll for the
> transition completing and has to gate progress on a fixed
> udelay() after toggling ENABLE;
> - ENABLE is positive-logic (set to power up, clear to collapse)
> rather than the modern inverted SW_COLLAPSE semantics;
> - none of the modern wait-time / HW-trigger / SW-override fields
> are present, so gdsc_init() must skip the wait-config
> programming block entirely.
I think there are enough differences to mandate a separate footswitch.c
file. It can further be used by MMCC on MSM8960 and APQ8064 platforms.
It might result by some code duplication, but I think in the end it
would be easier to read (and it won't clobber the existing gdsc.c code).
Add footswitch_register() / unregister() functions and call them from
the common code. Make sure they are replaced with stubs if
CONFIG_QCOM_FOOTSWITCH is not selected.
>
> Introduce a LEGACY_FOOTSWITCH flag and the matching code paths in
> gdsc_check_status(), gdsc_update_collapse_bit(), gdsc_enable(),
> gdsc_disable() and gdsc_init(). The enable / disable sequences
> mirror what the downstream vendor footswitch driver did on these
> SoCs, with the regulator hand-off normally done by
> gdsc_toggle_logic() spliced in at the matching points so a legacy
> domain that has a parent regulator still gets voted up/down:
--
With best wishes
Dmitry