mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Hans P. Möller Ebner" <hmoller@uc.cl>
To: alsa-devel@alsa-project.org
Cc: dev@andree.sk, stefanha@gmail.com, linux-kernel@vger.kernel.org,
	"Hans P . Moller" <hmoller@uc.cl>
Subject: [PATCH 2/2] ALSA:line6: remove unnecessary initialization to PODHD500X.
Date: Fri, 16 Jun 2017 14:14:17 -0400	[thread overview]
Message-ID: <1497636857-13944-2-git-send-email-hmoller@uc.cl> (raw)
In-Reply-To: <1497636857-13944-1-git-send-email-hmoller@uc.cl>

Body:
Remove Initialization from POD HD500X because it's not needed.
Every time the device is connected dmesg gives the following output: "receive length failed (error -11)".
To solve this problem, another flags is introduced (LINE6_CAP_CONTROL_INFO) and it is only used for PODX3 in: sysfs entries, call podhd_startup_finalize(pod) and disconnection.
With this patch the error disappear.

Signed-off-by: Hans P. Moller <hmoller@uc.cl>
---
 sound/usb/line6/driver.h |  2 ++
 sound/usb/line6/podhd.c  | 12 +++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/sound/usb/line6/driver.h b/sound/usb/line6/driver.h
index a5c2e9a..dc97895 100644
--- a/sound/usb/line6/driver.h
+++ b/sound/usb/line6/driver.h
@@ -117,6 +117,8 @@ enum {
 	LINE6_CAP_IN_NEEDS_OUT = 1 << 3,
 	/* device uses raw MIDI via USB (data endpoints) */
 	LINE6_CAP_CONTROL_MIDI = 1 << 4,
+	/* device provides low-level information */
+	LINE6_CAP_CONTROL_INFO = 1 << 5,
 };
 
 /*
diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c
index e389f92..49c034c 100644
--- a/sound/usb/line6/podhd.c
+++ b/sound/usb/line6/podhd.c
@@ -293,7 +293,7 @@ static void podhd_disconnect(struct usb_line6 *line6)
 {
 	struct usb_line6_podhd *pod = (struct usb_line6_podhd *)line6;
 
-	if (pod->line6.properties->capabilities & LINE6_CAP_CONTROL) {
+	if (pod->line6.properties->capabilities & LINE6_CAP_CONTROL_INFO) {
 		struct usb_interface *intf;
 
 		del_timer_sync(&pod->startup_timer);
@@ -333,7 +333,9 @@ static int podhd_init(struct usb_line6 *line6,
 				pod->line6.properties->ctrl_if, err);
 			return err;
 		}
-
+	}
+	
+	if (pod->line6.properties->capabilities & LINE6_CAP_CONTROL_INFO) {
 		/* create sysfs entries: */
 		err = snd_card_add_dev_attr(line6->card, &podhd_dev_attr_group);
 		if (err < 0)
@@ -350,7 +352,7 @@ static int podhd_init(struct usb_line6 *line6,
 			return err;
 	}
 
-	if (!(pod->line6.properties->capabilities & LINE6_CAP_CONTROL)) {
+	if (!(pod->line6.properties->capabilities & LINE6_CAP_CONTROL_INFO)) {
 		/* register USB audio system directly */
 		return podhd_startup_finalize(pod);
 	}
@@ -428,7 +430,7 @@ static const struct line6_properties podhd_properties_table[] = {
 	[LINE6_PODX3] = {
 		.id = "PODX3",
 		.name = "POD X3",
-		.capabilities	= LINE6_CAP_CONTROL
+		.capabilities	= LINE6_CAP_CONTROL | LINE6_CAP_CONTROL_INFO
 				| LINE6_CAP_PCM | LINE6_CAP_HWMON | LINE6_CAP_IN_NEEDS_OUT,
 		.altsetting = 1,
 		.ep_ctrl_r = 0x81,
@@ -440,7 +442,7 @@ static const struct line6_properties podhd_properties_table[] = {
 	[LINE6_PODX3LIVE] = {
 		.id = "PODX3LIVE",
 		.name = "POD X3 LIVE",
-		.capabilities	= LINE6_CAP_CONTROL
+		.capabilities	= LINE6_CAP_CONTROL | LINE6_CAP_CONTROL_INFO
 				| LINE6_CAP_PCM | LINE6_CAP_HWMON | LINE6_CAP_IN_NEEDS_OUT,
 		.altsetting = 1,
 		.ep_ctrl_r = 0x81,
-- 
2.7.4

  reply	other threads:[~2017-06-16 18:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 18:14 [PATCH 1/2] ALSA: line6: add support for POD HD500X Hans P. Möller Ebner
2017-06-16 18:14 ` Hans P. Möller Ebner [this message]
     [not found] ` <s5hd1a2ob35.wl-tiwai@suse.de>
     [not found]   ` <CALSLyV5gupzszWrBghO9+_FONH_3O0cy8GWi03WOjxBLsCjh5w@mail.gmail.com>
2017-06-17 21:20     ` [alsa-devel] " Takashi Iwai
     [not found]       ` <CALSLyV5yO-_ZYJs8ZV2jV9aaeZRXTnqLB62wvoo9gVGBM9O7MA@mail.gmail.com>
2017-06-20  6:11         ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497636857-13944-2-git-send-email-hmoller@uc.cl \
    --to=hmoller@uc.cl \
    --cc=alsa-devel@alsa-project.org \
    --cc=dev@andree.sk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®