* [PATCH] usb:gadget: f_uac1: fixed sync playback
@ 2021-10-22 14:03 Pavel Hofman
2021-10-25 7:19 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Hofman @ 2021-10-22 14:03 UTC (permalink / raw)
To: linux-usb
Cc: Pavel Hofman, Ruslan Bilovol, Felipe Balbi, Jerome Brunet,
Jack Pham, Greg Kroah-Hartman
The u_audio param fb_max was not set to its default value in f_uac1.c.
As a result the maximum value of Playback Pitch ctl was kept at 1000000,
not allowing to set faster playback pitch for UAC1.
The setting required moving the default constant UAC2_DEF_FB_MAX from
u_uac2.h to FBACK_FAST_MAX in u_audio.h as that header is common for
f_uac1.c and f_uac2.c.
Fixes: 6fec018 ("usb: gadget: u_audio.c: Adding Playback Pitch ctl for
sync playback")
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
---
Notes:
* for usb-next
drivers/usb/gadget/function/f_uac1.c | 1 +
drivers/usb/gadget/function/f_uac2.c | 3 ++-
drivers/usb/gadget/function/u_audio.h | 10 ++++++++--
drivers/usb/gadget/function/u_uac2.h | 1 -
4 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index 5b3502df4e13..03f50643fbba 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -1321,6 +1321,7 @@ static int f_audio_bind(struct usb_configuration *c, struct usb_function *f)
audio->params.c_fu.volume_res = audio_opts->c_volume_res;
}
audio->params.req_number = audio_opts->req_number;
+ audio->params.fb_max = FBACK_FAST_MAX;
if (FUOUT_EN(audio_opts) || FUIN_EN(audio_opts))
audio->notify = audio_notify;
diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index a5eedd88eee6..74d8b30ca176 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -15,6 +15,7 @@
#include <linux/module.h>
#include "u_audio.h"
+
#include "u_uac2.h"
/* UAC2 spec: 4.1 Audio Channel Cluster Descriptor */
@@ -1936,7 +1937,7 @@ static struct usb_function_instance *afunc_alloc_inst(void)
opts->c_volume_res = UAC2_DEF_RES_DB;
opts->req_number = UAC2_DEF_REQ_NUM;
- opts->fb_max = UAC2_DEF_FB_MAX;
+ opts->fb_max = FBACK_FAST_MAX;
return &opts->func_inst;
}
diff --git a/drivers/usb/gadget/function/u_audio.h b/drivers/usb/gadget/function/u_audio.h
index 001a79a46022..8dfdae1721cd 100644
--- a/drivers/usb/gadget/function/u_audio.h
+++ b/drivers/usb/gadget/function/u_audio.h
@@ -14,11 +14,17 @@
/*
* Same maximum frequency deviation on the slower side as in
* sound/usb/endpoint.c. Value is expressed in per-mil deviation.
- * The maximum deviation on the faster side will be provided as
- * parameter, as it impacts the endpoint required bandwidth.
*/
#define FBACK_SLOW_MAX 250
+/*
+ * Maximum frequency deviation on the faster side, default value for UAC1/2.
+ * Value is expressed in per-mil deviation.
+ * UAC2 provides the value as a parameter as it impacts the endpoint required
+ * bandwidth.
+ */
+#define FBACK_FAST_MAX 5
+
/* Feature Unit parameters */
struct uac_fu_params {
int id; /* Feature Unit ID */
diff --git a/drivers/usb/gadget/function/u_uac2.h b/drivers/usb/gadget/function/u_uac2.h
index a73b35774c44..e0c8e3513bfd 100644
--- a/drivers/usb/gadget/function/u_uac2.h
+++ b/drivers/usb/gadget/function/u_uac2.h
@@ -30,7 +30,6 @@
#define UAC2_DEF_RES_DB (1*256) /* 1 dB */
#define UAC2_DEF_REQ_NUM 2
-#define UAC2_DEF_FB_MAX 5
#define UAC2_DEF_INT_REQ_NUM 10
struct f_uac2_opts {
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] usb:gadget: f_uac1: fixed sync playback
2021-10-22 14:03 [PATCH] usb:gadget: f_uac1: fixed sync playback Pavel Hofman
@ 2021-10-25 7:19 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2021-10-25 7:19 UTC (permalink / raw)
To: Pavel Hofman
Cc: linux-usb, Ruslan Bilovol, Felipe Balbi, Jerome Brunet, Jack Pham
On Fri, Oct 22, 2021 at 04:03:39PM +0200, Pavel Hofman wrote:
> The u_audio param fb_max was not set to its default value in f_uac1.c.
> As a result the maximum value of Playback Pitch ctl was kept at 1000000,
> not allowing to set faster playback pitch for UAC1.
>
> The setting required moving the default constant UAC2_DEF_FB_MAX from
> u_uac2.h to FBACK_FAST_MAX in u_audio.h as that header is common for
> f_uac1.c and f_uac2.c.
>
> Fixes: 6fec018 ("usb: gadget: u_audio.c: Adding Playback Pitch ctl for
> sync playback")
Nit, in the future the format for this is:
Fixes: 6fec018a7e70 ("usb: gadget: u_audio.c: Adding Playback Pitch ctl for sync playback")
The kernel documentation about submitting patches should describe this.
I'll go hand-edit it, no worries this time.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-25 7:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-22 14:03 [PATCH] usb:gadget: f_uac1: fixed sync playback Pavel Hofman
2021-10-25 7:19 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.