From patchwork Fri Jun 16 18:14:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans P Moller X-Patchwork-Id: 9792743 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 272A160326 for ; Fri, 16 Jun 2017 18:14:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 223242625B for ; Fri, 16 Jun 2017 18:14:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16FEF2866B; Fri, 16 Jun 2017 18:14:48 +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 6CDFD2625B for ; Fri, 16 Jun 2017 18:14:47 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3DF32266D14; Fri, 16 Jun 2017 20:14:31 +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 D615E266D08; Fri, 16 Jun 2017 20:14:30 +0200 (CEST) Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by alsa0.perex.cz (Postfix) with ESMTP id 3C7AB266D08 for ; Fri, 16 Jun 2017 20:14:27 +0200 (CEST) Received: by mail-qt0-f193.google.com with SMTP id w1so12010435qtg.0 for ; Fri, 16 Jun 2017 11:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=YhdzkfHWjovyWodSBwzQlMeYiEPb8sO5+BeqUYMkFTc=; b=oHT64sE1/O0QtmHcsvKg77h/ZRDn89xs4QxPtTZ0HPH8r65NG01xajnPCanvFWVgyT Q2yROOLph+zv4ctodAu6c0gR2DOKqtoxN5E3zEVMPhleAQ0hLfQ08MFzsqDU8wzESlLG eZbCfvdwXc9fuGaGk0rndHygeWTXhO+2LssTEfg9r9BLBP+gvHnDlK/ZAKF5nsRK/tyH n1PQaljPkLQpKpNDLAxAsORtcZR5pb1hc9qbNnfX5HPdz8aA9cF+vSitAjzgOFfGOXAI 4Yybew8yybfnXxkZNEuW1AEiYmN5r9KwrJaqh8zB+NyYja1d6VE2pSezoUNoPLb5t1+9 CTJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=YhdzkfHWjovyWodSBwzQlMeYiEPb8sO5+BeqUYMkFTc=; b=oIN59TN4lEgBBzv2CrrgLxNKfSZvOSpoB5YYZlZG91tHCgHX8UhtK96d/x0/Kl+Yru TUAnRFEwQ4E9BD68VpPuj4jCNzAapATqOuoHXNDT4YQwsyGHZV+m5X09B+6eQp1Wa8XI IC56jP17WT8kocAFauOagAC7uWH9hoHiNFe6JnYkdEuXofqz4BLAfF5Y8ByZDi46VeVd csgV85xYZyMaX9ZFK6wI48wtKQfoXlkXXAtNI4a4Iw3LQHiQl9wp8fd4PjuPHeTDTKVN IlCr5AaQ7gFLoCfTKgecNLsQ/hlRwnhJ07n9ymU4tF+/O0MfenLQ/Rp2rKPR77f5z3QE iRcw== X-Gm-Message-State: AKS2vOz/Uua+zsCd1LRe1QBPWetYTszxSqZ7I5+fKW3YcLqG5XgZyxuZ jYlJlf2vKENAVn76 X-Received: by 10.200.8.67 with SMTP id x3mr14344257qth.195.1497636867114; Fri, 16 Jun 2017 11:14:27 -0700 (PDT) Received: from localhost.localdomain (pc-182-206-241-201.cm.vtr.net. [201.241.206.182]) by smtp.googlemail.com with ESMTPSA id o3sm2083628qtb.57.2017.06.16.11.14.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Jun 2017 11:14:26 -0700 (PDT) From: =?UTF-8?q?Hans=20P=2E=20M=C3=B6ller=20Ebner?= To: alsa-devel@alsa-project.org Date: Fri, 16 Jun 2017 14:14:17 -0400 Message-Id: <1497636857-13944-2-git-send-email-hmoller@uc.cl> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497636857-13944-1-git-send-email-hmoller@uc.cl> References: <1497636857-13944-1-git-send-email-hmoller@uc.cl> Cc: stefanha@gmail.com, "Hans P . Moller" , dev@andree.sk, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 2/2] ALSA:line6: remove unnecessary initialization to PODHD500X. 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 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 --- 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,