#define pr_fmt(fmt) …
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <soc/qcom/cmd-db.h>
#include <soc/qcom/rpmh.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
enum rpmh_regulator_type { … };
#define RPMH_REGULATOR_REG_VRM_VOLTAGE …
#define RPMH_REGULATOR_REG_ENABLE …
#define RPMH_REGULATOR_REG_VRM_MODE …
#define PMIC4_LDO_MODE_RETENTION …
#define PMIC4_LDO_MODE_LPM …
#define PMIC4_LDO_MODE_HPM …
#define PMIC4_SMPS_MODE_RETENTION …
#define PMIC4_SMPS_MODE_PFM …
#define PMIC4_SMPS_MODE_AUTO …
#define PMIC4_SMPS_MODE_PWM …
#define PMIC4_BOB_MODE_PASS …
#define PMIC4_BOB_MODE_PFM …
#define PMIC4_BOB_MODE_AUTO …
#define PMIC4_BOB_MODE_PWM …
#define PMIC5_LDO_MODE_RETENTION …
#define PMIC5_LDO_MODE_LPM …
#define PMIC5_LDO_MODE_HPM …
#define PMIC5_SMPS_MODE_RETENTION …
#define PMIC5_SMPS_MODE_PFM …
#define PMIC5_SMPS_MODE_AUTO …
#define PMIC5_SMPS_MODE_PWM …
#define PMIC5_BOB_MODE_PASS …
#define PMIC5_BOB_MODE_PFM …
#define PMIC5_BOB_MODE_AUTO …
#define PMIC5_BOB_MODE_PWM …
struct rpmh_vreg_hw_data { … };
struct rpmh_vreg { … };
struct rpmh_vreg_init_data { … };
static int rpmh_regulator_send_request(struct rpmh_vreg *vreg,
struct tcs_cmd *cmd, bool wait_for_ack)
{ … }
static int _rpmh_regulator_vrm_set_voltage_sel(struct regulator_dev *rdev,
unsigned int selector, bool wait_for_ack)
{ … }
static int rpmh_regulator_vrm_set_voltage_sel(struct regulator_dev *rdev,
unsigned int selector)
{ … }
static int rpmh_regulator_vrm_get_voltage_sel(struct regulator_dev *rdev)
{ … }
static int rpmh_regulator_is_enabled(struct regulator_dev *rdev)
{ … }
static int rpmh_regulator_set_enable_state(struct regulator_dev *rdev,
bool enable)
{ … }
static int rpmh_regulator_enable(struct regulator_dev *rdev)
{ … }
static int rpmh_regulator_disable(struct regulator_dev *rdev)
{ … }
static int rpmh_regulator_vrm_set_mode_bypass(struct rpmh_vreg *vreg,
unsigned int mode, bool bypassed)
{ … }
static int rpmh_regulator_vrm_set_mode(struct regulator_dev *rdev,
unsigned int mode)
{ … }
static unsigned int rpmh_regulator_vrm_get_mode(struct regulator_dev *rdev)
{ … }
static unsigned int rpmh_regulator_vrm_get_optimum_mode(
struct regulator_dev *rdev, int input_uV, int output_uV, int load_uA)
{ … }
static int rpmh_regulator_vrm_set_bypass(struct regulator_dev *rdev,
bool enable)
{ … }
static int rpmh_regulator_vrm_get_bypass(struct regulator_dev *rdev,
bool *enable)
{ … }
static const struct regulator_ops rpmh_regulator_vrm_ops = …;
static const struct regulator_ops rpmh_regulator_vrm_drms_ops = …;
static const struct regulator_ops rpmh_regulator_vrm_bypass_ops = …;
static const struct regulator_ops rpmh_regulator_xob_ops = …;
static int rpmh_regulator_init_vreg(struct rpmh_vreg *vreg, struct device *dev,
struct device_node *node, const char *pmic_id,
const struct rpmh_vreg_init_data *pmic_rpmh_data)
{ … }
static const int pmic_mode_map_pmic4_ldo[REGULATOR_MODE_STANDBY + 1] = …;
static const int pmic_mode_map_pmic5_ldo[REGULATOR_MODE_STANDBY + 1] = …;
static const int pmic_mode_map_pmic5_ldo_hpm[REGULATOR_MODE_STANDBY + 1] = …;
static unsigned int rpmh_regulator_pmic4_ldo_of_map_mode(unsigned int rpmh_mode)
{ … }
static const int pmic_mode_map_pmic4_smps[REGULATOR_MODE_STANDBY + 1] = …;
static const int pmic_mode_map_pmic5_smps[REGULATOR_MODE_STANDBY + 1] = …;
static unsigned int
rpmh_regulator_pmic4_smps_of_map_mode(unsigned int rpmh_mode)
{ … }
static const int pmic_mode_map_pmic4_bob[REGULATOR_MODE_STANDBY + 1] = …;
static const int pmic_mode_map_pmic5_bob[REGULATOR_MODE_STANDBY + 1] = …;
static unsigned int rpmh_regulator_pmic4_bob_of_map_mode(unsigned int rpmh_mode)
{ … }
static const struct rpmh_vreg_hw_data pmic4_pldo = …;
static const struct rpmh_vreg_hw_data pmic4_pldo_lv = …;
static const struct rpmh_vreg_hw_data pmic4_nldo = …;
static const struct rpmh_vreg_hw_data pmic4_hfsmps3 = …;
static const struct rpmh_vreg_hw_data pmic4_ftsmps426 = …;
static const struct rpmh_vreg_hw_data pmic4_bob = …;
static const struct rpmh_vreg_hw_data pmic4_lvs = …;
static const struct rpmh_vreg_hw_data pmic5_pldo = …;
static const struct rpmh_vreg_hw_data pmic5_pldo_lv = …;
static const struct rpmh_vreg_hw_data pmic5_pldo515_mv = …;
static const struct rpmh_vreg_hw_data pmic5_pldo502 = …;
static const struct rpmh_vreg_hw_data pmic5_pldo502ln = …;
static const struct rpmh_vreg_hw_data pmic5_nldo = …;
static const struct rpmh_vreg_hw_data pmic5_nldo515 = …;
static const struct rpmh_vreg_hw_data pmic5_nldo502 = …;
static const struct rpmh_vreg_hw_data pmic5_hfsmps510 = …;
static const struct rpmh_vreg_hw_data pmic5_ftsmps510 = …;
static const struct rpmh_vreg_hw_data pmic5_ftsmps520 = …;
static const struct rpmh_vreg_hw_data pmic5_ftsmps525_lv = …;
static const struct rpmh_vreg_hw_data pmic5_ftsmps525_mv = …;
static const struct rpmh_vreg_hw_data pmic5_ftsmps527 = …;
static const struct rpmh_vreg_hw_data pmic5_hfsmps515 = …;
static const struct rpmh_vreg_hw_data pmic5_hfsmps515_1 = …;
static const struct rpmh_vreg_hw_data pmic5_bob = …;
#define RPMH_VREG(_name, _resource_name, _hw_data, _supply_name) …
static const struct rpmh_vreg_init_data pm8998_vreg_data[] = …;
static const struct rpmh_vreg_init_data pmg1110_vreg_data[] = …;
static const struct rpmh_vreg_init_data pmi8998_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8005_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8150_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8150l_vreg_data[] = …;
static const struct rpmh_vreg_init_data pmm8155au_vreg_data[] = …;
static const struct rpmh_vreg_init_data pmm8654au_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8350_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8350c_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8450_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8550_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8550ve_vreg_data[] = …;
static const struct rpmh_vreg_init_data pmc8380_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8009_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8009_1_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm8010_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm6150_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm6150l_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm6350_vreg_data[] = …;
static const struct rpmh_vreg_init_data pmx55_vreg_data[] = …;
static const struct rpmh_vreg_init_data pmx65_vreg_data[] = …;
static const struct rpmh_vreg_init_data pmx75_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm7325_vreg_data[] = …;
static const struct rpmh_vreg_init_data pmr735a_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm660_vreg_data[] = …;
static const struct rpmh_vreg_init_data pm660l_vreg_data[] = …;
static int rpmh_regulator_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id __maybe_unused rpmh_regulator_match_table[] = …;
MODULE_DEVICE_TABLE(of, rpmh_regulator_match_table);
static struct platform_driver rpmh_regulator_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;