summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/legacy
diff options
context:
space:
mode:
authorRuslan Bilovol <ruslan.bilovol@gmail.com>2017-06-18 16:23:53 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-06-19 09:22:47 +0300
commitd355339eecd986648420e05f8c958fbc78dbb382 (patch)
treede6e2523a86a7a73aa9fdc3a49064f597f79c271 /drivers/usb/gadget/legacy
parenteb9fecb9e69b0be8c267c55b0bb52a08e8fb6bee (diff)
usb: gadget: function: make current f_uac1 implementation legacy
Before introducing new f_uac1 function (with virtual ALSA card) make current implementation legacy. This includes renaming of existing files, some variables, config options and documentation Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/legacy')
-rw-r--r--drivers/usb/gadget/legacy/Kconfig6
-rw-r--r--drivers/usb/gadget/legacy/audio.c26
2 files changed, 16 insertions, 16 deletions
diff --git a/drivers/usb/gadget/legacy/Kconfig b/drivers/usb/gadget/legacy/Kconfig
index 5344064f5721..87bacb638a9c 100644
--- a/drivers/usb/gadget/legacy/Kconfig
+++ b/drivers/usb/gadget/legacy/Kconfig
@@ -54,8 +54,8 @@ config USB_AUDIO
depends on SND
select USB_LIBCOMPOSITE
select SND_PCM
- select USB_F_UAC1 if GADGET_UAC1
- select USB_F_UAC2 if !GADGET_UAC1
+ select USB_F_UAC1_LEGACY if GADGET_UAC1_LEGACY
+ select USB_F_UAC2 if !GADGET_UAC1_LEGACY
select USB_U_AUDIO if USB_F_UAC2
help
This Gadget Audio driver is compatible with USB Audio Class
@@ -73,7 +73,7 @@ config USB_AUDIO
Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "g_audio".
-config GADGET_UAC1
+config GADGET_UAC1_LEGACY
bool "UAC 1.0 (Legacy)"
depends on USB_AUDIO
help
diff --git a/drivers/usb/gadget/legacy/audio.c b/drivers/usb/gadget/legacy/audio.c
index 8a39f42a4d56..bf5592a5b9e9 100644
--- a/drivers/usb/gadget/legacy/audio.c
+++ b/drivers/usb/gadget/legacy/audio.c
@@ -20,7 +20,7 @@
USB_GADGET_COMPOSITE_OPTIONS();
-#ifndef CONFIG_GADGET_UAC1
+#ifndef CONFIG_GADGET_UAC1_LEGACY
#include "u_uac2.h"
/* Playback(USB-IN) Default Stereo - Fl/Fr */
@@ -53,7 +53,7 @@ static int c_ssize = UAC2_DEF_CSSIZE;
module_param(c_ssize, uint, S_IRUGO);
MODULE_PARM_DESC(c_ssize, "Capture Sample Size(bytes)");
#else
-#include "u_uac1.h"
+#include "u_uac1_legacy.h"
static char *fn_play = FILE_PCM_PLAYBACK;
module_param(fn_play, charp, S_IRUGO);
@@ -99,7 +99,7 @@ static struct usb_gadget_strings *audio_strings[] = {
NULL,
};
-#ifndef CONFIG_GADGET_UAC1
+#ifndef CONFIG_GADGET_UAC1_LEGACY
static struct usb_function_instance *fi_uac2;
static struct usb_function *f_uac2;
#else
@@ -125,7 +125,7 @@ static struct usb_device_descriptor device_desc = {
/* .bcdUSB = DYNAMIC */
-#ifdef CONFIG_GADGET_UAC1
+#ifdef CONFIG_GADGET_UAC1_LEGACY
.bDeviceClass = USB_CLASS_PER_INTERFACE,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
@@ -164,7 +164,7 @@ static int audio_do_config(struct usb_configuration *c)
c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
}
-#ifdef CONFIG_GADGET_UAC1
+#ifdef CONFIG_GADGET_UAC1_LEGACY
f_uac1 = usb_get_function(fi_uac1);
if (IS_ERR(f_uac1)) {
status = PTR_ERR(f_uac1);
@@ -204,24 +204,24 @@ static struct usb_configuration audio_config_driver = {
static int audio_bind(struct usb_composite_dev *cdev)
{
-#ifndef CONFIG_GADGET_UAC1
+#ifndef CONFIG_GADGET_UAC1_LEGACY
struct f_uac2_opts *uac2_opts;
#else
- struct f_uac1_opts *uac1_opts;
+ struct f_uac1_legacy_opts *uac1_opts;
#endif
int status;
-#ifndef CONFIG_GADGET_UAC1
+#ifndef CONFIG_GADGET_UAC1_LEGACY
fi_uac2 = usb_get_function_instance("uac2");
if (IS_ERR(fi_uac2))
return PTR_ERR(fi_uac2);
#else
- fi_uac1 = usb_get_function_instance("uac1");
+ fi_uac1 = usb_get_function_instance("uac1_legacy");
if (IS_ERR(fi_uac1))
return PTR_ERR(fi_uac1);
#endif
-#ifndef CONFIG_GADGET_UAC1
+#ifndef CONFIG_GADGET_UAC1_LEGACY
uac2_opts = container_of(fi_uac2, struct f_uac2_opts, func_inst);
uac2_opts->p_chmask = p_chmask;
uac2_opts->p_srate = p_srate;
@@ -231,7 +231,7 @@ static int audio_bind(struct usb_composite_dev *cdev)
uac2_opts->c_ssize = c_ssize;
uac2_opts->req_number = UAC2_DEF_REQ_NUM;
#else
- uac1_opts = container_of(fi_uac1, struct f_uac1_opts, func_inst);
+ uac1_opts = container_of(fi_uac1, struct f_uac1_legacy_opts, func_inst);
uac1_opts->fn_play = fn_play;
uac1_opts->fn_cap = fn_cap;
uac1_opts->fn_cntl = fn_cntl;
@@ -269,7 +269,7 @@ fail_otg_desc:
kfree(otg_desc[0]);
otg_desc[0] = NULL;
fail:
-#ifndef CONFIG_GADGET_UAC1
+#ifndef CONFIG_GADGET_UAC1_LEGACY
usb_put_function_instance(fi_uac2);
#else
usb_put_function_instance(fi_uac1);
@@ -279,7 +279,7 @@ fail:
static int audio_unbind(struct usb_composite_dev *cdev)
{
-#ifdef CONFIG_GADGET_UAC1
+#ifdef CONFIG_GADGET_UAC1_LEGACY
if (!IS_ERR_OR_NULL(f_uac1))
usb_put_function(f_uac1);
if (!IS_ERR_OR_NULL(fi_uac1))