From: Takashi Iwai Subject: Re: [PATCH] ALSA: usb-audio: Expose sample resolution through proc interface Date: Mon, 18 Feb 2019 09:40:47 +0100 Message-ID: References: <20190217221721.6396-1-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 B666A266B48 for ; Mon, 18 Feb 2019 09:40:47 +0100 (CET) In-Reply-To: <20190217221721.6396-1-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 Sun, 17 Feb 2019 23:17:21 +0100, Jussi Laako wrote: > > At least some USB devices use (MSB-aligned) audio format larger > than the actual resolution of the device. In order to expose the > actual device resolution (bBitResolution), add extra field to the > procfs stream info interface. > > Signed-off-by: Jussi Laako The code change looks but, just some minor issues: > --- > sound/usb/card.h | 1 + > sound/usb/format.c | 2 ++ > sound/usb/proc.c | 1 + > 3 files changed, 4 insertions(+) > > diff --git a/sound/usb/card.h b/sound/usb/card.h > index ac785d15ced4..d9bb2c4a3bd9 100644 > --- a/sound/usb/card.h > +++ b/sound/usb/card.h > @@ -14,6 +14,7 @@ struct audioformat { > u64 formats; /* ALSA format bits */ > unsigned int channels; /* # channels */ > unsigned int fmt_type; /* USB audio format type (1-3) */ > + unsigned int fmt_bits; /* number of significant bits */ Please use tabs. checkpatch will catch such a problem, so please run it at the next time before submission. > unsigned int frame_size; /* samples per frame for non-audio */ > int iface; /* interface number */ > unsigned char altsetting; /* corresponding alternate setting */ > diff --git a/sound/usb/format.c b/sound/usb/format.c > index fd13ac11b136..d5b7cbcc2956 100644 > --- a/sound/usb/format.c > +++ b/sound/usb/format.c > @@ -87,6 +87,8 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, > } > } > > + fp->fmt_bits = (unsigned int) sample_width; Such cast is superfluous in Linux kernel code. I applied the patch with these fixed locally. Thanks! Takashi