mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-03 17:40:04 +00:00
![Lee Jones](/assets/img/avatar_default.png)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBIpokACgkQUa+KL4f8 d2ETWw/9Eu+jkbyZ3pYCI7TdLMkewsDe8PLpLw/8vaGVBmBOBj8/2Z/7aqSsAgG2 pc1DLKl8OcNA+1xo04SA1YHg0waQjeFmCYLrYDIW2T+DDvXwAjVqU/3KxAx0YwR/ sETXj1ZN0BG5TQHn/djHPeB38LOLxi+RploBTZSSj9zinPp+6I+3UKYohPC6r65x VGBrD544JbN5rKgYw8qYw0P8pEHexBBxDDw+XhCHZ5klTml7wZR3Fi5coJh7g6RK EPbtcR7YluWk7k9VGR1QQ1FsJ0JLKFQgbRFFiy6p+TEti5A88CM2Itnpa3BJX/2T MAVADvtTb2LWJeTXlxlQT2571GN432BRwEAJVY/v8DZYP5sSYwPfF4GzxSQbqqiO q99uaRDvQjpI3KWr65g5GXiMlbxKEFrbEc0Hw4hBzT8+go5Tiysg2McanlZePMVa D8JWDFIIJUHuyGnufXrxLrsmIr/GuvJ4j+NBhMEg8TQg7b3EG1Y+NenHyimQfVzB UMc4l7vjh74Op0Wzo2SwK3dtsF1vBvRks8G/8K0b6I421D12H/a2NAy2xF6RFH7F QikDZ3ycVnDd0GdxGv3+pyejBBbMuXcxp78tRJ0QcKitb9BBViWuVYs3edgO52v0 NWsko1EPkEzz0qrcwy1bjrRg4FriwNgsO+gEtFlnGa3C4wp/ihI= =Z4yL -----END PGP SIGNATURE----- Merge tag 'ib-mfd-watchdog-v5.13' into ibs-for-mfd-merged Immutable branch between MFD and Watchdog due for the v5.13 merge window
93 lines
2.8 KiB
C
93 lines
2.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/* Copyright (C) 2018 ROHM Semiconductors */
|
|
|
|
#ifndef __LINUX_MFD_ROHM_H__
|
|
#define __LINUX_MFD_ROHM_H__
|
|
|
|
#include <linux/regmap.h>
|
|
#include <linux/regulator/driver.h>
|
|
|
|
enum rohm_chip_type {
|
|
ROHM_CHIP_TYPE_BD9571,
|
|
ROHM_CHIP_TYPE_BD9573,
|
|
ROHM_CHIP_TYPE_BD9574,
|
|
ROHM_CHIP_TYPE_BD9576,
|
|
ROHM_CHIP_TYPE_BD70528,
|
|
ROHM_CHIP_TYPE_BD71815,
|
|
ROHM_CHIP_TYPE_BD71828,
|
|
ROHM_CHIP_TYPE_BD71837,
|
|
ROHM_CHIP_TYPE_BD71847,
|
|
ROHM_CHIP_TYPE_AMOUNT
|
|
};
|
|
|
|
struct rohm_regmap_dev {
|
|
struct device *dev;
|
|
struct regmap *regmap;
|
|
};
|
|
|
|
#define ROHM_DVS_LEVEL_RUN BIT(0)
|
|
#define ROHM_DVS_LEVEL_IDLE BIT(1)
|
|
#define ROHM_DVS_LEVEL_SUSPEND BIT(2)
|
|
#define ROHM_DVS_LEVEL_LPSR BIT(3)
|
|
#define ROHM_DVS_LEVEL_SNVS BIT(4)
|
|
#define ROHM_DVS_LEVEL_VALID_AMOUNT 5
|
|
#define ROHM_DVS_LEVEL_UNKNOWN 0
|
|
|
|
/**
|
|
* struct rohm_dvs_config - dynamic voltage scaling register descriptions
|
|
*
|
|
* @level_map: bitmap representing supported run-levels for this
|
|
* regulator
|
|
* @run_reg: register address for regulator config at 'run' state
|
|
* @run_mask: value mask for regulator voltages at 'run' state
|
|
* @run_on_mask: enable mask for regulator at 'run' state
|
|
* @idle_reg: register address for regulator config at 'idle' state
|
|
* @idle_mask: value mask for regulator voltages at 'idle' state
|
|
* @idle_on_mask: enable mask for regulator at 'idle' state
|
|
* @suspend_reg: register address for regulator config at 'suspend' state
|
|
* @suspend_mask: value mask for regulator voltages at 'suspend' state
|
|
* @suspend_on_mask: enable mask for regulator at 'suspend' state
|
|
* @lpsr_reg: register address for regulator config at 'lpsr' state
|
|
* @lpsr_mask: value mask for regulator voltages at 'lpsr' state
|
|
* @lpsr_on_mask: enable mask for regulator at 'lpsr' state
|
|
*
|
|
* Description of ROHM PMICs voltage configuration registers for different
|
|
* system states. This is used to correctly configure the PMIC at startup
|
|
* based on values read from DT.
|
|
*/
|
|
struct rohm_dvs_config {
|
|
uint64_t level_map;
|
|
unsigned int run_reg;
|
|
unsigned int run_mask;
|
|
unsigned int run_on_mask;
|
|
unsigned int idle_reg;
|
|
unsigned int idle_mask;
|
|
unsigned int idle_on_mask;
|
|
unsigned int suspend_reg;
|
|
unsigned int suspend_mask;
|
|
unsigned int suspend_on_mask;
|
|
unsigned int lpsr_reg;
|
|
unsigned int lpsr_mask;
|
|
unsigned int lpsr_on_mask;
|
|
unsigned int snvs_reg;
|
|
unsigned int snvs_mask;
|
|
unsigned int snvs_on_mask;
|
|
};
|
|
|
|
#if IS_ENABLED(CONFIG_REGULATOR_ROHM)
|
|
int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs,
|
|
struct device_node *np,
|
|
const struct regulator_desc *desc,
|
|
struct regmap *regmap);
|
|
|
|
#else
|
|
static inline int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs,
|
|
struct device_node *np,
|
|
const struct regulator_desc *desc,
|
|
struct regmap *regmap)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
#endif
|