Re: [PATCH v2 1/2] clk: qcom: gdsc: add LEGACY_FOOTSWITCH support for MSM8x60

From: Konrad Dybcio

Date: Mon Jun 08 2026 - 05:28:37 EST


On 6/6/26 5:17 PM, Dmitry Baryshkov wrote:
> 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).

Yes please, gdsc.c is already a bit convoluted..

Konrad