summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/fsl_updater.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2010-09-14 13:23:15 +0800
committerAlan Tull <r80115@freescale.com>2010-09-25 09:52:31 -0500
commit3e82e3c6f91e6ff51e8faeb954fa608c141c70c6 (patch)
tree23c5448de152bf0f27dcdb8d91813fdb52dbe764 /drivers/usb/gadget/fsl_updater.c
parent71433dd3797fe6dacc4df8a8056c02cf964c0eac (diff)
ENGR00131456 mfg-tool: Add get cpu id ioctl at utp driver
The watchdog operation is differ with SoC's for rom code, so the utp app needs to add or not add watchdog operation according to different SoCs. Signed-off-by: Peter Chen <peter.chen@freescale.com>
Diffstat (limited to 'drivers/usb/gadget/fsl_updater.c')
-rw-r--r--drivers/usb/gadget/fsl_updater.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/usb/gadget/fsl_updater.c b/drivers/usb/gadget/fsl_updater.c
index 50acce441a90..cd8ba2480f6e 100644
--- a/drivers/usb/gadget/fsl_updater.c
+++ b/drivers/usb/gadget/fsl_updater.c
@@ -139,6 +139,44 @@ static ssize_t utp_file_write(struct file *file, const char __user *buf,
return size;
}
+static int
+utp_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ int cpu_id = 0;
+ switch (cmd) {
+ case UTP_GET_CPU_ID:
+/* Currently, it only supports below SoC for manufacture tool
+ * The naming rule
+ * 1. The numberic for SoC string
+ * 2. If there is next SoC version, and the corresponding utp
+ * operation will be differ, then, need to add '1' next to SoC
+ * name. Such as the next 50 SoC version is: cpu_is = 501
+ */
+#ifdef CONFIG_ARCH_MXS
+ if (cpu_is_mx23())
+ cpu_id = 23;
+ else if (cpu_is_mx28())
+ cpu_id = 28;
+#endif
+#ifdef CONFIG_ARCH_MXC
+ if (cpu_is_mx25())
+ cpu_id = 25;
+ else if (cpu_is_mx35())
+ cpu_id = 35;
+ else if (cpu_is_mx51())
+ cpu_id = 51;
+ else if (cpu_is_mx53())
+ cpu_id = 53;
+ else if (cpu_is_mx50())
+ cpu_id = 50;
+#endif
+ return put_user(cpu_id, (int __user *)arg);
+ default:
+ return -ENOIOCTLCMD;
+ }
+}
+
/* Will be called when the host wants to get the sense data */
static int utp_get_sense(struct fsg_dev *fsg)
{