Re: [PATCH v2 02/11] usb: gadget: u_audio: Support multiple sampling rates
From: Pavel Hofman <hidden>
Date: 2021-12-22 07:13:12
Dne 21. 12. 21 v 12:35 John Keeping napsal(a):
On Mon, Dec 20, 2021 at 10:11:21PM +0100, Pavel Hofman wrote:quoted
From: Julian Scheel <redacted> 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 <redacted> Signed-off-by: Pavel Hofman <redacted> ---quoted
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. Pavel.