Re: [PATCH v2 02/11] usb: gadget: u_audio: Support multiple sampling rates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 22, 2021 at 08:13:01AM +0100, Pavel Hofman wrote:
> Dne 21. 12. 21 v 12:35 John Keeping napsal(a):
> > On Mon, Dec 20, 2021 at 10:11:21PM +0100, Pavel Hofman wrote:
> > > From: Julian Scheel <julian@xxxxxxxx>
> > > 
> > > Implement support for multiple sampling rates in u_audio part of the
> > > audio gadget. The currently configured rates are exposed through
> > > read-only amixer controls 'Capture Rate' and 'Playback Rate'.
> > > 
> > > Signed-off-by: Julian Scheel <julian@xxxxxxxx>
> > > Signed-off-by: Pavel Hofman <pavel.hofman@xxxxxxxxxxx>
> > > ---
> > 
> > > diff --git a/drivers/usb/gadget/function/uac_common.h b/drivers/usb/gadget/function/uac_common.h
> > > new file mode 100644
> > > index 000000000000..3ecf89d6e814
> > > --- /dev/null
> > > +++ b/drivers/usb/gadget/function/uac_common.h
> > > @@ -0,0 +1,9 @@
> > > +/* SPDX-License-Identifier: GPL-2.0+ */
> > > +/*
> > > + */
> > > +
> > > +#ifndef UAC_COMMON_H
> > > +#define UAC_COMMON_H
> > > +
> > > +#define UAC_MAX_RATES 10 /* maximum number of rates configurable by f_uac1/2 */
> > 
> > Why a new header for this - doesn't it belong in u_audio.h?
> 
> The constant is used in subsequent patches in f_uac1.c, f_uac2.c, their
> headers u_uac1.h, u_uac2.h, and legacy/audio.c (which already includes
> u_uac1.h/u_uac2.h as needed). Since all occurences must use the same value,
> I did not know how to solve this without introducing a common header file,
> included in the existing headers u_audio.h, u_uac1.h, u_uac2.h. If there is
> a better way, I will be happy to use it, I do not like the extra common
> header file either. Thanks a lot for your help.

Ah, right - I hadn't accounted for UAC1.

Do you think anyone is using UAC1 these days?  I wonder if it makes
sense to just drop those changes and focus on UAC2.


John



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux