mbox series

[v1,00/10] Add rtc and suspend to ram for Maxim MAX77686 PMIC

Message ID 20250425132727.5160-1-linux.amoon@gmail.com
Headers show
Series Add rtc and suspend to ram for Maxim MAX77686 PMIC | expand

Message

Anand Moon April 25, 2025, 1:26 p.m. UTC
The Maxim MAX77686 family of PMICs supports RTC crystal clocks.
Device tree bindings have been added to enable this feature across all
devices.

Add information which regulators can be disabled during system suspend.

Regulators which can be turned off during system suspend:
        -LDOn   :       2, 6-8, 10-12, 14-16,
        -BUCKn  :       1-4.
Use standard regulator bindings for it ('regulator-off-in-suspend').

Tested on Exynos4412 Odroid U3.

Previous version
v1: https://lore.kernel.org/all/20181204194025.2719-1-linux.amoon@gmail.com/

Thanks
-Anand

Anand Moon (10):
  dt-bindings: clock: Add RTC clock binding for Maxim MAX77686
  ARM: dts: exynos: Add rtc clock definitions for MAX77686 PMIC for
    Exynos4412 Odroid
  ARM: dts: exynos: Add proper regulator states for suspend-to-mem for
    Exynos4412 Odroid
  ARM: dts: exynos: Add rtc clock definitions for MAX77686 PMIC for
    Exynos4412 Midas
  ARM: dts: exynos: Add rtc clock definitions for MAX77686 PMIC for
    Exynos4412 p4note
  ARM: dts: exynos: Update proper regulator states for suspend-to-mem
    for Exynos4412 p4node
  ARM: dts: exynos: Add rtc clock definitions for MAX77686 PMIC for
    Exynos5250 smdk5250
  ARM: dts: exynos: Add proper regulator states for suspend-to-mem for
    Exyno5250 smdk5250
  ARM: dts: exynos: Add rtc clock definitions for MAX77686 PMIC for
    Exynos5250 snow
  ARM: dts: exynos: Add proper regulator states for suspend-to-mem for
    Exynos5250 snow

 .../bindings/clock/maxim,max77686.yaml        | 48 ++++++++++++++
 .../boot/dts/samsung/exynos4412-midas.dtsi    |  7 +++
 .../dts/samsung/exynos4412-odroid-common.dtsi | 63 +++++++++++++++++++
 .../boot/dts/samsung/exynos4412-p4note.dtsi   | 31 +++++----
 .../boot/dts/samsung/exynos5250-smdk5250.dts  | 63 +++++++++++++++++++
 .../dts/samsung/exynos5250-snow-common.dtsi   | 55 ++++++++++++++++
 6 files changed, 255 insertions(+), 12 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/maxim,max77686.yaml


base-commit: 02ddfb981de88a2c15621115dd7be2431252c568

Comments

Krzysztof Kozlowski April 25, 2025, 2:44 p.m. UTC | #1
On 25/04/2025 15:26, Anand Moon wrote:
> +
> +  The MAX77686 contains three 32.768khz crystal clock outputs that can
> +  be controlled (gated/ungated) over I2C. Clocks are defined as
> +  preprocessor macros in dt-bindings/clock/maxim,max77686.h.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - max77686-rtc

So you claim RTC is a clock, right? Did not even think that RTC has a
bit different meaning?

But regardless, this code make no sense and was never tested. It cannot
work.

It reminds me previous approaches with whatever patches you found in the
downstream...

Best regards,
Krzysztof
Anand Moon April 26, 2025, 6:11 a.m. UTC | #2
Hi Krzysztof,

On Fri, 25 Apr 2025 at 20:14, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 25/04/2025 15:26, Anand Moon wrote:
> > +
> > +  The MAX77686 contains three 32.768khz crystal clock outputs that can
> > +  be controlled (gated/ungated) over I2C. Clocks are defined as
> > +  preprocessor macros in dt-bindings/clock/maxim,max77686.h.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - max77686-rtc
>
> So you claim RTC is a clock, right? Did not even think that RTC has a
> bit different meaning?
>
> But regardless, this code make no sense and was never tested. It cannot
> work.
>
> It reminds me previous approaches with whatever patches you found in the
> downstream...

Okay, I found the MAX77686A datasheet that Hardkernel shared long
ago and tried to interpret the information in it.
I will remove this repo once this is done.

[0] https://github.com/moonlinux/Samsung_user_manuals/blob/master/MAX77686A%20Datasheet%20REV00.pdf

I have gone through MAX77686A the regulator and the datasheet
If you have some improvements to the code plz suggest so,

>
> Best regards,
> Krzysztof

Thanks
-Anand