summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/legacy/audio.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2014-07-22 19:58:42 +0200
committerFelipe Balbi <balbi@ti.com>2014-08-20 14:05:14 -0500
commitbcec9784dd78abfa9d8ca8b7144f6e37ea6abfd5 (patch)
tree789fc069ac48cbca4f9206bb0ce4c5e09b4bd5e2 /drivers/usb/gadget/legacy/audio.c
parent807dccdba5c157c7131772bb6bd9a114a2ed9760 (diff)
downloadop-kernel-dev-bcec9784dd78abfa9d8ca8b7144f6e37ea6abfd5.zip
op-kernel-dev-bcec9784dd78abfa9d8ca8b7144f6e37ea6abfd5.tar.gz
usb: gadget: f_uac1: use defined constants as defaults
When configfs support is added the values in question will have to be used in two different places. Substitute them with defined constants to avoid duplicating magic numbers. Tested-by: Sebastian Reimers <sebastian.reimers@googlemail.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/legacy/audio.c')
-rw-r--r--drivers/usb/gadget/legacy/audio.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/usb/gadget/legacy/audio.c b/drivers/usb/gadget/legacy/audio.c
index bb40b61..f46a395 100644
--- a/drivers/usb/gadget/legacy/audio.c
+++ b/drivers/usb/gadget/legacy/audio.c
@@ -54,9 +54,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
-#define FILE_PCM_PLAYBACK "/dev/snd/pcmC0D0p"
-#define FILE_PCM_CAPTURE "/dev/snd/pcmC0D0c"
-#define FILE_CONTROL "/dev/snd/controlC0"
+#include "u_uac1.h"
static char *fn_play = FILE_PCM_PLAYBACK;
module_param(fn_play, charp, S_IRUGO);
@@ -70,16 +68,15 @@ static char *fn_cntl = FILE_CONTROL;
module_param(fn_cntl, charp, S_IRUGO);
MODULE_PARM_DESC(fn_cntl, "Control device file name");
-#define OUT_EP_MAX_PACKET_SIZE 200
-static int req_buf_size = OUT_EP_MAX_PACKET_SIZE;
+static int req_buf_size = UAC1_OUT_EP_MAX_PACKET_SIZE;
module_param(req_buf_size, int, S_IRUGO);
MODULE_PARM_DESC(req_buf_size, "ISO OUT endpoint request buffer size");
-static int req_count = 256;
+static int req_count = UAC1_REQ_COUNT;
module_param(req_count, int, S_IRUGO);
MODULE_PARM_DESC(req_count, "ISO OUT endpoint request count");
-static int audio_buf_size = 48000;
+static int audio_buf_size = UAC1_AUDIO_BUF_SIZE;
module_param(audio_buf_size, int, S_IRUGO);
MODULE_PARM_DESC(audio_buf_size, "Audio buffer size");
#endif
@@ -111,10 +108,6 @@ static struct usb_function_instance *fi_uac1;
static struct usb_function *f_uac1;
#endif
-#ifdef CONFIG_GADGET_UAC1
-#include "u_uac1.h"
-#endif
-
/*-------------------------------------------------------------------------*/
/* DO NOT REUSE THESE IDs with a protocol-incompatible driver!! Ever!!
OpenPOWER on IntegriCloud