Lines Matching defs:sdev
81 static struct spmi_device *qcom_pmic_get_base_usid(struct spmi_device *sdev, struct qcom_spmi_dev *ctx)
92 if (sdev->usid % ctx->num_usids == 0) {
93 get_device(&sdev->dev);
94 return sdev;
97 function_parent_usid = sdev->usid;
106 spmi_bus = of_get_parent(sdev->dev.of_node);
107 sdev = ERR_PTR(-ENODATA);
112 sdev = ERR_PTR(ret);
117 sdev = spmi_device_from_of(child);
118 if (!sdev) {
123 sdev = ERR_PTR(-EPROBE_DEFER);
132 return sdev;
135 static int pmic_spmi_get_base_revid(struct spmi_device *sdev, struct qcom_spmi_dev *ctx)
141 base = qcom_pmic_get_base_usid(sdev, ctx);
230 struct spmi_device *sdev;
239 sdev = to_spmi_device(dev->parent);
240 spmi = dev_get_drvdata(&sdev->dev);
253 static int pmic_spmi_probe(struct spmi_device *sdev)
259 regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_config);
263 ctx = devm_kzalloc(&sdev->dev, sizeof(*ctx), GFP_KERNEL);
267 ctx->num_usids = (uintptr_t)of_device_get_match_data(&sdev->dev);
270 if (sdev->usid % ctx->num_usids == 0) {
271 ret = pmic_spmi_load_revid(regmap, &sdev->dev, &ctx->pmic);
275 ret = pmic_spmi_get_base_revid(sdev, ctx);
281 spmi_device_set_drvdata(sdev, ctx);
284 return devm_of_platform_populate(&sdev->dev);
287 static void pmic_spmi_remove(struct spmi_device *sdev)
290 spmi_device_set_drvdata(sdev, NULL);