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:
Meng Dongyang
2018-06-01 11:17:01 +08:00
committed by Tao Huang
parent ec644b51d9
commit a13b6c3967

View File

@@ -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) {