#define SDM660_MMSS_VOLTAGE_FUSE_SIZE 5
#define SDM660_MMSS_CPR_SENSOR_COUNT 11
+#define SDM630_MMSS_CPR_SENSOR_COUNT 7
#define SDM660_MMSS_CPR_CLOCK_RATE 19200000
+enum {
+ SDM660_SOC_ID,
+ SDM630_SOC_ID,
+};
+
/**
* cpr4_sdm660_mmss_read_fuse_data() - load MMSS specific fuse parameter
* values
return rc;
}
- ctrl->sensor_count = SDM660_MMSS_CPR_SENSOR_COUNT;
+ if (ctrl->soc_revision == SDM660_SOC_ID)
+ ctrl->sensor_count = SDM660_MMSS_CPR_SENSOR_COUNT;
+ else if (ctrl->soc_revision == SDM630_SOC_ID)
+ ctrl->sensor_count = SDM630_MMSS_CPR_SENSOR_COUNT;
/*
* MMSS only has one thread (0) so the zeroed array does not need
return 0;
}
+/* Data corresponds to the SoC revision */
+static const struct of_device_id cpr4_mmss_regulator_match_table[] = {
+ {
+ .compatible = "qcom,cpr4-sdm660-mmss-ldo-regulator",
+ .data = (void *)(uintptr_t)SDM660_SOC_ID,
+ },
+ {
+ .compatible = "qcom,cpr4-sdm630-mmss-ldo-regulator",
+ .data = (void *)(uintptr_t)SDM630_SOC_ID,
+ },
+ { },
+};
+
static int cpr4_mmss_regulator_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
+ const struct of_device_id *match;
struct cpr3_controller *ctrl;
int rc;
return rc;
}
+ match = of_match_node(cpr4_mmss_regulator_match_table, dev->of_node);
+ if (match)
+ ctrl->soc_revision = (uintptr_t)match->data;
+ else
+ cpr3_err(ctrl, "could not find compatible string match\n");
+
rc = cpr3_map_fuse_base(ctrl, pdev);
if (rc) {
cpr3_err(ctrl, "could not map fuse base address\n");
return cpr3_regulator_resume(ctrl);
}
-/* Data corresponds to the SoC revision */
-static const struct of_device_id cpr4_mmss_regulator_match_table[] = {
- {
- .compatible = "qcom,cpr4-sdm660-mmss-ldo-regulator",
- .data = (void *)NULL,
- },
- {
- .compatible = "qcom,cpr4-sdm630-mmss-ldo-regulator",
- .data = (void *)NULL,
- },
- { },
-};
-
static struct platform_driver cpr4_mmss_regulator_driver = {
.driver = {
.name = "qcom,cpr4-mmss-ldo-regulator",