diff --git a/drivers/platform/msm/qpnp-revid.c b/drivers/platform/msm/qpnp-revid.c index 99c5f27abef9..292f6c214c36 100644 --- a/drivers/platform/msm/qpnp-revid.c +++ b/drivers/platform/msm/qpnp-revid.c @@ -18,6 +18,9 @@ #include #include #include +#ifdef CONFIG_RAMDUMP_TAGS +#include +#endif #define REVID_REVISION1 0x0 #define REVID_REVISION2 0x1 @@ -132,6 +135,11 @@ static size_t build_pmic_string(char *buf, size_t n, int sid, u8 subtype, u8 rev1, u8 rev2, u8 rev3, u8 rev4) { size_t pos = 0; +#ifdef CONFIG_RAMDUMP_TAGS + char tag_name[64]; + char tag_data[64]; + int version_pos = 0; +#endif /* * In early versions of PM8941 and PM8226, the major revision number * started incrementing from 0 (eg 0 = v1.0, 1 = v2.0). @@ -150,11 +158,21 @@ static size_t build_pmic_string(char *buf, size_t n, int sid, else pos += snprintf(buf + pos, n - pos, ": %s", pmic_names[subtype]); +#ifdef CONFIG_RAMDUMP_TAGS + snprintf(tag_name, sizeof(tag_name), "pmic_%s_revision_str", + pmic_names[(subtype < ARRAY_SIZE(pmic_names)) ? subtype : 0]); + version_pos = pos + 1; +#endif pos += snprintf(buf + pos, n - pos, " v%d.%d", rev4, rev3); if (rev2 || rev1) pos += snprintf(buf + pos, n - pos, ".%d", rev2); if (rev1) pos += snprintf(buf + pos, n - pos, ".%d", rev1); + +#ifdef CONFIG_RAMDUMP_TAGS + snprintf(tag_data, sizeof(tag_data), "%s", buf + version_pos); + rdtags_add_tag(tag_name, tag_data, strlen(tag_data)); +#endif return pos; }