Commit f8f93d24 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi

usb: gadget: f_uac2: convert to new function interface with backward compatibility

Converting uac2 to the new function interface requires converting
the USB uac2's function code and its users.

This patch converts the f_uac2.c to the new function interface.

The file is now compiled into a separate usb_f_uac2.ko module.

The old function interface is provided by means of a preprocessor
conditional directives. After all users are converted, the old interface
can be removed.
Tested-by: default avatarSebastian Reimers <sebastian.reimers@googlemail.com>
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 5d73abf2
......@@ -181,6 +181,9 @@ config USB_F_MASS_STORAGE
config USB_F_FS
tristate
config USB_F_UAC2
tristate
choice
tristate "USB Gadget Drivers"
default USB_ETH
......
......@@ -32,3 +32,5 @@ usb_f_mass_storage-y := f_mass_storage.o storage_common.o
obj-$(CONFIG_USB_F_MASS_STORAGE)+= usb_f_mass_storage.o
usb_f_fs-y := f_fs.o
obj-$(CONFIG_USB_F_FS) += usb_f_fs.o
usb_f_uac2-y := f_uac2.o
obj-$(CONFIG_USB_F_UAC2) += usb_f_uac2.o
This diff is collapsed.
/*
* u_uac2.h
*
* Utility definitions for UAC2 function
*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef U_UAC2_H
#define U_UAC2_H
#include <linux/usb/composite.h>
struct f_uac2_opts {
struct usb_function_instance func_inst;
int p_chmask;
int p_srate;
int p_ssize;
int c_chmask;
int c_srate;
int c_ssize;
bool bound;
};
#endif
......@@ -45,6 +45,7 @@ static struct usb_gadget_strings *audio_strings[] = {
#include "u_uac1.c"
#include "f_uac1.c"
#else
#define USB_FUAC2_INCLUDED
#include "f_uac2.c"
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment