From 4cba209ab91b58fec7a80442727191b8747ee305 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sat, 20 Nov 2021 10:25:27 +0100 Subject: [PATCH] drivers: usb: add separated Samsung MTP option Change-Id: Ie3b8bf94fb888ddd7c7138ed713d56a3564a07b5 --- arch/arm64/configs/vendor/lineage-a52q_defconfig | 1 + drivers/usb/gadget/Kconfig | 9 +++++++++ drivers/usb/gadget/function/Makefile | 8 ++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/arm64/configs/vendor/lineage-a52q_defconfig b/arch/arm64/configs/vendor/lineage-a52q_defconfig index 9662cba7c4b2..1532ef6b1e68 100755 --- a/arch/arm64/configs/vendor/lineage-a52q_defconfig +++ b/arch/arm64/configs/vendor/lineage-a52q_defconfig @@ -4245,6 +4245,7 @@ CONFIG_USB_CONFIGFS_F_GSI=y CONFIG_USB_CONFIGFS_F_QDSS=y # CONFIG_USB_CONFIGFS_F_IPC is not set CONFIG_USB_DUN_SUPPORT=y +# CONFIG_USB_ANDROID_SAMSUNG_MTP is not set # # USB Power Delivery and Type-C drivers diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 88dbdd50b5fc..468363b69d3a 100755 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -727,6 +727,15 @@ config USB_CONFIGFS_F_MDM_DATA source "drivers/usb/gadget/legacy/Kconfig" +config USB_ANDROID_SAMSUNG_MTP + bool "Samsung MTP function" + depends on USB_G_ANDROID && !SEC_FACTORY + help + Provides Media Transfer Protocol (MTP) support + for samsung gadget driver. + If you enable this option, + google mtp will be changed to samsung mtp. + config USB_DUN_SUPPORT boolean "DUN support function" depends on USB_F_ACM diff --git a/drivers/usb/gadget/function/Makefile b/drivers/usb/gadget/function/Makefile index f221e1db4fc6..cca5f36da695 100755 --- a/drivers/usb/gadget/function/Makefile +++ b/drivers/usb/gadget/function/Makefile @@ -51,12 +51,12 @@ usb_f_printer-y := f_printer.o obj-$(CONFIG_USB_F_PRINTER) += usb_f_printer.o usb_f_tcm-y := f_tcm.o obj-$(CONFIG_USB_F_TCM) += usb_f_tcm.o -ifeq ($(CONFIG_SEC_FACTORY),y) -usb_f_mtp-y := f_mtp.o -obj-$(CONFIG_USB_F_MTP) += usb_f_mtp.o -else +ifeq ($(CONFIG_USB_ANDROID_SAMSUNG_MTP),y) usb_f_mtp_samsung-y := f_mtp_samsung.o obj-$(CONFIG_USB_F_MTP) += usb_f_mtp_samsung.o +else +usb_f_mtp-y := f_mtp.o +obj-$(CONFIG_USB_F_MTP) += usb_f_mtp.o endif usb_f_ptp-y := f_ptp.o obj-$(CONFIG_USB_F_PTP) += usb_f_ptp.o