15
15
#include <linux/device.h>
16
16
#include <linux/atomic.h>
17
17
18
- #include "u_uac1 .h"
18
+ #include "u_uac1_legacy .h"
19
19
20
20
static int generic_set_cmd (struct usb_audio_control * con , u8 cmd , int value );
21
21
static int generic_get_cmd (struct usb_audio_control * con , u8 cmd );
@@ -326,11 +326,11 @@ static int f_audio_out_ep_complete(struct usb_ep *ep, struct usb_request *req)
326
326
struct f_audio * audio = req -> context ;
327
327
struct usb_composite_dev * cdev = audio -> card .func .config -> cdev ;
328
328
struct f_audio_buf * copy_buf = audio -> copy_buf ;
329
- struct f_uac1_opts * opts ;
329
+ struct f_uac1_legacy_opts * opts ;
330
330
int audio_buf_size ;
331
331
int err ;
332
332
333
- opts = container_of (audio -> card .func .fi , struct f_uac1_opts ,
333
+ opts = container_of (audio -> card .func .fi , struct f_uac1_legacy_opts ,
334
334
func_inst );
335
335
audio_buf_size = opts -> audio_buf_size ;
336
336
@@ -578,13 +578,13 @@ static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
578
578
struct usb_composite_dev * cdev = f -> config -> cdev ;
579
579
struct usb_ep * out_ep = audio -> out_ep ;
580
580
struct usb_request * req ;
581
- struct f_uac1_opts * opts ;
581
+ struct f_uac1_legacy_opts * opts ;
582
582
int req_buf_size , req_count , audio_buf_size ;
583
583
int i = 0 , err = 0 ;
584
584
585
585
DBG (cdev , "intf %d, alt %d\n" , intf , alt );
586
586
587
- opts = container_of (f -> fi , struct f_uac1_opts , func_inst );
587
+ opts = container_of (f -> fi , struct f_uac1_legacy_opts , func_inst );
588
588
req_buf_size = opts -> req_buf_size ;
589
589
req_count = opts -> req_count ;
590
590
audio_buf_size = opts -> audio_buf_size ;
@@ -705,9 +705,9 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f)
705
705
struct usb_string * us ;
706
706
int status ;
707
707
struct usb_ep * ep = NULL ;
708
- struct f_uac1_opts * audio_opts ;
708
+ struct f_uac1_legacy_opts * audio_opts ;
709
709
710
- audio_opts = container_of (f -> fi , struct f_uac1_opts , func_inst );
710
+ audio_opts = container_of (f -> fi , struct f_uac1_legacy_opts , func_inst );
711
711
audio -> card .gadget = c -> cdev -> gadget ;
712
712
/* set up ASLA audio devices */
713
713
if (!audio_opts -> bound ) {
@@ -801,15 +801,16 @@ static int control_selector_init(struct f_audio *audio)
801
801
return 0 ;
802
802
}
803
803
804
- static inline struct f_uac1_opts * to_f_uac1_opts (struct config_item * item )
804
+ static inline
805
+ struct f_uac1_legacy_opts * to_f_uac1_opts (struct config_item * item )
805
806
{
806
- return container_of (to_config_group (item ), struct f_uac1_opts ,
807
+ return container_of (to_config_group (item ), struct f_uac1_legacy_opts ,
807
808
func_inst .group );
808
809
}
809
810
810
811
static void f_uac1_attr_release (struct config_item * item )
811
812
{
812
- struct f_uac1_opts * opts = to_f_uac1_opts (item );
813
+ struct f_uac1_legacy_opts * opts = to_f_uac1_opts (item );
813
814
814
815
usb_put_function_instance (& opts -> func_inst );
815
816
}
@@ -822,7 +823,7 @@ static struct configfs_item_operations f_uac1_item_ops = {
822
823
static ssize_t f_uac1_opts_##name##_show(struct config_item *item, \
823
824
char *page) \
824
825
{ \
825
- struct f_uac1_opts *opts = to_f_uac1_opts(item); \
826
+ struct f_uac1_legacy_opts *opts = to_f_uac1_opts(item); \
826
827
int result; \
827
828
\
828
829
mutex_lock(&opts->lock); \
@@ -835,7 +836,7 @@ static ssize_t f_uac1_opts_##name##_show(struct config_item *item, \
835
836
static ssize_t f_uac1_opts_##name##_store(struct config_item *item, \
836
837
const char *page, size_t len) \
837
838
{ \
838
- struct f_uac1_opts *opts = to_f_uac1_opts(item); \
839
+ struct f_uac1_legacy_opts *opts = to_f_uac1_opts(item); \
839
840
int ret; \
840
841
u32 num; \
841
842
\
@@ -867,7 +868,7 @@ UAC1_INT_ATTRIBUTE(audio_buf_size);
867
868
static ssize_t f_uac1_opts_##name##_show(struct config_item *item, \
868
869
char *page) \
869
870
{ \
870
- struct f_uac1_opts *opts = to_f_uac1_opts(item); \
871
+ struct f_uac1_legacy_opts *opts = to_f_uac1_opts(item); \
871
872
int result; \
872
873
\
873
874
mutex_lock(&opts->lock); \
@@ -880,7 +881,7 @@ static ssize_t f_uac1_opts_##name##_show(struct config_item *item, \
880
881
static ssize_t f_uac1_opts_##name##_store(struct config_item *item, \
881
882
const char *page, size_t len) \
882
883
{ \
883
- struct f_uac1_opts *opts = to_f_uac1_opts(item); \
884
+ struct f_uac1_legacy_opts *opts = to_f_uac1_opts(item); \
884
885
int ret = -EBUSY; \
885
886
char *tmp; \
886
887
\
@@ -928,9 +929,9 @@ static struct config_item_type f_uac1_func_type = {
928
929
929
930
static void f_audio_free_inst (struct usb_function_instance * f )
930
931
{
931
- struct f_uac1_opts * opts ;
932
+ struct f_uac1_legacy_opts * opts ;
932
933
933
- opts = container_of (f , struct f_uac1_opts , func_inst );
934
+ opts = container_of (f , struct f_uac1_legacy_opts , func_inst );
934
935
if (opts -> fn_play_alloc )
935
936
kfree (opts -> fn_play );
936
937
if (opts -> fn_cap_alloc )
@@ -942,7 +943,7 @@ static void f_audio_free_inst(struct usb_function_instance *f)
942
943
943
944
static struct usb_function_instance * f_audio_alloc_inst (void )
944
945
{
945
- struct f_uac1_opts * opts ;
946
+ struct f_uac1_legacy_opts * opts ;
946
947
947
948
opts = kzalloc (sizeof (* opts ), GFP_KERNEL );
948
949
if (!opts )
@@ -966,10 +967,10 @@ static struct usb_function_instance *f_audio_alloc_inst(void)
966
967
static void f_audio_free (struct usb_function * f )
967
968
{
968
969
struct f_audio * audio = func_to_audio (f );
969
- struct f_uac1_opts * opts ;
970
+ struct f_uac1_legacy_opts * opts ;
970
971
971
972
gaudio_cleanup (& audio -> card );
972
- opts = container_of (f -> fi , struct f_uac1_opts , func_inst );
973
+ opts = container_of (f -> fi , struct f_uac1_legacy_opts , func_inst );
973
974
kfree (audio );
974
975
mutex_lock (& opts -> lock );
975
976
-- opts -> refcnt ;
@@ -984,7 +985,7 @@ static void f_audio_unbind(struct usb_configuration *c, struct usb_function *f)
984
985
static struct usb_function * f_audio_alloc (struct usb_function_instance * fi )
985
986
{
986
987
struct f_audio * audio ;
987
- struct f_uac1_opts * opts ;
988
+ struct f_uac1_legacy_opts * opts ;
988
989
989
990
/* allocate and initialize one new instance */
990
991
audio = kzalloc (sizeof (* audio ), GFP_KERNEL );
@@ -993,7 +994,7 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi)
993
994
994
995
audio -> card .func .name = "g_audio" ;
995
996
996
- opts = container_of (fi , struct f_uac1_opts , func_inst );
997
+ opts = container_of (fi , struct f_uac1_legacy_opts , func_inst );
997
998
mutex_lock (& opts -> lock );
998
999
++ opts -> refcnt ;
999
1000
mutex_unlock (& opts -> lock );
@@ -1015,6 +1016,6 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi)
1015
1016
return & audio -> card .func ;
1016
1017
}
1017
1018
1018
- DECLARE_USB_FUNCTION_INIT (uac1 , f_audio_alloc_inst , f_audio_alloc );
1019
+ DECLARE_USB_FUNCTION_INIT (uac1_legacy , f_audio_alloc_inst , f_audio_alloc );
1019
1020
MODULE_LICENSE ("GPL" );
1020
1021
MODULE_AUTHOR ("Bryan Wu" );
0 commit comments