Seeing that CONFIG_USB_CONFIGFS_F_PTP=y in tegra_defconfig, I would like if it is possible to convert the Jetson boards to an USB PTP Gadget, please ? By PTP, I mean Picture Transfer Protocol.
However, I have difficulty to create the instance of PTP function as I have not known what would be the correct PTP function name in the following syntax :
mkdir functions/<name>.<instance name>
where is mass_storage for Mass Storage Gadget (with usb_f_mass_storage driver) or hid for Human Interface Device (keyboard) or ecm for USB ethernet gadget or uvc for USB Video Class, …
Also, I found a “simple” implementation of ptp gadget function in below location : <public_sources_xavier_nx_tx2_jp4_5_1_r32_5_1>/Linux_for_Tegra/source/public/kernel_src/kernel/kernel-4.9/drivers/usb/gadget/function/f_ptp.c :
/*
* 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");
I am not sure if above driver is enough for PTP function. And based on the Makefile in the same location :