Lines Matching full:pmic
15 #include <soc/qcom/qcom-spmi-pmic.h>
30 struct qcom_spmi_pmic pmic; member
65 { .compatible = "qcom,spmi-pmic", .data = N_USIDS(1) },
70 * A PMIC can be represented by multiple SPMI devices, but
71 * only the base PMIC device will contain a reference to
74 * This function takes a pointer to a pmic device and
75 * returns a pointer to the base PMIC device.
103 * number of USIDs in the PMIC array, e.g. for a PMIC with 2 USIDs in qcom_pmic_get_base_usid()
119 * If the base USID for this PMIC hasn't probed yet in qcom_pmic_get_base_usid()
133 struct qcom_spmi_pmic *pmic) in pmic_spmi_load_revid() argument
137 ret = regmap_read(map, PMIC_TYPE, &pmic->type); in pmic_spmi_load_revid()
141 if (pmic->type != PMIC_TYPE_VALUE) in pmic_spmi_load_revid()
144 ret = regmap_read(map, PMIC_SUBTYPE, &pmic->subtype); in pmic_spmi_load_revid()
148 pmic->name = of_match_device(pmic_spmi_id_table, dev)->compatible; in pmic_spmi_load_revid()
150 ret = regmap_read(map, PMIC_REV2, &pmic->rev2); in pmic_spmi_load_revid()
154 ret = regmap_read(map, PMIC_REV3, &pmic->minor); in pmic_spmi_load_revid()
158 ret = regmap_read(map, PMIC_REV4, &pmic->major); in pmic_spmi_load_revid()
162 if (pmic->subtype == PMI8998_SUBTYPE || pmic->subtype == PM660_SUBTYPE) { in pmic_spmi_load_revid()
163 ret = regmap_read(map, PMIC_FAB_ID, &pmic->fab_id); in pmic_spmi_load_revid()
174 if ((pmic->subtype == PM8941_SUBTYPE || pmic->subtype == PM8226_SUBTYPE) && in pmic_spmi_load_revid()
175 pmic->major < PMIC_REV4_V2) in pmic_spmi_load_revid()
176 pmic->major++; in pmic_spmi_load_revid()
178 if (pmic->subtype == PM8110_SUBTYPE) in pmic_spmi_load_revid()
179 pmic->minor = pmic->rev2; in pmic_spmi_load_revid()
182 pmic->subtype, pmic->name, pmic->major, pmic->minor); in pmic_spmi_load_revid()
188 * qcom_pmic_get() - Get a pointer to the base PMIC device
190 * This function takes a struct device for a driver which is a child of a PMIC.
191 * And locates the PMIC revision information for it.
193 * @dev: the pmic function device
202 * Make sure the device is actually a child of a PMIC in qcom_pmic_get()
214 return &spmi->pmic; in qcom_pmic_get()
241 /* Only the first slave id for a PMIC contains this information */ in pmic_spmi_probe()
243 ret = pmic_spmi_load_revid(regmap, &sdev->dev, &ctx->pmic); in pmic_spmi_probe()
257 .name = "pmic-spmi",
263 MODULE_DESCRIPTION("Qualcomm SPMI PMIC driver");
264 MODULE_ALIAS("spmi:spmi-pmic");