Re: [PATCH] i2c: designware: add reset control support in suspend/resume

From: Artem Shimko

Date: Wed Mar 11 2026 - 02:20:45 EST


Hi Andy,

Thank you for your review!

On Tue, Mar 10, 2026 at 10:22 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> Usually we try to avoid _adding_ ugly ifdeffery. Can you elaborate why the
> change is needed in the first place and why there is no better way to handle
> it?

The conditional compilation is needed because ACPI and DT platforms have
different requirements for system suspend/resume ordering: ACPI
platforms require LATE_SUSPEND/EARLY_RESUME
to support I2C operation regions, which may be accessed during
suspend/resume of other devices. DT platforms don't have
this requirement, but using LATE/EARLY callbacks causes problems
because the I2C controller's dependencies (reset controller,
clock controller) are not yet available at that stage, leading to hangs.

However, I agree that adding ifdefs is not ideal.

I have a couple ideas for v2, could you please advise which one is
better from your point of view?
1. Splitting PM ops into separate structures for ACPI and DT
2. Using has_acpi_companion() checks in the resume callbacks

--
Regards,
Artem