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.
104 * number of USIDs in the PMIC array, e.g. for a PMIC with 2 USIDs in qcom_pmic_get_base_usid()
121 * If the base USID for this PMIC hasn't been in qcom_pmic_get_base_usid()
155 memcpy(&ctx->pmic, &base_ctx->pmic, sizeof(ctx->pmic)); in pmic_spmi_get_base_revid()
165 struct qcom_spmi_pmic *pmic) in pmic_spmi_load_revid() argument
169 ret = regmap_read(map, PMIC_TYPE, &pmic->type); in pmic_spmi_load_revid()
173 if (pmic->type != PMIC_TYPE_VALUE) in pmic_spmi_load_revid()
176 ret = regmap_read(map, PMIC_SUBTYPE, &pmic->subtype); in pmic_spmi_load_revid()
180 pmic->name = of_match_device(pmic_spmi_id_table, dev)->compatible; in pmic_spmi_load_revid()
182 ret = regmap_read(map, PMIC_REV2, &pmic->rev2); in pmic_spmi_load_revid()
186 ret = regmap_read(map, PMIC_REV3, &pmic->minor); in pmic_spmi_load_revid()
190 ret = regmap_read(map, PMIC_REV4, &pmic->major); in pmic_spmi_load_revid()
194 if (pmic->subtype == PMI8998_SUBTYPE || pmic->subtype == PM660_SUBTYPE) { in pmic_spmi_load_revid()
195 ret = regmap_read(map, PMIC_FAB_ID, &pmic->fab_id); in pmic_spmi_load_revid()
206 if ((pmic->subtype == PM8941_SUBTYPE || pmic->subtype == PM8226_SUBTYPE) && in pmic_spmi_load_revid()
207 pmic->major < PMIC_REV4_V2) in pmic_spmi_load_revid()
208 pmic->major++; in pmic_spmi_load_revid()
210 if (pmic->subtype == PM8110_SUBTYPE) in pmic_spmi_load_revid()
211 pmic->minor = pmic->rev2; in pmic_spmi_load_revid()
214 pmic->subtype, pmic->name, pmic->major, pmic->minor); in pmic_spmi_load_revid()
220 * qcom_pmic_get() - Get a pointer to the base PMIC device
222 * This function takes a struct device for a driver which is a child of a PMIC.
223 * And locates the PMIC revision information for it.
225 * @dev: the pmic function device
234 * Make sure the device is actually a child of a PMIC in qcom_pmic_get()
242 return &spmi->pmic; in qcom_pmic_get()
269 /* Only the first slave id for a PMIC contains this information */ in pmic_spmi_probe()
271 ret = pmic_spmi_load_revid(regmap, &sdev->dev, &ctx->pmic); in pmic_spmi_probe()
300 .name = "pmic-spmi",
306 MODULE_DESCRIPTION("Qualcomm SPMI PMIC driver");
307 MODULE_ALIAS("spmi:spmi-pmic");