diff mbox series

[v2,05/11] usb: gadget: f_uac2: Renaming Clock Sources to fixed names

Message ID 20211220211130.88590-6-pavel.hofman@ivitera.com
State New
Headers show
Series usb: gadget: audio: Multiple rates, dyn. bInterval | expand

Commit Message

Pavel Hofman Dec. 20, 2021, 9:11 p.m. UTC
From: Julian Scheel <julian@jusst.de>

The gadget no longer supports only one frequency. Therefore USB strings
corresponding to the clock sources are renamed from specific Hz value to
general names Input clock/Output clock.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
---
 drivers/usb/gadget/function/f_uac2.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

John Keeping Dec. 21, 2021, 12:02 p.m. UTC | #1
The subject should be "Rename ...".

On Mon, Dec 20, 2021 at 10:11:24PM +0100, Pavel Hofman wrote:
> From: Julian Scheel <julian@jusst.de>
> 
> The gadget no longer supports only one frequency. Therefore USB strings
> corresponding to the clock sources are renamed from specific Hz value to
> general names Input clock/Output clock.
> 
> Signed-off-by: Julian Scheel <julian@jusst.de>
> Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
> ---
>  drivers/usb/gadget/function/f_uac2.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
> index 74e32bb146c7..ef8e39e80523 100644
> --- a/drivers/usb/gadget/function/f_uac2.c
> +++ b/drivers/usb/gadget/function/f_uac2.c
> @@ -105,14 +105,11 @@ enum {
>  	STR_AS_IN_ALT1,
>  };
>  
> -static char clksrc_in[8];
> -static char clksrc_out[8];
> -
>  static struct usb_string strings_fn[] = {
>  	[STR_ASSOC].s = "Source/Sink",
>  	[STR_IF_CTRL].s = "Topology Control",
> -	[STR_CLKSRC_IN].s = clksrc_in,
> -	[STR_CLKSRC_OUT].s = clksrc_out,
> +	[STR_CLKSRC_IN].s = "Input clock",
> +	[STR_CLKSRC_OUT].s = "Output clock",

Other values here use title case, so "Input Clock", "Output Clock".

>  	[STR_USB_IT].s = "USBH Out",
>  	[STR_IO_IT].s = "USBD Out",
>  	[STR_USB_OT].s = "USBH In",
> @@ -1058,9 +1055,6 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
>  		*bma = cpu_to_le32(control);
>  	}
>  
> -	snprintf(clksrc_in, sizeof(clksrc_in), "%uHz", uac2_opts->p_srate);
> -	snprintf(clksrc_out, sizeof(clksrc_out), "%uHz", uac2_opts->c_srate);
> -
>  	ret = usb_interface_id(cfg, fn);
>  	if (ret < 0) {
>  		dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
> -- 
> 2.25.1
>
Pavel Hofman Dec. 22, 2021, 10:11 a.m. UTC | #2
Dne 21. 12. 21 v 13:02 John Keeping napsal(a):
> The subject should be "Rename ...".

OK

> 
> On Mon, Dec 20, 2021 at 10:11:24PM +0100, Pavel Hofman wrote:
>> From: Julian Scheel <julian@jusst.de>
>>
>> The gadget no longer supports only one frequency. Therefore USB strings
>> corresponding to the clock sources are renamed from specific Hz value to
>> general names Input clock/Output clock.
>>
>> Signed-off-by: Julian Scheel <julian@jusst.de>
>> Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
>> ---
>>   drivers/usb/gadget/function/f_uac2.c | 10 ++--------
>>   1 file changed, 2 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
>> index 74e32bb146c7..ef8e39e80523 100644
>> --- a/drivers/usb/gadget/function/f_uac2.c
>> +++ b/drivers/usb/gadget/function/f_uac2.c
>> @@ -105,14 +105,11 @@ enum {
>>   	STR_AS_IN_ALT1,
>>   };
>>   
>> -static char clksrc_in[8];
>> -static char clksrc_out[8];
>> -
>>   static struct usb_string strings_fn[] = {
>>   	[STR_ASSOC].s = "Source/Sink",
>>   	[STR_IF_CTRL].s = "Topology Control",
>> -	[STR_CLKSRC_IN].s = clksrc_in,
>> -	[STR_CLKSRC_OUT].s = clksrc_out,
>> +	[STR_CLKSRC_IN].s = "Input clock",
>> +	[STR_CLKSRC_OUT].s = "Output clock",
> 
> Other values here use title case, so "Input Clock", "Output Clock".
> 

OK
diff mbox series

Patch

diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index 74e32bb146c7..ef8e39e80523 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -105,14 +105,11 @@  enum {
 	STR_AS_IN_ALT1,
 };
 
-static char clksrc_in[8];
-static char clksrc_out[8];
-
 static struct usb_string strings_fn[] = {
 	[STR_ASSOC].s = "Source/Sink",
 	[STR_IF_CTRL].s = "Topology Control",
-	[STR_CLKSRC_IN].s = clksrc_in,
-	[STR_CLKSRC_OUT].s = clksrc_out,
+	[STR_CLKSRC_IN].s = "Input clock",
+	[STR_CLKSRC_OUT].s = "Output clock",
 	[STR_USB_IT].s = "USBH Out",
 	[STR_IO_IT].s = "USBD Out",
 	[STR_USB_OT].s = "USBH In",
@@ -1058,9 +1055,6 @@  afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
 		*bma = cpu_to_le32(control);
 	}
 
-	snprintf(clksrc_in, sizeof(clksrc_in), "%uHz", uac2_opts->p_srate);
-	snprintf(clksrc_out, sizeof(clksrc_out), "%uHz", uac2_opts->c_srate);
-
 	ret = usb_interface_id(cfg, fn);
 	if (ret < 0) {
 		dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);