Source
x
static int max77651_regulator_sbb1_set_voltage_sel(struct regulator_dev *rdev,
// SPDX-License-Identifier: GPL-2.0
//
// Copyright (C) 2018 BayLibre SAS
// Author: Bartosz Golaszewski <bgolaszewski@baylibre.com>
//
// Regulator driver for MAXIM 77650/77651 charger/power-supply.
enum {
MAX77650_REGULATOR_ID_LDO = 0,
MAX77650_REGULATOR_ID_SBB0,
MAX77650_REGULATOR_ID_SBB1,
MAX77650_REGULATOR_ID_SBB2,
MAX77650_REGULATOR_NUM_REGULATORS,
};
struct max77650_regulator_desc {
struct regulator_desc desc;
unsigned int regA;
unsigned int regB;
};
static const u32 max77651_sbb1_regulator_volt_table[] = {
2400000, 3200000, 4000000, 4800000,
2450000, 3250000, 4050000, 4850000,
2500000, 3300000, 4100000, 4900000,
2550000, 3350000, 4150000, 4950000,
2600000, 3400000, 4200000, 5000000,
2650000, 3450000, 4250000, 5050000,
2700000, 3500000, 4300000, 5100000,
2750000, 3550000, 4350000, 5150000,
2800000, 3600000, 4400000, 5200000,
2850000, 3650000, 4450000, 5250000,
2900000, 3700000, 4500000, 0,
2950000, 3750000, 4550000, 0,
3000000, 3800000, 4600000, 0,
3050000, 3850000, 4650000, 0,
3100000, 3900000, 4700000, 0,
3150000, 3950000, 4750000, 0,
};
static const unsigned int max77650_current_limit_table[] = {
1000000, 866000, 707000, 500000,
};
static int max77650_regulator_is_enabled(struct regulator_dev *rdev)
{
struct max77650_regulator_desc *rdesc;
struct regmap *map;
int val, rv, en;
rdesc = rdev_get_drvdata(rdev);