Add memory detect node for service menu

Root cause:N/A

How to fix:N/A

Feature:add memory vendor detect node

RiskArea: Memory
Change-Id: I0e3aa68cdeca14fe304fcdeef216c6349953a5dc
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 0831456..1ff4a8e 100755
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -27,10 +27,22 @@
 #include "bus.h"
 #include "mmc_ops.h"
 #include "sd_ops.h"
+/*[TracyChui]Add memory detect node for service menu 20200629 start */
+#include <linux/proc_fs.h>
+/*[TracyChui]Add memory detect node for service menu 20200629 end */
 
 #define DEFAULT_CMD6_TIMEOUT_MS	500
 #define MIN_CACHE_EN_TIMEOUT_MS 1600
 
+/*[TracyChui]Add memory detect node for service menu 20200629 start */
+extern void seq_printf(struct seq_file *m, const char *f, ...);
+extern int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
+extern ssize_t seq_read(struct file *, char __user *, size_t, loff_t *);
+extern loff_t seq_lseek(struct file *, loff_t, int);
+extern int single_release(struct inode *, struct file *);
+static u32 memory_cid;
+/*[TracyChui]Add memory detect node for service menu 20200629 end */
+
 static const unsigned int tran_exp[] = {
 	10000,		100000,		1000000,	10000000,
 	0,		0,		0,		0
@@ -3156,6 +3168,33 @@
 	.post_hibernate = mmc_post_hibernate
 };
 
+/*[TracyChui]Add memory detect node for service menu 20200629 start */
+static int proc_memory_vendor_show(struct seq_file *m, void *v)
+{
+	if (memory_cid==0x15010052)
+		{
+		seq_printf(m, "Samsung_2nd\n");
+		}
+	else
+		{
+			seq_printf(m, "Samsung_Main\n");
+		}
+	return 0;
+}
+
+static int proc_memory_vendor_open(struct inode *inode, struct file *file)
+	{
+		return single_open(file, proc_memory_vendor_show, NULL);
+	}
+
+static const struct file_operations proc_memory_vendor_fops = {
+	.open  = proc_memory_vendor_open,
+	.read = seq_read,
+	.llseek = seq_lseek,
+	.release = single_release,
+};
+/*[TracyChui]Add memory detect node for service menu 20200629 end */
+
 /*
  * Starting point for MMC card init.
  */
@@ -3219,6 +3258,14 @@
 
 	register_reboot_notifier(&host->card->reboot_notify);
 
+	/*[TracyChui]Add memory detect node for service menu 20200629 start */
+	proc_create("memory_vendor", 0, NULL, &proc_memory_vendor_fops);
+	if(host->card->type == MMC_TYPE_MMC)
+		{
+			memory_cid=host->card->raw_cid[0];
+		}
+	/*[TracyChui]Add memory detect node for service menu 20200629 end */
+
 	return 0;
 
 remove_card: