mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
UPSTREAM: usb: audio-v2: add ability to define feature unit descriptor
Similar to UAC1 spec, UAC2 feature unit descriptor
has variable size.
Current audio-v2 feature unit descriptor structure
is used for parsing descriptors, but can't be used
to define your own descriptor.
Add a new macro similar to what audio v1 already has.
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20210712125529.76070-2-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 235196743
(cherry picked from commit b48f8939b9)
Change-Id: Ifa8f979824d81ce6c269f34e0e1118cb4701493a
Signed-off-by: Luiz Matheus <luizmmat@motorola.com>
This commit is contained in:
parent
1002747429
commit
257d21b184
|
|
@ -156,6 +156,20 @@ struct uac2_feature_unit_descriptor {
|
||||||
__u8 bmaControls[]; /* variable length */
|
__u8 bmaControls[]; /* variable length */
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
#define UAC2_DT_FEATURE_UNIT_SIZE(ch) (6 + ((ch) + 1) * 4)
|
||||||
|
|
||||||
|
/* As above, but more useful for defining your own descriptors: */
|
||||||
|
#define DECLARE_UAC2_FEATURE_UNIT_DESCRIPTOR(ch) \
|
||||||
|
struct uac2_feature_unit_descriptor_##ch { \
|
||||||
|
__u8 bLength; \
|
||||||
|
__u8 bDescriptorType; \
|
||||||
|
__u8 bDescriptorSubtype; \
|
||||||
|
__u8 bUnitID; \
|
||||||
|
__u8 bSourceID; \
|
||||||
|
__le32 bmaControls[ch + 1]; \
|
||||||
|
__u8 iFeature; \
|
||||||
|
} __packed
|
||||||
|
|
||||||
/* 4.7.2.10 Effect Unit Descriptor */
|
/* 4.7.2.10 Effect Unit Descriptor */
|
||||||
|
|
||||||
struct uac2_effect_unit_descriptor {
|
struct uac2_effect_unit_descriptor {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user