* [PATCH 0/2] Add support for the Axe-Fx III implicit fb setup
@ 2018-04-18 14:35 Alberto Aguirre
2018-04-18 14:35 ` [PATCH 1/2] ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk Alberto Aguirre
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Alberto Aguirre @ 2018-04-18 14:35 UTC (permalink / raw)
To: alsa-devel; +Cc: Alberto Aguirre
Some consolidation of repeated code in set_sync_ep_implicit_fb_quirk and a
quirk to support implicit feedback for the Axe-FX III
Alberto Aguirre (2):
ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk
ALSA: usb-audio: add implicit fb quirk for Axe-Fx III
sound/usb/pcm.c | 56 ++++++++++++++++++++++++--------------------------------
1 file changed, 24 insertions(+), 32 deletions(-)
--
2.14.1
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/2] ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk 2018-04-18 14:35 [PATCH 0/2] Add support for the Axe-Fx III implicit fb setup Alberto Aguirre @ 2018-04-18 14:35 ` Alberto Aguirre 2018-04-18 14:35 ` [PATCH 2/2] ALSA: usb-audio: add implicit fb quirk for Axe-Fx III Alberto Aguirre 2018-04-19 9:49 ` [PATCH 0/2] Add support for the Axe-Fx III implicit fb setup Takashi Iwai 2 siblings, 0 replies; 4+ messages in thread From: Alberto Aguirre @ 2018-04-18 14:35 UTC (permalink / raw) To: alsa-devel; +Cc: Alberto Aguirre Signed-off-by: Alberto Aguirre <albaguirre@gmail.com> --- sound/usb/pcm.c | 52 ++++++++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 3cbfae6604f9..c0746cc20ac4 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -321,6 +321,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, struct usb_host_interface *alts; struct usb_interface *iface; unsigned int ep; + unsigned int ifnum; /* Implicit feedback sync EPs consumers are always playback EPs */ if (subs->direction != SNDRV_PCM_STREAM_PLAYBACK) @@ -330,44 +331,23 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */ case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C600 */ ep = 0x81; - iface = usb_ifnum_to_if(dev, 3); - - if (!iface || iface->num_altsetting == 0) - return -EINVAL; - - alts = &iface->altsetting[1]; - goto add_sync_ep; - break; + ifnum = 3; + goto add_sync_ep_from_ifnum; case USB_ID(0x0763, 0x2080): /* M-Audio FastTrack Ultra */ case USB_ID(0x0763, 0x2081): ep = 0x81; - iface = usb_ifnum_to_if(dev, 2); - - if (!iface || iface->num_altsetting == 0) - return -EINVAL; - - alts = &iface->altsetting[1]; - goto add_sync_ep; - case USB_ID(0x2466, 0x8003): + ifnum = 2; + goto add_sync_ep_from_ifnum; + case USB_ID(0x2466, 0x8003): /* Fractal Audio Axe-Fx II */ ep = 0x86; - iface = usb_ifnum_to_if(dev, 2); - - if (!iface || iface->num_altsetting == 0) - return -EINVAL; - - alts = &iface->altsetting[1]; - goto add_sync_ep; - case USB_ID(0x1397, 0x0002): + ifnum = 2; + goto add_sync_ep_from_ifnum; + case USB_ID(0x1397, 0x0002): /* Behringer UFX1204 */ ep = 0x81; - iface = usb_ifnum_to_if(dev, 1); - - if (!iface || iface->num_altsetting == 0) - return -EINVAL; - - alts = &iface->altsetting[1]; - goto add_sync_ep; - + ifnum = 1; + goto add_sync_ep_from_ifnum; } + if (attr == USB_ENDPOINT_SYNC_ASYNC && altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC && altsd->bInterfaceProtocol == 2 && @@ -382,6 +362,14 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, /* No quirk */ return 0; +add_sync_ep_from_ifnum: + iface = usb_ifnum_to_if(dev, ifnum); + + if (!iface || iface->num_altsetting == 0) + return -EINVAL; + + alts = &iface->altsetting[1]; + add_sync_ep: subs->sync_endpoint = snd_usb_add_endpoint(subs->stream->chip, alts, ep, !subs->direction, -- 2.14.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ALSA: usb-audio: add implicit fb quirk for Axe-Fx III 2018-04-18 14:35 [PATCH 0/2] Add support for the Axe-Fx III implicit fb setup Alberto Aguirre 2018-04-18 14:35 ` [PATCH 1/2] ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk Alberto Aguirre @ 2018-04-18 14:35 ` Alberto Aguirre 2018-04-19 9:49 ` [PATCH 0/2] Add support for the Axe-Fx III implicit fb setup Takashi Iwai 2 siblings, 0 replies; 4+ messages in thread From: Alberto Aguirre @ 2018-04-18 14:35 UTC (permalink / raw) To: alsa-devel; +Cc: Alberto Aguirre The Axe-Fx III implicit feedback end point and the data sink endpoint are in different interface descriptors. Add quirk to ensure a sync endpoint is properly configured. Signed-off-by: Alberto Aguirre <albaguirre@gmail.com> --- sound/usb/pcm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index c0746cc20ac4..ad39b3cca247 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -342,6 +342,10 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, ep = 0x86; ifnum = 2; goto add_sync_ep_from_ifnum; + case USB_ID(0x2466, 0x8010): /* Fractal Audio Axe-Fx III */ + ep = 0x81; + ifnum = 2; + goto add_sync_ep_from_ifnum; case USB_ID(0x1397, 0x0002): /* Behringer UFX1204 */ ep = 0x81; ifnum = 1; -- 2.14.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] Add support for the Axe-Fx III implicit fb setup 2018-04-18 14:35 [PATCH 0/2] Add support for the Axe-Fx III implicit fb setup Alberto Aguirre 2018-04-18 14:35 ` [PATCH 1/2] ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk Alberto Aguirre 2018-04-18 14:35 ` [PATCH 2/2] ALSA: usb-audio: add implicit fb quirk for Axe-Fx III Alberto Aguirre @ 2018-04-19 9:49 ` Takashi Iwai 2 siblings, 0 replies; 4+ messages in thread From: Takashi Iwai @ 2018-04-19 9:49 UTC (permalink / raw) To: Alberto Aguirre; +Cc: alsa-devel On Wed, 18 Apr 2018 16:35:33 +0200, Alberto Aguirre wrote: > > Some consolidation of repeated code in set_sync_ep_implicit_fb_quirk and a > quirk to support implicit feedback for the Axe-FX III > > Alberto Aguirre (2): > ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk > ALSA: usb-audio: add implicit fb quirk for Axe-Fx III Applied both patches now. Thanks. Takashi ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-19 9:49 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-04-18 14:35 [PATCH 0/2] Add support for the Axe-Fx III implicit fb setup Alberto Aguirre 2018-04-18 14:35 ` [PATCH 1/2] ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk Alberto Aguirre 2018-04-18 14:35 ` [PATCH 2/2] ALSA: usb-audio: add implicit fb quirk for Axe-Fx III Alberto Aguirre 2018-04-19 9:49 ` [PATCH 0/2] Add support for the Axe-Fx III implicit fb setup Takashi Iwai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox