mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
usb: gadget: uac: add sample rate to attribute of uevent
Add sample rate to attribute of uevent when receive the command of set interface. Change-Id: I9cea17ebe57441209a99dec0b1dc279e274accc3 Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
This commit is contained in:
@@ -340,13 +340,19 @@ static inline struct audio_dev *func_to_audio(struct usb_function *f)
|
||||
static void audio_source_work(struct work_struct *data)
|
||||
{
|
||||
struct audio_dev *audio = container_of(data, struct audio_dev, work);
|
||||
char *set_interface[3] = { "USB_STATE=SET_INTERFACE", NULL, NULL};
|
||||
char buffer[64];
|
||||
char *set_interface[4] = { "USB_STATE=SET_INTERFACE", NULL, NULL,
|
||||
NULL };
|
||||
char **uevent_envp = NULL;
|
||||
|
||||
if (audio->alt)
|
||||
set_interface[1] = "1";
|
||||
set_interface[1] = "STREAM_STATE=ON";
|
||||
else
|
||||
set_interface[1] = "0";
|
||||
set_interface[1] = "STREAM_STATE=OFF";
|
||||
|
||||
sprintf(buffer, "SAMPLE_RATE=%lld", audio->sample_rate);
|
||||
set_interface[2] = buffer;
|
||||
|
||||
uevent_envp = set_interface;
|
||||
|
||||
if (uevent_envp) {
|
||||
|
||||
Reference in New Issue
Block a user