From: Takashi Iwai Subject: Re: [PATCH v3 1/1] ALSA: usb-audio: Add custom mixer status quirks for RME CC devices Date: Fri, 05 Oct 2018 09:21:11 +0200 Message-ID: References: <20181005070130.7639-1-jussi@sonarnerd.net> <20181005070130.7639-2-jussi@sonarnerd.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 880542677F0 for ; Fri, 5 Oct 2018 09:21:11 +0200 (CEST) In-Reply-To: <20181005070130.7639-2-jussi@sonarnerd.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Jussi Laako Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Fri, 05 Oct 2018 09:01:30 +0200, Jussi Laako wrote: > > Adds several vendor specific mixer quirks for RME's Class Compliant > USB devices. These provide extra status information from the device > otherwise not available. > > These include AES/SPDIF rate and status information, current system > sampling rate and measured frequency. This information is especially > useful in cases where device's clock is slaved to external clock > source. > > Signed-off-by: Jussi Laako Thanks, this one looks better now. > +static const u32 snd_rme_rate_table[] = { > + 32000, 44100, 48000, 50000, > + 64000, 88200, 96000, 100000, > + 128000, 176400, 192000, 200000, > + 256000, 352800, 384000, 400000, > + 512000, 705600, 768000, 800000 > +}; > +#define SND_RME_RATE_IDX_AES_SPDIF_NUM 12 Maybe better to explain this 12 corresponds up to 20000Hz in the table above. > +static int snd_rme_rate_get(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{ > + u32 status1; > + u32 rate = 0; > + int idx; > + int err; > + > + err = snd_rme_get_status1(kcontrol, &status1); > + if (err < 0) > + return err; > + switch (kcontrol->private_value) > + { This brace should be in switch() line. Always better to run checkpatch.pl before submission :) thanks, Takashi