aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/f_ptp.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2016-03-18 09:50:49 +0000
committerMark Brown <broonie@kernel.org>2016-03-18 09:50:49 +0000
commit0f221533bae04ea913dc8ebe18cb876a916ff690 (patch)
tree77e668f0080e2ca245bd6150f5046370e8fa9f4b /drivers/usb/gadget/function/f_ptp.c
parent917a9133a6b3c6cc2b6b5649d28c617a4ccac3e6 (diff)
parent127f7fb4c452328fa24f4c29eb403a97c5f7ea8c (diff)
Merge remote-tracking branch 'lsk/linux-linaro-lsk-v4.4-android' into linux-linaro-lsk-v4.4-androidlsk-v4.4-16.03-android
Diffstat (limited to 'drivers/usb/gadget/function/f_ptp.c')
-rw-r--r--drivers/usb/gadget/function/f_ptp.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_ptp.c b/drivers/usb/gadget/function/f_ptp.c
new file mode 100644
index 000000000000..da3e4d53e085
--- /dev/null
+++ b/drivers/usb/gadget/function/f_ptp.c
@@ -0,0 +1,38 @@
+/*
+ * Gadget Function Driver for PTP
+ *
+ * Copyright (C) 2014 Google, Inc.
+ * Author: Badhri Jagan Sridharan <badhri@android.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+
+#include <linux/configfs.h>
+#include <linux/usb/composite.h>
+
+#include "f_mtp.h"
+
+static struct usb_function_instance *ptp_alloc_inst(void)
+{
+ return alloc_inst_mtp_ptp(false);
+}
+
+static struct usb_function *ptp_alloc(struct usb_function_instance *fi)
+{
+ return function_alloc_mtp_ptp(fi, false);
+}
+
+DECLARE_USB_FUNCTION_INIT(ptp, ptp_alloc_inst, ptp_alloc);
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Badhri Jagan Sridharan");