Commit 721e2e91 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Felipe Balbi

usb: gadget: libcomposite: move composite.c into libcomposite

This moves composite.c into libcomposite and updates all gadgets.
Finally!
Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent cc2683c3
...@@ -5,7 +5,8 @@ ccflags-$(CONFIG_USB_GADGET_DEBUG) := -DDEBUG ...@@ -5,7 +5,8 @@ ccflags-$(CONFIG_USB_GADGET_DEBUG) := -DDEBUG
obj-$(CONFIG_USB_GADGET) += udc-core.o obj-$(CONFIG_USB_GADGET) += udc-core.o
obj-$(CONFIG_USB_LIBCOMPOSITE) += libcomposite.o obj-$(CONFIG_USB_LIBCOMPOSITE) += libcomposite.o
libcomposite-y := usbstring.o config.o epautoconf.o gadget_chips.o libcomposite-y := usbstring.o config.o epautoconf.o
libcomposite-y += gadget_chips.o composite.o
obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o
obj-$(CONFIG_USB_NET2272) += net2272.o obj-$(CONFIG_USB_NET2272) += net2272.o
obj-$(CONFIG_USB_NET2280) += net2280.o obj-$(CONFIG_USB_NET2280) += net2280.o
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include "u_serial.h" #include "u_serial.h"
...@@ -40,7 +41,6 @@ ...@@ -40,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 "composite.c"
#include "u_serial.c" #include "u_serial.c"
#include "f_acm.c" #include "f_acm.c"
#include "f_mass_storage.c" #include "f_mass_storage.c"
......
...@@ -12,22 +12,13 @@ ...@@ -12,22 +12,13 @@
/* #define VERBOSE_DEBUG */ /* #define VERBOSE_DEBUG */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/usb/composite.h> #include <linux/usb/composite.h>
#include "gadget_chips.h" #include "gadget_chips.h"
#define DRIVER_DESC "Linux USB Audio Gadget" #define DRIVER_DESC "Linux USB Audio Gadget"
#define DRIVER_VERSION "Feb 2, 2012" #define DRIVER_VERSION "Feb 2, 2012"
/*-------------------------------------------------------------------------*/
/*
* Kbuild is not very cooperative with respect to linking separately
* compiled library objects into one module. So for now we won't use
* separate compilation ... ensuring init/exit sections work to shrink
* the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/
#include "composite.c"
USB_GADGET_COMPOSITE_OPTIONS(); USB_GADGET_COMPOSITE_OPTIONS();
/* string IDs are assigned dynamically */ /* string IDs are assigned dynamically */
......
...@@ -43,7 +43,6 @@ USB_GADGET_COMPOSITE_OPTIONS(); ...@@ -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 "composite.c"
#include "u_serial.c" #include "u_serial.c"
#include "f_acm.c" #include "f_acm.c"
#include "f_ecm.c" #include "f_ecm.c"
......
...@@ -154,6 +154,7 @@ int config_ep_by_speed(struct usb_gadget *g, ...@@ -154,6 +154,7 @@ int config_ep_by_speed(struct usb_gadget *g,
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(config_ep_by_speed);
/** /**
* usb_add_function() - add a function to a configuration * usb_add_function() - add a function to a configuration
...@@ -212,6 +213,7 @@ int usb_add_function(struct usb_configuration *config, ...@@ -212,6 +213,7 @@ int usb_add_function(struct usb_configuration *config,
function->name, function, value); function->name, function, value);
return value; return value;
} }
EXPORT_SYMBOL_GPL(usb_add_function);
/** /**
* usb_function_deactivate - prevent function and gadget enumeration * usb_function_deactivate - prevent function and gadget enumeration
...@@ -248,6 +250,7 @@ int usb_function_deactivate(struct usb_function *function) ...@@ -248,6 +250,7 @@ int usb_function_deactivate(struct usb_function *function)
spin_unlock_irqrestore(&cdev->lock, flags); spin_unlock_irqrestore(&cdev->lock, flags);
return status; return status;
} }
EXPORT_SYMBOL_GPL(usb_function_deactivate);
/** /**
* usb_function_activate - allow function and gadget enumeration * usb_function_activate - allow function and gadget enumeration
...@@ -278,6 +281,7 @@ int usb_function_activate(struct usb_function *function) ...@@ -278,6 +281,7 @@ int usb_function_activate(struct usb_function *function)
spin_unlock_irqrestore(&cdev->lock, flags); spin_unlock_irqrestore(&cdev->lock, flags);
return status; return status;
} }
EXPORT_SYMBOL_GPL(usb_function_activate);
/** /**
* usb_interface_id() - allocate an unused interface ID * usb_interface_id() - allocate an unused interface ID
...@@ -314,6 +318,7 @@ int usb_interface_id(struct usb_configuration *config, ...@@ -314,6 +318,7 @@ int usb_interface_id(struct usb_configuration *config,
} }
return -ENODEV; return -ENODEV;
} }
EXPORT_SYMBOL_GPL(usb_interface_id);
static int config_buf(struct usb_configuration *config, static int config_buf(struct usb_configuration *config,
enum usb_device_speed speed, void *buf, u8 type) enum usb_device_speed speed, void *buf, u8 type)
...@@ -754,6 +759,7 @@ int usb_add_config(struct usb_composite_dev *cdev, ...@@ -754,6 +759,7 @@ int usb_add_config(struct usb_composite_dev *cdev,
config->bConfigurationValue, status); config->bConfigurationValue, status);
return status; return status;
} }
EXPORT_SYMBOL_GPL(usb_add_config);
static void remove_config(struct usb_composite_dev *cdev, static void remove_config(struct usb_composite_dev *cdev,
struct usb_configuration *config) struct usb_configuration *config)
...@@ -947,6 +953,7 @@ int usb_string_id(struct usb_composite_dev *cdev) ...@@ -947,6 +953,7 @@ int usb_string_id(struct usb_composite_dev *cdev)
} }
return -ENODEV; return -ENODEV;
} }
EXPORT_SYMBOL_GPL(usb_string_id);
/** /**
* usb_string_ids() - allocate unused string IDs in batch * usb_string_ids() - allocate unused string IDs in batch
...@@ -978,6 +985,7 @@ int usb_string_ids_tab(struct usb_composite_dev *cdev, struct usb_string *str) ...@@ -978,6 +985,7 @@ int usb_string_ids_tab(struct usb_composite_dev *cdev, struct usb_string *str)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(usb_string_ids_tab);
/** /**
* usb_string_ids_n() - allocate unused string IDs in batch * usb_string_ids_n() - allocate unused string IDs in batch
...@@ -1006,7 +1014,7 @@ int usb_string_ids_n(struct usb_composite_dev *c, unsigned n) ...@@ -1006,7 +1014,7 @@ int usb_string_ids_n(struct usb_composite_dev *c, unsigned n)
c->next_string_id += n; c->next_string_id += n;
return next + 1; return next + 1;
} }
EXPORT_SYMBOL_GPL(usb_string_ids_n);
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -1572,6 +1580,7 @@ int usb_composite_probe(struct usb_composite_driver *driver) ...@@ -1572,6 +1580,7 @@ int usb_composite_probe(struct usb_composite_driver *driver)
return usb_gadget_probe_driver(gadget_driver); return usb_gadget_probe_driver(gadget_driver);
} }
EXPORT_SYMBOL_GPL(usb_composite_probe);
/** /**
* usb_composite_unregister() - unregister a composite driver * usb_composite_unregister() - unregister a composite driver
...@@ -1584,6 +1593,7 @@ void usb_composite_unregister(struct usb_composite_driver *driver) ...@@ -1584,6 +1593,7 @@ void usb_composite_unregister(struct usb_composite_driver *driver)
{ {
usb_gadget_unregister_driver(&driver->gadget_driver); usb_gadget_unregister_driver(&driver->gadget_driver);
} }
EXPORT_SYMBOL_GPL(usb_composite_unregister);
/** /**
* usb_composite_setup_continue() - Continue with the control transfer * usb_composite_setup_continue() - Continue with the control transfer
...@@ -1620,6 +1630,7 @@ void usb_composite_setup_continue(struct usb_composite_dev *cdev) ...@@ -1620,6 +1630,7 @@ void usb_composite_setup_continue(struct usb_composite_dev *cdev)
spin_unlock_irqrestore(&cdev->lock, flags); spin_unlock_irqrestore(&cdev->lock, flags);
} }
EXPORT_SYMBOL_GPL(usb_composite_setup_continue);
static char *composite_default_mfr(struct usb_gadget *gadget) static char *composite_default_mfr(struct usb_gadget *gadget)
{ {
...@@ -1672,3 +1683,4 @@ void usb_composite_overwrite_options(struct usb_composite_dev *cdev, ...@@ -1672,3 +1683,4 @@ void usb_composite_overwrite_options(struct usb_composite_dev *cdev,
dev_str[USB_GADGET_PRODUCT_IDX].s = covr->product; dev_str[USB_GADGET_PRODUCT_IDX].s = covr->product;
} }
} }
EXPORT_SYMBOL_GPL(usb_composite_overwrite_options);
...@@ -100,8 +100,6 @@ static inline bool has_rndis(void) ...@@ -100,8 +100,6 @@ static inline bool has_rndis(void)
* the runtime footprint, and giving us at least some parts of what * the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would. * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/ */
#include "composite.c"
#include "f_ecm.c" #include "f_ecm.c"
#include "f_subset.c" #include "f_subset.c"
#ifdef USB_ETH_RNDIS #ifdef USB_ETH_RNDIS
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/sched.h>
#include <linux/usb/g_hid.h> #include <linux/usb/g_hid.h>
static int major, minors; static int major, minors;
......
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
* the runtime footprint, and giving us at least some parts of what * the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would. * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/ */
#include "composite.c"
#if defined CONFIG_USB_FUNCTIONFS_ETH || defined CONFIG_USB_FUNCTIONFS_RNDIS #if defined CONFIG_USB_FUNCTIONFS_ETH || defined CONFIG_USB_FUNCTIONFS_RNDIS
# if defined USB_ETH_RNDIS # if defined USB_ETH_RNDIS
# undef USB_ETH_RNDIS # undef USB_ETH_RNDIS
......
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
#include <sound/rawmidi.h> #include <sound/rawmidi.h>
#include <linux/usb/ch9.h> #include <linux/usb/ch9.h>
#include <linux/usb/composite.h>
#include <linux/usb/gadget.h> #include <linux/usb/gadget.h>
#include <linux/usb/audio.h> #include <linux/usb/audio.h>
#include <linux/usb/midi.h> #include <linux/usb/midi.h>
#include "gadget_chips.h" #include "gadget_chips.h"
#include "composite.c"
#include "f_midi.c" #include "f_midi.c"
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/module.h>
#include <linux/usb/composite.h>
#include "gadget_chips.h" #include "gadget_chips.h"
#define DRIVER_DESC "HID Gadget" #define DRIVER_DESC "HID Gadget"
...@@ -34,9 +36,6 @@ ...@@ -34,9 +36,6 @@
* the runtime footprint, and giving us at least some parts of what * the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would. * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/ */
#include "composite.c"
#include "f_hid.c" #include "f_hid.c"
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/usb/ch9.h> #include <linux/usb/ch9.h>
#include <linux/module.h>
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -45,8 +46,6 @@ ...@@ -45,8 +46,6 @@
* the runtime footprint, and giving us at least some parts of what * the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would. * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/ */
#include "composite.c"
#include "f_mass_storage.c" #include "f_mass_storage.c"
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
......
...@@ -40,9 +40,6 @@ MODULE_LICENSE("GPL"); ...@@ -40,9 +40,6 @@ MODULE_LICENSE("GPL");
* the runtime footprint, and giving us at least some parts of what * the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would. * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/ */
#include "composite.c"
#include "f_mass_storage.c" #include "f_mass_storage.c"
#include "u_serial.c" #include "u_serial.c"
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
/* #define VERBOSE_DEBUG */ /* #define VERBOSE_DEBUG */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/usb/composite.h>
#include "u_ether.h" #include "u_ether.h"
...@@ -34,8 +36,6 @@ ...@@ -34,8 +36,6 @@
* the runtime footprint, and giving us at least some parts of what * the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would. * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/ */
#include "composite.c"
#include "f_ncm.c" #include "f_ncm.c"
#include "u_ether.c" #include "u_ether.c"
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
* the runtime footprint, and giving us at least some parts of what * the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would. * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/ */
#include "composite.c"
#include "u_serial.c" #include "u_serial.c"
#include "f_acm.c" #include "f_acm.c"
#include "f_ecm.c" #include "f_ecm.c"
......
...@@ -37,22 +37,12 @@ ...@@ -37,22 +37,12 @@
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <linux/usb/ch9.h> #include <linux/usb/ch9.h>
#include <linux/usb/composite.h>
#include <linux/usb/gadget.h> #include <linux/usb/gadget.h>
#include <linux/usb/g_printer.h> #include <linux/usb/g_printer.h>
#include "gadget_chips.h" #include "gadget_chips.h"
/*
* Kbuild is not very cooperative with respect to linking separately
* compiled library objects into one module. So for now we won't use
* separate compilation ... ensuring init/exit sections work to shrink
* the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/
#include "composite.c"
/*-------------------------------------------------------------------------*/
USB_GADGET_COMPOSITE_OPTIONS(); USB_GADGET_COMPOSITE_OPTIONS();
#define DRIVER_DESC "Printer Gadget" #define DRIVER_DESC "Printer Gadget"
......
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
* the runtime footprint, and giving us at least some parts of what * the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would. * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/ */
#include "composite.c"
#include "f_acm.c" #include "f_acm.c"
#include "f_obex.c" #include "f_obex.c"
#include "f_serial.c" #include "f_serial.c"
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <target/configfs_macros.h> #include <target/configfs_macros.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include "composite.c"
#include "tcm_usb_gadget.h" #include "tcm_usb_gadget.h"
USB_GADGET_COMPOSITE_OPTIONS(); USB_GADGET_COMPOSITE_OPTIONS();
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
* the runtime footprint, and giving us at least some parts of what * the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would. * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/ */
#include "composite.c"
#include "uvc_queue.c" #include "uvc_queue.c"
#include "uvc_video.c" #include "uvc_video.c"
#include "uvc_v4l2.c" #include "uvc_v4l2.c"
......
...@@ -57,8 +57,6 @@ ...@@ -57,8 +57,6 @@
* the runtime footprint, and giving us at least some parts of what * the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would. * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/ */
#include "composite.c"
#include "f_sourcesink.c" #include "f_sourcesink.c"
#include "f_loopback.c" #include "f_loopback.c"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment