Source
// SPDX-License-Identifier: GPL-2.0
//
// MCP16502 PMIC driver
//
// Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries
//
// Author: Andrei Stefanescu <andrei.stefanescu@microchip.com>
//
// Inspired from tps65086-regulator.c
/*
* The PMIC has four sets of registers corresponding to four power modes:
* Performance, Active, Low-power, Hibernate.
*
* Registers:
* Each regulator has a register for each power mode. To access a register
* for a specific regulator and mode BASE_* and OFFSET_* need to be added.
*
* Operating modes:
* In order for the PMIC to transition to operating modes it has to be
* controlled via GPIO lines called LPM and HPM.
*
* The registers are fully configurable such that you can put all regulators in
* a low-power state while the PMIC is in Active mode. They are supposed to be
* configured at startup and then simply transition to/from a global low-power
* state by setting the GPIO lpm pin high/low.
*
* This driver keeps the PMIC in Active mode, Low-power state is set for the
* regulators by enabling/disabling operating mode (FPWM or Auto PFM).
*
* The PMIC's Low-power and Hibernate modes are used during standby/suspend.
* To enter standby/suspend the PMIC will go to Low-power mode. From there, it
* will transition to Hibernate when the PWRHLD line is set to low by the MPU.
*/
/*
* This function is useful for iterating over all regulators and accessing their
* registers in a generic way or accessing a regulator device by its id.
*/