From patchwork Thu Aug 18 22:20:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrej Krutak X-Patchwork-Id: 9288679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3E1B4600CB for ; Thu, 18 Aug 2016 22:26:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BA0228F7F for ; Thu, 18 Aug 2016 22:26:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CBE4291D5; Thu, 18 Aug 2016 22:26:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D26928F7F for ; Thu, 18 Aug 2016 22:26:23 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 47C72266E47; Fri, 19 Aug 2016 00:26:23 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6E961266BE8; Fri, 19 Aug 2016 00:22:32 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 46654266BCB; Fri, 19 Aug 2016 00:22:29 +0200 (CEST) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by alsa0.perex.cz (Postfix) with ESMTP id A9BE12664B6 for ; Fri, 19 Aug 2016 00:21:42 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id i5so1278020wmg.2 for ; Thu, 18 Aug 2016 15:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=z1iPJkpDtAhAH/5Z5oHo5nWMuqjGEA7wnhraqimhoW8=; b=khjTimT33XSvV/2xCAMwpKdmIVpBKz9PhpVksdydWhsmlkmB5Gyq6NLmqbFOjhCDY7 EfNiSWd2DqvlKHUN49kmHfeYNSYupTbD11UPgz9E5mG7+Jd5wOeIOEzujMlCYQ39LP7A xcPp/xlz+Lp7jQdSolPsNZJRVzJuhAXrxsH5HSbF7oQFhNrgsglfqG6cAoHKtuaSq6GR SgSw962XT27b+Z4JJykzmGGFHqLqPiNCKViPPM7juA9YDO97+BXyo9SgSsiLvURpFFNh eBU1P32IdDujYV4Z1ZTQzu4HmUn6ifrHOcZx1OWzelJmmHGsLePReScv7OIYBeAv4oXA Sxeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=z1iPJkpDtAhAH/5Z5oHo5nWMuqjGEA7wnhraqimhoW8=; b=hpYRGYffJt4oHgQwoaDSJcdvxENM6QblKtD7IGrN+ddfdboMsPmnthob+IH2fz9cu2 oVMZWM7vl4y+RxD1jkD8O8DewvvrkOeZGfjZbkfLecK9PsqTMwnOrXat8//15+Tju9Vt gO9T8XI4ktIh35Dt6xEQtwoFGn3TcjWvcf6Rhv/lzpChKzld63vpzj/Reh6CohtY7bDW QXl9+thMIt5CKzhKKA3TqJ+4RJsYDBZ49lv6ZXcEMWZCZxX3xzdrTP+pQeirfcYaJmAz 3NNYxWg0zU2rZPqVlzW1y6yg6kb8zpLAUAu/Nb4qD+PDWKwc0H+BVWqiBiUju32cFPiu mgag== X-Gm-Message-State: AEkoouttBC8005v8eziJyRoWNtgkv4qqetuiopJqX+9HjuXuq8+LT2A7wYUCmh4MdHlxiw== X-Received: by 10.28.41.6 with SMTP id p6mr1265609wmp.18.1471558902323; Thu, 18 Aug 2016 15:21:42 -0700 (PDT) Received: from andree.lan ([217.30.74.231]) by smtp.gmail.com with ESMTPSA id jv9sm4122380wjb.45.2016.08.18.15.21.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Aug 2016 15:21:41 -0700 (PDT) From: Andrej Krutak To: tiwai@suse.com, perex@perex.cz, stefanha@gmail.com, grabner@icg.tugraz.at, alsa-devel@alsa-project.org Date: Fri, 19 Aug 2016 00:20:33 +0200 Message-Id: <1471558839-14120-4-git-send-email-dev@andree.sk> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471558839-14120-1-git-send-email-dev@andree.sk> References: <1470942147-19848-1-git-send-email-dev@andree.sk> <1471558839-14120-1-git-send-email-dev@andree.sk> Cc: Andrej Krutak Subject: [alsa-devel] [PATCH v2 3/9] ALSA: line6: Distinguish device init (ctrl EP) and MIDI data transfer (int EP) X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP POD X3 can initialize similarly to older PODs, but it doesn't have the MIDI interface. Instead, configuration is done via proprietary bulk EP messages. Signed-off-by: Andrej Krutak --- sound/usb/line6/driver.c | 10 +++++----- sound/usb/line6/driver.h | 6 ++++-- sound/usb/line6/pod.c | 9 ++++++++- sound/usb/line6/variax.c | 6 ++++-- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c index efeb16a8..5fd6cad 100644 --- a/sound/usb/line6/driver.c +++ b/sound/usb/line6/driver.c @@ -482,7 +482,7 @@ static void line6_get_interval(struct usb_line6 *line6) } } -static int line6_init_cap_control(struct usb_line6 *line6) +static int line6_init_cap_control_midi(struct usb_line6 *line6) { int ret; @@ -572,8 +572,8 @@ int line6_probe(struct usb_interface *interface, line6_get_interval(line6); - if (properties->capabilities & LINE6_CAP_CONTROL) { - ret = line6_init_cap_control(line6); + if (properties->capabilities & LINE6_CAP_CONTROL_MIDI) { + ret = line6_init_cap_control_midi(line6); if (ret < 0) goto error; } @@ -643,7 +643,7 @@ int line6_suspend(struct usb_interface *interface, pm_message_t message) snd_power_change_state(line6->card, SNDRV_CTL_POWER_D3hot); - if (line6->properties->capabilities & LINE6_CAP_CONTROL) + if (line6->properties->capabilities & LINE6_CAP_CONTROL_MIDI) line6_stop_listen(line6); if (line6pcm != NULL) { @@ -662,7 +662,7 @@ int line6_resume(struct usb_interface *interface) { struct usb_line6 *line6 = usb_get_intfdata(interface); - if (line6->properties->capabilities & LINE6_CAP_CONTROL) + if (line6->properties->capabilities & LINE6_CAP_CONTROL_MIDI) line6_start_listen(line6); snd_power_change_state(line6->card, SNDRV_CTL_POWER_D0); diff --git a/sound/usb/line6/driver.h b/sound/usb/line6/driver.h index 69658dc..7aeb6ad 100644 --- a/sound/usb/line6/driver.h +++ b/sound/usb/line6/driver.h @@ -102,6 +102,8 @@ enum { LINE6_CAP_PCM = 1 << 1, /* device supports hardware monitoring */ LINE6_CAP_HWMON = 1 << 2, + /* device uses raw MIDI via USB (data endpoints) */ + LINE6_CAP_CONTROL_MIDI = 1 << 3, /* device requires output data when input is read */ LINE6_CAP_IN_NEEDS_OUT = 1 << 4, }; @@ -142,10 +144,10 @@ struct usb_line6 { /* Line 6 MIDI device data structure */ struct snd_line6_midi *line6midi; - /* URB for listening to PODxt Pro control endpoint */ + /* URB for listening to POD data endpoint */ struct urb *urb_listen; - /* Buffer for listening to PODxt Pro control endpoint */ + /* Buffer for listening to POD data endpoint */ unsigned char *buffer_listen; /* Buffer for message to be processed */ diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c index 36e7274..17aa616 100644 --- a/sound/usb/line6/pod.c +++ b/sound/usb/line6/pod.c @@ -475,6 +475,7 @@ static const struct line6_properties pod_properties_table[] = { .id = "BassPODxt", .name = "BassPODxt", .capabilities = LINE6_CAP_CONTROL + | LINE6_CAP_CONTROL_MIDI | LINE6_CAP_PCM | LINE6_CAP_HWMON, .altsetting = 5, @@ -487,6 +488,7 @@ static const struct line6_properties pod_properties_table[] = { .id = "BassPODxtLive", .name = "BassPODxt Live", .capabilities = LINE6_CAP_CONTROL + | LINE6_CAP_CONTROL_MIDI | LINE6_CAP_PCM | LINE6_CAP_HWMON, .altsetting = 1, @@ -499,6 +501,7 @@ static const struct line6_properties pod_properties_table[] = { .id = "BassPODxtPro", .name = "BassPODxt Pro", .capabilities = LINE6_CAP_CONTROL + | LINE6_CAP_CONTROL_MIDI | LINE6_CAP_PCM | LINE6_CAP_HWMON, .altsetting = 5, @@ -510,7 +513,8 @@ static const struct line6_properties pod_properties_table[] = { [LINE6_POCKETPOD] = { .id = "PocketPOD", .name = "Pocket POD", - .capabilities = LINE6_CAP_CONTROL, + .capabilities = LINE6_CAP_CONTROL + | LINE6_CAP_CONTROL_MIDI, .altsetting = 0, .ep_ctrl_r = 0x82, .ep_ctrl_w = 0x02, @@ -520,6 +524,7 @@ static const struct line6_properties pod_properties_table[] = { .id = "PODxt", .name = "PODxt", .capabilities = LINE6_CAP_CONTROL + | LINE6_CAP_CONTROL_MIDI | LINE6_CAP_PCM | LINE6_CAP_HWMON, .altsetting = 5, @@ -532,6 +537,7 @@ static const struct line6_properties pod_properties_table[] = { .id = "PODxtLive", .name = "PODxt Live", .capabilities = LINE6_CAP_CONTROL + | LINE6_CAP_CONTROL_MIDI | LINE6_CAP_PCM | LINE6_CAP_HWMON, .altsetting = 1, @@ -544,6 +550,7 @@ static const struct line6_properties pod_properties_table[] = { .id = "PODxtPro", .name = "PODxt Pro", .capabilities = LINE6_CAP_CONTROL + | LINE6_CAP_CONTROL_MIDI | LINE6_CAP_PCM | LINE6_CAP_HWMON, .altsetting = 5, diff --git a/sound/usb/line6/variax.c b/sound/usb/line6/variax.c index ddc23dd..0c4512d 100644 --- a/sound/usb/line6/variax.c +++ b/sound/usb/line6/variax.c @@ -259,7 +259,8 @@ static const struct line6_properties variax_properties_table[] = { [LINE6_PODXTLIVE_VARIAX] = { .id = "PODxtLive", .name = "PODxt Live", - .capabilities = LINE6_CAP_CONTROL, + .capabilities = LINE6_CAP_CONTROL + | LINE6_CAP_CONTROL_MIDI, .altsetting = 1, .ep_ctrl_r = 0x86, .ep_ctrl_w = 0x05, @@ -269,7 +270,8 @@ static const struct line6_properties variax_properties_table[] = { [LINE6_VARIAX] = { .id = "Variax", .name = "Variax Workbench", - .capabilities = LINE6_CAP_CONTROL, + .capabilities = LINE6_CAP_CONTROL + | LINE6_CAP_CONTROL_MIDI, .altsetting = 1, .ep_ctrl_r = 0x82, .ep_ctrl_w = 0x01,