Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3249ca22 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Felipe Balbi
Browse files

usb: gadget: u_serial: convert into a module



Every user of u_serial has now to select the U_SERIAL symbol instead of
including the file.
There is one limition with this: ports and and gs_tty_driver are global
variables in u_serial. Since all users share them, there can be only one
user loaded at a time i.e. either g_serial or g_nokia.

Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 48177cd8
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -503,6 +503,9 @@ config USB_LIBCOMPOSITE
config USB_F_SS_LB
config USB_F_SS_LB
	tristate
	tristate


config USB_U_SERIAL
	tristate

choice
choice
	tristate "USB Gadget Drivers"
	tristate "USB Gadget Drivers"
	default USB_ETH
	default USB_ETH
@@ -754,6 +757,7 @@ config USB_GADGET_TARGET


config USB_G_SERIAL
config USB_G_SERIAL
	tristate "Serial Gadget (with CDC ACM and CDC OBEX support)"
	tristate "Serial Gadget (with CDC ACM and CDC OBEX support)"
	select USB_U_SERIAL
	select USB_LIBCOMPOSITE
	select USB_LIBCOMPOSITE
	help
	help
	  The Serial Gadget talks to the Linux-USB generic serial driver.
	  The Serial Gadget talks to the Linux-USB generic serial driver.
@@ -807,6 +811,7 @@ config USB_CDC_COMPOSITE
	tristate "CDC Composite Device (Ethernet and ACM)"
	tristate "CDC Composite Device (Ethernet and ACM)"
	depends on NET
	depends on NET
	select USB_LIBCOMPOSITE
	select USB_LIBCOMPOSITE
	select USB_U_SERIAL
	help
	help
	  This driver provides two functions in one configuration:
	  This driver provides two functions in one configuration:
	  a CDC Ethernet (ECM) link, and a CDC ACM (serial port) link.
	  a CDC Ethernet (ECM) link, and a CDC ACM (serial port) link.
@@ -822,6 +827,7 @@ config USB_G_NOKIA
	tristate "Nokia composite gadget"
	tristate "Nokia composite gadget"
	depends on PHONET
	depends on PHONET
	select USB_LIBCOMPOSITE
	select USB_LIBCOMPOSITE
	select USB_U_SERIAL
	help
	help
	  The Nokia composite gadget provides support for acm, obex
	  The Nokia composite gadget provides support for acm, obex
	  and phonet in only one composite gadget driver.
	  and phonet in only one composite gadget driver.
@@ -833,6 +839,7 @@ config USB_G_ACM_MS
	tristate "CDC Composite Device (ACM and mass storage)"
	tristate "CDC Composite Device (ACM and mass storage)"
	depends on BLOCK
	depends on BLOCK
	select USB_LIBCOMPOSITE
	select USB_LIBCOMPOSITE
	select USB_U_SERIAL
	help
	help
	  This driver provides two functions in one configuration:
	  This driver provides two functions in one configuration:
	  a mass storage, and a CDC ACM (serial port) link.
	  a mass storage, and a CDC ACM (serial port) link.
@@ -845,6 +852,7 @@ config USB_G_MULTI
	depends on BLOCK && NET
	depends on BLOCK && NET
	select USB_G_MULTI_CDC if !USB_G_MULTI_RNDIS
	select USB_G_MULTI_CDC if !USB_G_MULTI_RNDIS
	select USB_LIBCOMPOSITE
	select USB_LIBCOMPOSITE
	select USB_U_SERIAL
	help
	help
	  The Multifunction Composite Gadget provides Ethernet (RNDIS
	  The Multifunction Composite Gadget provides Ethernet (RNDIS
	  and/or CDC Ethernet), mass storage and ACM serial link
	  and/or CDC Ethernet), mass storage and ACM serial link
@@ -920,6 +928,7 @@ config USB_G_DBGP_PRINTK


config USB_G_DBGP_SERIAL
config USB_G_DBGP_SERIAL
	depends on USB_G_DBGP
	depends on USB_G_DBGP
	select USB_U_SERIAL
	bool "serial"
	bool "serial"
	help
	help
	  Userland can interact using /dev/ttyGSxxx.
	  Userland can interact using /dev/ttyGSxxx.
+1 −0
Original line number Original line Diff line number Diff line
@@ -78,3 +78,4 @@ obj-$(CONFIG_USB_GADGET_TARGET) += tcm_usb_gadget.o
# USB Functions
# USB Functions
f_ss_lb-y			:= f_loopback.o f_sourcesink.o
f_ss_lb-y			:= f_loopback.o f_sourcesink.o
obj-$(CONFIG_USB_F_SS_LB)	+= f_ss_lb.o
obj-$(CONFIG_USB_F_SS_LB)	+= f_ss_lb.o
obj-$(CONFIG_USB_U_SERIAL)	+= u_serial.o
+0 −1
Original line number Original line Diff line number Diff line
@@ -41,7 +41,6 @@
 * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
 * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
 */
 */


#include "u_serial.c"
#include "f_acm.c"
#include "f_acm.c"
#include "f_mass_storage.c"
#include "f_mass_storage.c"


+0 −1
Original line number Original line Diff line number Diff line
@@ -43,7 +43,6 @@ USB_GADGET_COMPOSITE_OPTIONS();
 * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
 * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
 */
 */


#include "u_serial.c"
#include "f_acm.c"
#include "f_acm.c"
#include "f_ecm.c"
#include "f_ecm.c"
#include "u_ether.c"
#include "u_ether.c"
+1 −3
Original line number Original line Diff line number Diff line
@@ -13,9 +13,7 @@
#include <linux/usb/ch9.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/gadget.h>


#ifdef CONFIG_USB_G_DBGP_SERIAL
#include "u_serial.h"
#include "u_serial.c"
#endif


#define DRIVER_VENDOR_ID	0x0525 /* NetChip */
#define DRIVER_VENDOR_ID	0x0525 /* NetChip */
#define DRIVER_PRODUCT_ID	0xc0de /* undefined */
#define DRIVER_PRODUCT_ID	0xc0de /* undefined */
Loading