Lines Matching +full:vset +full:- +full:millivolts

1 // SPDX-License-Identifier: GPL-2.0-only
29 /* if enable==0, rset and vset are ignored */
31 int vset, bool enable) in qcom_coincell_chgr_config() argument
37 return regmap_write(chgr->regmap, in qcom_coincell_chgr_config()
38 chgr->base_addr + QCOM_COINCELL_REG_ENABLE, 0); in qcom_coincell_chgr_config()
40 /* find index for current-limiting resistor */ in qcom_coincell_chgr_config()
46 dev_err(chgr->dev, "invalid rset-ohms value %d\n", rset); in qcom_coincell_chgr_config()
47 return -EINVAL; in qcom_coincell_chgr_config()
52 if (vset == qcom_vset_map[j]) in qcom_coincell_chgr_config()
56 dev_err(chgr->dev, "invalid vset-millivolts value %d\n", vset); in qcom_coincell_chgr_config()
57 return -EINVAL; in qcom_coincell_chgr_config()
60 rc = regmap_write(chgr->regmap, in qcom_coincell_chgr_config()
61 chgr->base_addr + QCOM_COINCELL_REG_RSET, i); in qcom_coincell_chgr_config()
69 dev_err(chgr->dev, "could not write to RSET register\n"); in qcom_coincell_chgr_config()
73 rc = regmap_write(chgr->regmap, in qcom_coincell_chgr_config()
74 chgr->base_addr + QCOM_COINCELL_REG_VSET, j); in qcom_coincell_chgr_config()
79 return regmap_write(chgr->regmap, in qcom_coincell_chgr_config()
80 chgr->base_addr + QCOM_COINCELL_REG_ENABLE, in qcom_coincell_chgr_config()
86 struct device_node *node = pdev->dev.of_node; in qcom_coincell_probe()
89 u32 vset = 0; in qcom_coincell_probe() local
93 chgr.dev = &pdev->dev; in qcom_coincell_probe()
95 chgr.regmap = dev_get_regmap(pdev->dev.parent, NULL); in qcom_coincell_probe()
98 return -EINVAL; in qcom_coincell_probe()
105 enable = !of_property_read_bool(node, "qcom,charger-disable"); in qcom_coincell_probe()
108 rc = of_property_read_u32(node, "qcom,rset-ohms", &rset); in qcom_coincell_probe()
111 "can't find 'qcom,rset-ohms' in DT block"); in qcom_coincell_probe()
115 rc = of_property_read_u32(node, "qcom,vset-millivolts", &vset); in qcom_coincell_probe()
118 "can't find 'qcom,vset-millivolts' in DT block"); in qcom_coincell_probe()
123 return qcom_coincell_chgr_config(&chgr, rset, vset, enable); in qcom_coincell_probe()
127 { .compatible = "qcom,pm8941-coincell", },
135 .name = "qcom-spmi-coincell",