From patchwork Fri Apr 19 20:23:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wulff X-Patchwork-Id: 13636757 Received: from mx0a-0068d901.pphosted.com (mx0a-0068d901.pphosted.com [205.220.168.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68C39130AC8 for ; Fri, 19 Apr 2024 20:23:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.168.35 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713558209; cv=fail; b=FaFFMAVlxP9CKByfHTZPoHaD3jHHwX7NyvMqWB+12kyAHwpKaOT/CIwtkvt5rUfSKuwDqPimyL4Ps6bqjYHuKmYDLV7apOyZM+Q2pTczENjYs5c61CyhVEjRybmtzoAQKOdJ9rInDyYUEzLXrgEFXZS8vcejXFBrp8lsqg9FR0U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713558209; c=relaxed/simple; bh=/xU0TNvtV1SsKXUu322XXCIRmMNmaUrCis1kbgdT9RQ=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=F3hYWP/vES+Go0rkHEs4ojxSTHbC9TsozRJ8GRwP20IKpoa4094HwguLXCVSerfV8R9yCUfG/QIlMuFlkVOMg1+i0lAhnT+o6ypOJUqvTfUB4h9soCVBwGfiWaTo59oRclJbWLOpQugwCtnu9pIX0twcDGDnv5f8pKN2xNa5HKM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=biamp.com; spf=pass smtp.mailfrom=biamp.com; dkim=pass (2048-bit key) header.d=biamp.com header.i=@biamp.com header.b=JS+QUEFq; dkim=pass (2048-bit key) header.d=biamp.com header.i=@biamp.com header.b=iCroiDOs; arc=fail smtp.client-ip=205.220.168.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=biamp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=biamp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=biamp.com header.i=@biamp.com header.b="JS+QUEFq"; dkim=pass (2048-bit key) header.d=biamp.com header.i=@biamp.com header.b="iCroiDOs" Received: from pps.filterd (m0278264.ppops.net [127.0.0.1]) by mx0b-0068d901.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43J6o2Dp032608 for ; Fri, 19 Apr 2024 13:23:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=biamp.com; h= from:to:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=proofpoint; bh=2kU2MM 0IOnn9vwsxCdQxTfiwRZ57uprOF5SCi0W55G4=; b=JS+QUEFqB9Izeic+eNsJpR +SNZ7KFNaXZqqOwI562LfoV7oaMHa+K1+ZpmCqhKjJl2p6Z+cDHTP+MPqayt7DQa tt4akMQMsYfOdk3SNeSN3wrg4/bHm8OObAxEqRsXelv8Xj1k1Q1lEqaElmzhEvug uo4LGVk/fYC4L69rNZrSNrAi0w+sEt6vJMDo+j1slFQJUUyYPdspxlfm1lu5wyo+ MlHBCpqdUVzAbqFZJeBU4oNilca5oHkP8UoPdhuP1WYB+PbJpK1QyM5njle5LA+r hrn31PfqfgnsOM0CivMs78aytwW0zqSk8N3WkOznkiu9rVDEQc1EmdlubAxuyusg == Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by mx0b-0068d901.pphosted.com (PPS) with ESMTPS id 3xg09r4bdw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 19 Apr 2024 13:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TWrEyXTEbPcvy0CIvJRwcpkNCA+UfwBefX7Y2N3aJGY+V9BXhC22IkTzMa82GoYMzG4X0c9XhvkBKzsCpfw+R6FZz2PINJKGt34jQPTDejEfVqR1Xwk3LTWS+AIvUQEjNEoQE3lv10h22z2AckncUwlMqH73aWtSfdPORYPHGNyR5/ojRH2YTYOCBwqyfupkWxFKMVTlufH2wOLKQ3v2x5sJHW/1tuDPV4mWZNTU6gkxO1tFUA6/IKsRLbgmG2wSZNCT5arLIawemeykeZZ/OJ7pxL469hiNphcywlMjaVRXzoTC6KYJ3euT4ufR1UUwddsoaYcSxmWy7PLeOqlrZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2kU2MM0IOnn9vwsxCdQxTfiwRZ57uprOF5SCi0W55G4=; b=Z/QEaCl/BrgehjecmNkQMHOQGh8lNs5fDAH6kxc5XPdz0KEvINntbI7DefNCY3nw5pgBFOF93fj9ao7KqwPlQwx8E03SpB/tjNkc4jVP1OKdmik7vgzDZd042TrrEYO+qqRmEcBeyNmkf85prVa+YtU08UkqnIdvrMhtzDDDpmbwXB4ekjlD1nZerCs/ZWa/A7R1LnhOXbtUjB5rqBgt2qII23Sl0BF147CXIwXDT0MjfmCBDsBFsrPuG69vyleen9lyVkT7/GhOHLBcPqmHbaP2+XRFFYcTCZIdjlp7G8lgTWMI4iK6BI0Q2Igj2pP3raNCl/p+ag5tdvcpQdhNLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=biamp.com; dmarc=pass action=none header.from=biamp.com; dkim=pass header.d=biamp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=biamp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2kU2MM0IOnn9vwsxCdQxTfiwRZ57uprOF5SCi0W55G4=; b=iCroiDOs+TQwCbKFMB7AzyCiCfHud32imIbmCD8ki1jyv5kvoj8AngMCgEBnousoV69Vq5KY9ElZyI8K1HyOW0PqfCbBQyyXTmJMkK+G9UIuZmFiCQahu4h7k3GwKcrFOr970qV51i9YHoM7bvscCMUDI+uoOSnqb83sV2biC4bf5kwys4JCknfOy8AHy8tb+F7uP3euHKdkOxhj48W3drlWMUVaLitzi6u34JsdYaI33YwadXR1+CCCGRFgoakQgGKPSYRuzzyBq2lsdTEfAb/UD9E/xOExkq0AELZZ5LeRjYHnI6YZurhV4l+1dLRqir715o/CmNcSeeVPr+7nOA== Received: from CO1PR17MB5419.namprd17.prod.outlook.com (2603:10b6:303:ec::17) by BL3PR17MB6091.namprd17.prod.outlook.com (2603:10b6:208:3ba::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.41; Fri, 19 Apr 2024 20:23:21 +0000 Received: from CO1PR17MB5419.namprd17.prod.outlook.com ([fe80::f48:ee61:a81b:d555]) by CO1PR17MB5419.namprd17.prod.outlook.com ([fe80::f48:ee61:a81b:d555%4]) with mapi id 15.20.7472.042; Fri, 19 Apr 2024 20:23:21 +0000 From: Chris Wulff To: "linux-usb@vger.kernel.org" Subject: [PATCH] usb: gadget: f_uac1: Expose all string descriptors through configfs. Thread-Topic: [PATCH] usb: gadget: f_uac1: Expose all string descriptors through configfs. Thread-Index: AQHakpdDOzPwEwW1akqDe4n7OahRWA== Date: Fri, 19 Apr 2024 20:23:21 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR17MB5419:EE_|BL3PR17MB6091:EE_ x-ms-office365-filtering-correlation-id: fbb9b38c-5e3b-4c89-bea9-08dc60ae8ea7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: =?iso-8859-1?q?qsycplSHP6blXIlOIDuu1lp+EI?= =?iso-8859-1?q?/3D0R967U9/+36pC1apb4aRrtdxmps6HUxccf3FBefdernYiFqzTugXjnKi2?= =?iso-8859-1?q?kFKVPxqN9Gtn2MCRh1E1wOWjZgtYRJDVCSz31T+zC/Ej/Q0IoChVsaeAkQW5?= =?iso-8859-1?q?6I9Wq4A0c9dAPVjXlfUbcs/CHyuYew/lbmbYrmDZE/grGTz57E2WV7+cqChX?= =?iso-8859-1?q?L044YaKUgNGQSNwDdAp79Okkfs7aed4+u7LH8JIFBWinmP6tIBYYpxkix6mK?= =?iso-8859-1?q?xjH/b8Xkrx46VgG1fuHhBwrwwsljfsrnbVbOadHd/uVxS0DdxN+di81i6acb?= =?iso-8859-1?q?RLzVs6jaiL5LKtuSgYhYt/KfSSGYedtIN31pDDke5se3kzZs89DiSt3CA+UD?= =?iso-8859-1?q?enH865fIgpa2UyQ95LJVlleu+gQIHn+xh828QgOML2gBTl2KGbcsSGhjDqpA?= =?iso-8859-1?q?EhWzOgZaXc55DZOWIzkiA4/L9N9lQjiFKohItU4luTn62ld8HCSYE9mmS3zZ?= =?iso-8859-1?q?Lc8r+nLzJFyraTN5KwphHgbRrTvBqrcgquP47rns4HPVpnqScgJRaPa5m86C?= =?iso-8859-1?q?9t6PiIrgwYIpiuUgwS+NaCAdAX9ikZ6+YunBOwrlipJsOUIkUthVnmxRdw8v?= =?iso-8859-1?q?5hEdAB8DsWdpf7yousnemk4x34JV8bQRP6tf9ivXrv1V+iOFzPhpFM9XWFco?= =?iso-8859-1?q?0VI/VWuboZOktD2bHcs2H338ihgKZhD8xUTGlTBS3vJXH+GeyO5GHG+1yKW8?= =?iso-8859-1?q?2RtPyWnbLr+h4Oi3NtDa6mfFNlzOqQi54+X7d4Cg4xNmLPJO6MEmQQ+8uc6b?= =?iso-8859-1?q?KNf0KJci/1h8lyigsMrzEb+QQCcjAhA8otXNzwU7xaCYggS3/TYojFMQjI3+?= =?iso-8859-1?q?QdqnoImrM3o9JvOeqRwfmEeGi+Z7nAXZnhVUS+p0URdWhY8wfa1lTBvHm6Sf?= =?iso-8859-1?q?fDpoG88I8vBQsLSK3iQUlIrHtv1CCzbnZAf0UJPWndVvZaREwmUg2agelEO9?= =?iso-8859-1?q?dSM4ZOsrARNRsz4FoGipxAAEe7h7YwWtStoy21R1zUw7o3f+N2aq/HyV2eQb?= =?iso-8859-1?q?sI5sTdpFyGmJBDN/DyJygE1dJ4ZLU7N+rZEIqf0bwxdrx3IVK7djhKflhGaB?= =?iso-8859-1?q?jUtd7EokHKhsW6nvdffO0CvmUSlHTt3MGSB7djsRRriUwKB1e6woBvgphHzu?= =?iso-8859-1?q?qFGf2uc/lVOa67MA6BEoMHzWNBqOtA2XJ3iQY6Osu5VTuHW8sLMhRx74ySiU?= =?iso-8859-1?q?vaO4s3bHBM3izgtOxfsCfWpuv51xkcuh8OlCQMhVxV8RVuqxNlMzui/QQ4gA?= =?iso-8859-1?q?hq9Thjcp2E5HTmANQI1s9w82yuN+V/Sah/mlcTfNr4J+cBqy/KEKt2J2vPab?= =?iso-8859-1?q?N2gftDmWVZlX00gNva5g=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR17MB5419.namprd17.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?jnFMxb7LsTceo67b7ZLFRIX?= =?iso-8859-1?q?kj4tDZty+4Y/uGuLBXKx/ODh3QPSXo9k/3C19hx+FgAtltT38yXrT6qkhxRm?= =?iso-8859-1?q?6ZN+NwNGgjZuJ3eB4bD+C7Y+4OMQuw+dPsWtLIGtwkTi/6intGheqb2NBY2y?= =?iso-8859-1?q?RU4STgunkGLoEIZvpf3+TA6DW60URr+GV/S8ZhBBGOEroAQV06yPdL53b2+1?= =?iso-8859-1?q?EWib565SRFUXdMzQ4eyYmK5ChFXgVQBuzzvLnidb4UqJw9zc3MneFRuYUGeG?= =?iso-8859-1?q?GlZxWcy6cBrnDIFyXizWJhShhqij5Jd04A4K8Mb4ptwRmH1hkjfwPFwQO0fv?= =?iso-8859-1?q?ZfkEWoY9CC029WTN6rUN5s7Za3174shkkVyZTBtK+KrX6Kuv85v9QsO3vQlZ?= =?iso-8859-1?q?nPqFWN/mxlGFPLy5AhgwkSq/lAgLYTlJzqyZOttUzkPCH3mFsexspd4SfoDF?= =?iso-8859-1?q?7HZIZEg0nz7C6Z1kBO1OqPLfQsc+lwzYcr80/xGhfqjXuiYPW4OgQmPN+mFK?= =?iso-8859-1?q?jv3D3nO80DhGtK9A89ENhQBFWya1mOMIwz0OJMyo2OF1nxgND+pdhK2r/rze?= =?iso-8859-1?q?gyzggEvroA/sCMmR+Nlk9OSwVGYJ0z2x8c3dCfx9XRox9ehazOQ0/be+CRRl?= =?iso-8859-1?q?O+eIjUFVqe73cnGf/m1S5LPpeWS2G3jQdL50qdWvSAA7t5HV9fZitRGHJbjM?= =?iso-8859-1?q?efJZwhxohdr/qGhsvimb1NVQ7dLyw5bnnFN9W2gJXEX+IIFf2Tqbr9wycDGU?= =?iso-8859-1?q?YoItCs1D4R2nc7tcCP2/lcq16zcO3jTAq98HnCIDRhdsnZn+7Fu2Wxz/A5PC?= =?iso-8859-1?q?ATXjQkzmo2Klb4YctRLOyFxVqFvJbCEZKTt9XRF48iQfGPyVVStjUBRg1VHp?= =?iso-8859-1?q?r9mE2SIFzPTr6aoFyjKFqaqytadNmfC8MdaPv0sv7yX2Kmq7EEG0HLBuUE4C?= =?iso-8859-1?q?ZgWnVgaSn92J9kisYmqMpRqnQiBQeljJsA304CicYjpTN3etzm+8xhrlfgxs?= =?iso-8859-1?q?ZDl0fywoI3MmfzL7PFRxWBmYpXmmggKWgi2xJJmeuM9QA6t0la1UVyr2UD1B?= =?iso-8859-1?q?lk1BB8wqA1/wGlhzDHJmqDeZS1ULgiy4olAYmfGgbzylHbp70lzLEa2QLw6D?= =?iso-8859-1?q?oKNlE2LhsBXH/8ZoWZZRP8IxaqDdxIK6kIhitC1q8NW000ugk+2Zm5ypVAYp?= =?iso-8859-1?q?VmESSDh92qBYKUhiJYkStlaPGc823PFEUln9U4MUw78SieYKLy0eEiGUmKB/?= =?iso-8859-1?q?KyGG+qJBuncPbfZEZ0s1yGqHtrS9YvXE2+CEZ0CZs4y9h47SGQGEEcnJ3HAH?= =?iso-8859-1?q?fL1ziUNgmdHF3A7FT7+9RhhzHqV3byjtGA4xAGCDDKv5kzyngPob6RDpDrD9?= =?iso-8859-1?q?hOWRbS0du5Vm7QaX7u9AxCVu1mz0mjl4oyKei3LXTlVKhPN9mmMj4+1CWzmL?= =?iso-8859-1?q?tmmjLU0XFF6qgbinYxR1OhD8BMTO+cWLlF5Su8ldvq3o2eJb5ggW7ht8HeFf?= =?iso-8859-1?q?Kjm61LKLVv1aV+K3oMFsuksC92Q6MJElzL5fAMON/rROnjAfAS3Bu/Ut3sKs?= =?iso-8859-1?q?bflVhcNOQdKwpJ9PMSSSJ2crvKxzb6xfIcIwNxYpVDVw4uxy5PT1iCebYYel?= =?iso-8859-1?q?GZQYYYafkFzQqbctq?= Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: biamp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR17MB5419.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbb9b38c-5e3b-4c89-bea9-08dc60ae8ea7 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2024 20:23:21.3593 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 341ac572-066c-46f6-bf06-b2d0c7ddf1be X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iJkM8a8POOr+EjhZHDEmaNoeIeuR+yvESzkToCfOGN3+xar5zrpIBOpiqazq6CV9ZOUBBJHQsCMHrH4c7CLvAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR17MB6091 X-Proofpoint-ORIG-GUID: umVW82qDjwhTqmjs7xC6Rm06Odf9SK2d X-Proofpoint-GUID: umVW82qDjwhTqmjs7xC6Rm06Odf9SK2d This makes all string descriptors configurable for the UAC1 gadget so the user can configure names of terminals/controls/alt modes. Signed-off-by: Chris Wulff --- drivers/usb/gadget/function/f_uac1.c | 66 +++++++++++++++++++++------- drivers/usb/gadget/function/u_uac1.h | 14 +++++- 2 files changed, 63 insertions(+), 17 deletions(-) diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c index 7de74a3dd392..100169d6dca7 100644 --- a/drivers/usb/gadget/function/f_uac1.c +++ b/drivers/usb/gadget/function/f_uac1.c @@ -377,24 +377,10 @@ enum { STR_AS_OUT_IF_ALT1, STR_AS_IN_IF_ALT0, STR_AS_IN_IF_ALT1, + NUM_STR_DESCRIPTORS, }; -static struct usb_string strings_uac1[] = { - /* [STR_AC_IF].s = DYNAMIC, */ - [STR_USB_OUT_IT].s = "Playback Input terminal", - [STR_USB_OUT_IT_CH_NAMES].s = "Playback Channels", - [STR_IO_OUT_OT].s = "Playback Output terminal", - [STR_IO_IN_IT].s = "Capture Input terminal", - [STR_IO_IN_IT_CH_NAMES].s = "Capture Channels", - [STR_USB_IN_OT].s = "Capture Output terminal", - [STR_FU_IN].s = "Capture Volume", - [STR_FU_OUT].s = "Playback Volume", - [STR_AS_OUT_IF_ALT0].s = "Playback Inactive", - [STR_AS_OUT_IF_ALT1].s = "Playback Active", - [STR_AS_IN_IF_ALT0].s = "Capture Inactive", - [STR_AS_IN_IF_ALT1].s = "Capture Active", - { }, -}; +static struct usb_string strings_uac1[NUM_STR_DESCRIPTORS + 1] = {}; static struct usb_gadget_strings str_uac1 = { .language = 0x0409, /* en-us */ @@ -1264,6 +1250,18 @@ static int f_audio_bind(struct usb_configuration *c, struct usb_function *f) audio_opts = container_of(f->fi, struct f_uac1_opts, func_inst); strings_uac1[STR_AC_IF].s = audio_opts->function_name; + strings_uac1[STR_USB_OUT_IT].s = audio_opts->usb_out_it_string; + strings_uac1[STR_USB_OUT_IT_CH_NAMES].s = audio_opts->usb_out_it_ch_name_string; + strings_uac1[STR_IO_OUT_OT].s = audio_opts->io_out_ot_string; + strings_uac1[STR_IO_IN_IT].s = audio_opts->io_in_it_string; + strings_uac1[STR_IO_IN_IT_CH_NAMES].s = audio_opts->io_in_it_ch_name_string; + strings_uac1[STR_USB_IN_OT].s = audio_opts->usb_in_ot_string; + strings_uac1[STR_FU_IN].s = audio_opts->fu_in_string; + strings_uac1[STR_FU_OUT].s = audio_opts->fu_out_string; + strings_uac1[STR_AS_OUT_IF_ALT0].s = audio_opts->as_out_if_alt0_string; + strings_uac1[STR_AS_OUT_IF_ALT1].s = audio_opts->as_out_if_alt1_string; + strings_uac1[STR_AS_IN_IF_ALT0].s = audio_opts->as_in_if_alt0_string; + strings_uac1[STR_AS_IN_IF_ALT1].s = audio_opts->as_in_if_alt1_string; us = usb_gstrings_attach(cdev, uac1_strings, ARRAY_SIZE(strings_uac1)); if (IS_ERR(us)) @@ -1682,6 +1680,18 @@ UAC1_ATTRIBUTE(s16, c_volume_min); UAC1_ATTRIBUTE(s16, c_volume_max); UAC1_ATTRIBUTE(s16, c_volume_res); UAC1_ATTRIBUTE_STRING(function_name); +UAC1_ATTRIBUTE_STRING(usb_out_it_string); +UAC1_ATTRIBUTE_STRING(usb_out_it_ch_name_string); +UAC1_ATTRIBUTE_STRING(io_out_ot_string); +UAC1_ATTRIBUTE_STRING(io_in_it_string); +UAC1_ATTRIBUTE_STRING(io_in_it_ch_name_string); +UAC1_ATTRIBUTE_STRING(usb_in_ot_string); +UAC1_ATTRIBUTE_STRING(fu_in_string); +UAC1_ATTRIBUTE_STRING(fu_out_string); +UAC1_ATTRIBUTE_STRING(as_out_if_alt0_string); +UAC1_ATTRIBUTE_STRING(as_out_if_alt1_string); +UAC1_ATTRIBUTE_STRING(as_in_if_alt0_string); +UAC1_ATTRIBUTE_STRING(as_in_if_alt1_string); static struct configfs_attribute *f_uac1_attrs[] = { &f_uac1_opts_attr_c_chmask, @@ -1705,6 +1715,18 @@ static struct configfs_attribute *f_uac1_attrs[] = { &f_uac1_opts_attr_c_volume_res, &f_uac1_opts_attr_function_name, + &f_uac1_opts_attr_usb_out_it_string, + &f_uac1_opts_attr_usb_out_it_ch_name_string, + &f_uac1_opts_attr_io_out_ot_string, + &f_uac1_opts_attr_io_in_it_string, + &f_uac1_opts_attr_io_in_it_ch_name_string, + &f_uac1_opts_attr_usb_in_ot_string, + &f_uac1_opts_attr_fu_in_string, + &f_uac1_opts_attr_fu_out_string, + &f_uac1_opts_attr_as_out_if_alt0_string, + &f_uac1_opts_attr_as_out_if_alt1_string, + &f_uac1_opts_attr_as_in_if_alt0_string, + &f_uac1_opts_attr_as_in_if_alt1_string, NULL, }; @@ -1759,6 +1781,18 @@ static struct usb_function_instance *f_audio_alloc_inst(void) opts->req_number = UAC1_DEF_REQ_NUM; scnprintf(opts->function_name, sizeof(opts->function_name), "AC Interface"); + scnprintf(opts->usb_out_it_string, sizeof(opts->usb_out_it_string), "Playback Input terminal"); + scnprintf(opts->usb_out_it_ch_name_string, sizeof(opts->usb_out_it_ch_name_string), "Playback Channels"); + scnprintf(opts->io_out_ot_string, sizeof(opts->io_out_ot_string), "Playback Output terminal"); + scnprintf(opts->io_in_it_string, sizeof(opts->io_in_it_string), "Capture Input terminal"); + scnprintf(opts->io_in_it_ch_name_string, sizeof(opts->io_in_it_ch_name_string), "Capture Channels"); + scnprintf(opts->usb_in_ot_string, sizeof(opts->usb_in_ot_string), "Capture Output terminal"); + scnprintf(opts->fu_in_string, sizeof(opts->fu_in_string), "Capture Volume"); + scnprintf(opts->fu_out_string, sizeof(opts->fu_out_string), "Playback Volume"); + scnprintf(opts->as_out_if_alt0_string, sizeof(opts->as_out_if_alt0_string), "Playback Inactive"); + scnprintf(opts->as_out_if_alt1_string, sizeof(opts->as_out_if_alt1_string), "Playback Active"); + scnprintf(opts->as_in_if_alt0_string, sizeof(opts->as_in_if_alt0_string), "Capture Inactive"); + scnprintf(opts->as_in_if_alt1_string, sizeof(opts->as_in_if_alt1_string), "Capture Active"); return &opts->func_inst; } diff --git a/drivers/usb/gadget/function/u_uac1.h b/drivers/usb/gadget/function/u_uac1.h index f7a616760e31..818a335a309a 100644 --- a/drivers/usb/gadget/function/u_uac1.h +++ b/drivers/usb/gadget/function/u_uac1.h @@ -52,7 +52,19 @@ struct f_uac1_opts { int req_number; unsigned bound:1; - char function_name[32]; + char function_name[USB_MAX_STRING_LEN]; + char usb_out_it_string[USB_MAX_STRING_LEN]; + char usb_out_it_ch_name_string[USB_MAX_STRING_LEN]; + char io_out_ot_string[USB_MAX_STRING_LEN]; + char io_in_it_string[USB_MAX_STRING_LEN]; + char io_in_it_ch_name_string[USB_MAX_STRING_LEN]; + char usb_in_ot_string[USB_MAX_STRING_LEN]; + char fu_in_string[USB_MAX_STRING_LEN]; + char fu_out_string[USB_MAX_STRING_LEN]; + char as_out_if_alt0_string[USB_MAX_STRING_LEN]; + char as_out_if_alt1_string[USB_MAX_STRING_LEN]; + char as_in_if_alt0_string[USB_MAX_STRING_LEN]; + char as_in_if_alt1_string[USB_MAX_STRING_LEN]; struct mutex lock; int refcnt;