Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3429946ybi; Tue, 2 Jul 2019 07:38:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvlg+pbqE5URo5T6/w7Dpr7P4Pv0G5cmCcNy7G96yV+wmc0/fykSDrO/TwFU/UFFgDCa11 X-Received: by 2002:a65:5202:: with SMTP id o2mr28805201pgp.199.1562078332376; Tue, 02 Jul 2019 07:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562078332; cv=none; d=google.com; s=arc-20160816; b=P+9q4SjSq2txlQfFsVTkGR9sNBJ/jiSxDMfbxSuHIkoq1e6p0VKYhJiXlCWNaW6fTW cvTx5ulnrhJ9W6VcfHyHuMJyOVzTU7KJobb6Oeyp2qHbMYarchHzcosIB0TSyoqqWU98 ULjEt3+jWg4LZJYL1lsOmInbrJQMCJie24Gs4NHZ6q/a5lPEvRibAtS1ZVCyt/NAuj/d 7DWgaWO6Lng0imapjiy6ApECDGIvUQcbdm9IDjEs4foF+nuN+3addHB/dO/PfHSLrxSX qY246mpQe1uwL5HUjnTcmo5CGR6qCAsfGgpZIdzxbGpARxQW6wBaQy0ukdQg3nvdXxgh d/4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=jVuASrKWmvhCDWYnV8JvgIryR+2TQOa6s5qHu6+DKFI=; b=rIAs7CKGpJfeMVnCBLwmieT9azYrC8bkeK4umfkzI3WgtoYglf8MVb0IOVhlwdKWj1 Z6+K4VN24JI9VdMjxWnferCPZiIldwWCE9VKGiu9ww08EcHT8QVgcem5Es+bJvDBdSQs ZopoeR/XcpTLvG8jmOc62UqMXcKI0puQZRUPyjZHtrQvle3EWBe65/Hrx878AE2zKjjx QDb9OUCQHmtbZtnVsMQ2nPIrurF7m5d8o+3UPVxwFi9Yee4dVI4Arlq/gb4tykeLhCdh 5dTe8vSwGTW+xYWMBcyl8jKKE0PADsXuH5JDT90pdF4FXN94jQ8Ug1i21rjpb+nY3io1 KxTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2si12259186pll.374.2019.07.02.07.38.36; Tue, 02 Jul 2019 07:38:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727070AbfGBOhx (ORCPT + 99 others); Tue, 2 Jul 2019 10:37:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:38808 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726150AbfGBOhw (ORCPT ); Tue, 2 Jul 2019 10:37:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 88215BB26; Tue, 2 Jul 2019 14:37:45 +0000 (UTC) Date: Tue, 02 Jul 2019 16:37:40 +0200 Message-ID: From: Takashi Iwai To: "Nicola Lunghi" Cc: , , "Thomas Gleixner" , "Greg Kroah-Hartman" , "Allison Randal" , "Jaroslav Kysela" , "Richard Fontana" , "Jussi Laako" , Subject: Re: [PATCH] ALSA: usb-audio: fix Line6 Helix audio format rates In-Reply-To: <20190702004439.30131-1-nick83ola@gmail.com> References: <20190702004439.30131-1-nick83ola@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 02 Jul 2019 02:43:14 +0200, Nicola Lunghi wrote: > > Line6 Helix and HX stomp don't support retrieving > the number of clock sample rate. > > Add a quirk to return the default value of 48Khz. > > Signed-off-by: Nicola Lunghi It's not particularly good place to put a quirk, but there seems no other better place, unfortunately. Is this specific to certain unit or all I/Os on the device suffer from this problem? In anyway, if the behavior is expected, we don't need to use dev_warn() to annoy users unnecessarily. Replace it with dev_info(). Also, the code that creates a single 48k entry would be better to be put into a function for readability. Could you resubmit with that change? Thanks! Takashi > --- > sound/usb/format.c | 28 +++++++++++++++++++++++++--- > 1 file changed, 25 insertions(+), 3 deletions(-) > > diff --git a/sound/usb/format.c b/sound/usb/format.c > index c02b51a82775..05442f6ada62 100644 > --- a/sound/usb/format.c > +++ b/sound/usb/format.c > @@ -313,10 +313,32 @@ static int parse_audio_format_rates_v2v3(struct snd_usb_audio *chip, > tmp, sizeof(tmp)); > > if (ret < 0) { > - dev_err(&dev->dev, > - "%s(): unable to retrieve number of sample rates (clock %d)\n", > + switch (chip->usb_id) { > + /* LINE 6 HX pedals don't support getting the clock sample rate. > + * Set the framerate to 48khz by default > + */ > + case USB_ID(0x0E41, 0x4244): /* HELIX */ > + case USB_ID(0x0E41, 0x4246): /* HX STOMP */ > + dev_warn(&dev->dev, > + "%s(): line6 helix: unable to retrieve number of sample rates. Set it to default value (clock %d).\n", > __func__, clock); > - goto err; > + fp->nr_rates = 1; > + fp->rate_min = 48000; > + fp->rate_max = 48000; > + fp->rates = SNDRV_PCM_RATE_48000; > + fp->rate_table = kmalloc(sizeof(int), GFP_KERNEL); > + if (!fp->rate_table) { > + ret = -ENOMEM; > + goto err_free; > + } > + fp->rate_table[0] = 48000; > + return 0; > + default: > + dev_err(&dev->dev, > + "%s(): unable to retrieve number of sample rates (clock %d)\n", > + __func__, clock); > + goto err; > + } > } > > nr_triplets = (tmp[1] << 8) | tmp[0]; > -- > 2.19.1 > >