REGULATOR_LINEAR_RANGE(1500000, 64, 100, 50000),
};
++ +++static const struct regulator_linear_range smb208_ranges[] = {
++ +++ REGULATOR_LINEAR_RANGE( 375000, 0, 29, 12500),
++ +++ REGULATOR_LINEAR_RANGE( 750000, 30, 89, 12500),
++ +++ REGULATOR_LINEAR_RANGE(1500000, 90, 153, 25000),
++ +++ REGULATOR_LINEAR_RANGE(3100000, 154, 234, 25000),
++ +++};
++ +++
static const struct regulator_linear_range ncp_ranges[] = {
REGULATOR_LINEAR_RANGE(1500000, 0, 31, 50000),
};
.parts = &rpm8960_switch_parts,
};
++ +++static const struct qcom_rpm_reg smb208_smps = {
++ +++ .desc.linear_ranges = smb208_ranges,
++ +++ .desc.n_linear_ranges = ARRAY_SIZE(smb208_ranges),
++ +++ .desc.n_voltages = 235,
++ +++ .desc.ops = &uV_ops,
++ +++ .parts = &rpm8960_smps_parts,
++ +++ .supports_force_mode_auto = false,
++ +++ .supports_force_mode_bypass = false,
++ +++};
++ +++
static const struct of_device_id rpm_of_match[] = {
{ .compatible = "qcom,rpm-pm8058-pldo", .data = &pm8058_pldo },
{ .compatible = "qcom,rpm-pm8058-nldo", .data = &pm8058_nldo },
{ .compatible = "qcom,rpm-pm8921-ftsmps", .data = &pm8921_ftsmps },
{ .compatible = "qcom,rpm-pm8921-ncp", .data = &pm8921_ncp },
{ .compatible = "qcom,rpm-pm8921-switch", .data = &pm8921_switch },
++ +++
++ +++ { .compatible = "qcom,rpm-smb208", .data = &smb208_smps },
{ }
};
MODULE_DEVICE_TABLE(of, rpm_of_match);
match = of_match_device(rpm_of_match, &pdev->dev);
template = match->data;
----- initdata = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node);
----- if (!initdata)
----- return -EINVAL;
-----
vreg = devm_kmalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL);
if (!vreg) {
dev_err(&pdev->dev, "failed to allocate vreg\n");
return -ENODEV;
}
+++++ initdata = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node,
+++++ &vreg->desc);
+++++ if (!initdata)
+++++ return -EINVAL;
+++++
key = "reg";
ret = of_property_read_u32(pdev->dev.of_node, key, &val);
if (ret) {
.enable_mask = S2MPA01_ENABLE_MASK \
}
---- -static struct regulator_desc regulators[] = {
++++ +static const struct regulator_desc regulators[] = {
regulator_desc_ldo(1, STEP_25_MV),
regulator_desc_ldo(2, STEP_50_MV),
regulator_desc_ldo(3, STEP_50_MV),
{
struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
struct sec_platform_data *pdata = dev_get_platdata(iodev->dev);
----- struct of_regulator_match rdata[S2MPA01_REGULATOR_MAX];
+++++ struct of_regulator_match rdata[S2MPA01_REGULATOR_MAX] = { };
struct device_node *reg_np = NULL;
struct regulator_config config = { };
struct s2mpa01_info *s2mpa01;