Lines Matching full:pmic

17 #include <soc/qcom/qcom-spmi-pmic.h>
32 struct qcom_spmi_pmic pmic; member
70 { .compatible = "qcom,spmi-pmic", .data = N_USIDS(1) },
75 * A PMIC can be represented by multiple SPMI devices, but
76 * only the base PMIC device will contain a reference to
79 * This function takes a pointer to a pmic device and
80 * returns a pointer to the base PMIC device.
105 * number of USIDs in the PMIC array, e.g. for a PMIC with 2 USIDs in qcom_pmic_get_base_usid()
123 * If the base USID for this PMIC hasn't been in qcom_pmic_get_base_usid()
158 memcpy(&ctx->pmic, &base_ctx->pmic, sizeof(ctx->pmic)); in pmic_spmi_get_base_revid()
168 struct qcom_spmi_pmic *pmic) in pmic_spmi_load_revid() argument
172 ret = regmap_read(map, PMIC_TYPE, &pmic->type); in pmic_spmi_load_revid()
176 if (pmic->type != PMIC_TYPE_VALUE) in pmic_spmi_load_revid()
179 ret = regmap_read(map, PMIC_SUBTYPE, &pmic->subtype); in pmic_spmi_load_revid()
183 pmic->name = of_match_device(pmic_spmi_id_table, dev)->compatible; in pmic_spmi_load_revid()
185 ret = regmap_read(map, PMIC_REV2, &pmic->rev2); in pmic_spmi_load_revid()
189 ret = regmap_read(map, PMIC_REV3, &pmic->minor); in pmic_spmi_load_revid()
193 ret = regmap_read(map, PMIC_REV4, &pmic->major); in pmic_spmi_load_revid()
197 if (pmic->subtype == PMI8998_SUBTYPE || pmic->subtype == PM660_SUBTYPE) { in pmic_spmi_load_revid()
198 ret = regmap_read(map, PMIC_FAB_ID, &pmic->fab_id); in pmic_spmi_load_revid()
209 if ((pmic->subtype == PM8941_SUBTYPE || pmic->subtype == PM8226_SUBTYPE) && in pmic_spmi_load_revid()
210 pmic->major < PMIC_REV4_V2) in pmic_spmi_load_revid()
211 pmic->major++; in pmic_spmi_load_revid()
213 if (pmic->subtype == PM8110_SUBTYPE) in pmic_spmi_load_revid()
214 pmic->minor = pmic->rev2; in pmic_spmi_load_revid()
217 pmic->subtype, pmic->name, pmic->major, pmic->minor); in pmic_spmi_load_revid()
223 * qcom_pmic_get() - Get a pointer to the base PMIC device
225 * This function takes a struct device for a driver which is a child of a PMIC.
226 * And locates the PMIC revision information for it.
228 * @dev: the pmic function device
237 * Make sure the device is actually a child of a PMIC in qcom_pmic_get()
245 return &spmi->pmic; in qcom_pmic_get()
272 /* Only the first slave id for a PMIC contains this information */ in pmic_spmi_probe()
274 ret = pmic_spmi_load_revid(regmap, &sdev->dev, &ctx->pmic); in pmic_spmi_probe()
303 .name = "pmic-spmi",
309 MODULE_DESCRIPTION("Qualcomm SPMI PMIC driver");
310 MODULE_ALIAS("spmi:spmi-pmic");