From patchwork Fri Jun 28 01:47:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13715374 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2043.outbound.protection.outlook.com [40.107.113.43]) (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 368E2125DB; Fri, 28 Jun 2024 01:47:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719539273; cv=fail; b=TnarXU1jAFoD4/Rqp88rIGnOwO+mtdjp8aW3ZN3HU2+J/wGKFEjF6IJKYRfO9QG9r6sf985Y+eJBU2p95/z/zrR31JJSJ91Qn9cVvB9Qlp2Byx03Ay3MIP1W6C0R8EoIKUr1tWdBsfvFK5m6gyYGMmdGzEbldgQmWFUmf3wiI0M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719539273; c=relaxed/simple; bh=yMfUyPemph3YCtQ34l1j3nsKMwJ0uxckd0wbarJJEmE=; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type: Date:MIME-Version; b=TlbcPSpa6Harr2Cg262sOFQxQTketBTTF8KouVBp7ux0TGnfhRwoK3x+Lk7Yfrz3Tww5mbKkLdM6LmGuRaABYXAAvDJ2fzGlI00UG87lJaqsa0IOQbUEMBHRstgMl3d6u8CZjsqnZxEbcAJDHQw3SI46tNnlKuJ9wXxk34DiKRw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=k5kXgC8O; arc=fail smtp.client-ip=40.107.113.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="k5kXgC8O" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i5LbNcCqEU5ly73/R52+YlocHOKCUOyesab5YiTW3bWYGQOH1NGTzYdbper2N2rqeLGH/wuIBhlrKDo/APZ/oQbZ7JRVyu/bN7lMs/FcVeUCciaCeyIyWmpv60vD9Sdg6vUhmQi4R8Zm/Xl27NSD2nYzW21Req3hevDsUd7IfjwGaJ5GRKT5Ek4hkpvJtpiqiZg3c1sqGzuWKhmIElJP4jXLCwVbWdL7OOFNF6TL75KAPCrje6SpJWmd5EcLAQPZFsWjuUvkKflkf5jZgoGeLKhWHZ7zJzkAYZRg3AtTqbHdt3j34dk/1lqe8biD34Lqwq2b1OTQBic8Up0OpdCwhw== 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=1Tf8UpneksWrbhhJrPGvFmEtI/HKBn9yRONK+Ery9l4=; b=LR80IR6ArcVaXP7vS23mRaR/ph8QrdfgyG/NIsDkhRLotNgEZ/qUZsIQ60df/RE1rF/xJYIVLw7Ey6kJxCbV3VxdArUMp8/hnV72xAW+qI9Sv9oWK0lcvY84kSgTJFCNHamUf9iY5Uvg7tOh7k7pr2zKz3IUAJKCnsjdwPqk1z5OzBfrRFAzaqD54KNR3BLc4Ot51IBUXsPD9sJvNiwthgrYR7jxM2ro0Q6Y7WVs3X6AwQop2J9NxljmueCL++i59No316XnD50f8ZuRoxYqMWecFJxyRczYbpZsEZkDMnFA1gfcEe90kd+xbMyLZ53AmZn2casbhCx5GFPKZdvo9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1Tf8UpneksWrbhhJrPGvFmEtI/HKBn9yRONK+Ery9l4=; b=k5kXgC8OBqQ+wWILNKHKZ6v2pOoWMLJCkfciA3T5mNv/hhcT2bM5JkjAz+ZkFCbC0cpzkWMgwK4QbQuWrqUVm5ASv1anZRFZBk6iaOhwshh2P9YV0Z3OtKFtWjhuNnVtqk3waSdEavkTqHbFn01SDUcylLbvRCXC9My9wn1Zv0I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB11434.jpnprd01.prod.outlook.com (2603:1096:400:379::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Fri, 28 Jun 2024 01:47:47 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7719.022; Fri, 28 Jun 2024 01:47:47 +0000 Message-ID: <87frsxaldo.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 1/2] ASoC: simple-audio-mux: enable to select MUX names User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Alexandre Belloni , Conor Dooley , Jaroslav Kysela , Krzysztof Kozlowski , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Rob Herring , Takashi Iwai , devicetree@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87h6ddale3.wl-kuninori.morimoto.gx@renesas.com> References: <87h6ddale3.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 28 Jun 2024 01:47:47 +0000 X-ClientProxiedBy: TY2PR02CA0067.apcprd02.prod.outlook.com (2603:1096:404:e2::31) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB11434:EE_ X-MS-Office365-Filtering-Correlation-Id: fe43efdc-a508-47b9-5879-08dc97144fce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|376014|7416014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: xO8vzbBOIeMCV8/Aq8LSOb63yKI0lNmKnUJngxdkIUGDqz6c7RdpbbzOFLzoxBLAe12+tDod0/qVejDumQCnSxt/Zz+kfDDcLf2xnU+pKb0tP1Q9TPBNZL+CgKhNvJ5foy/BJY+OZYzXzWc1fhdkDdihhiXqysLds97KTnYoC+yd/eeqhF5/NqKmjC3GEGsRASM7fTKUas5inCTQQvd4wGMh4WP8NzunAYGwrtZp2RAK7UUELp8/ZZX8pu4T1mPqfsk1yTs4ujSKBwkwYUtz6avHjUoSJq2E+a6lEiCyuH2p+7O2ocYYSPriLy5grUkvc0pgFKrKhlhPqsYFZ6St+bQiGc3QpJ3q6SbiNA8HbUymcdQWC2avQLFVBLoklMXMCoXt7izsNbPpqc1+4P7SGeT828bNSxnxVH1uIqnF/CT8RBkw6C2VkKHcY7ehiFIVCnNUUCqPno6P3mONRHKESiCPimbxtzTQyDW8qP74RnIZ8dMbUbrOg55iyKllUarsyGCPDK+rn7ZUdmuGCnbBcCVeqEYM6S68dmZj/ZSO0mgd1qkZ0rThKlU+m51kUv4Z1UTlptTa4/WHM685BCA/4vOufB/iw2x5vPFarmrFlOQeJagsV8HyDHp2M9Q22BXUlsKc2XARN6PPqjvzidf1DBvCiKR46hWh8bYh9oPQNQBUYMboA/IT/JNXFJZuzlF5Ni7In8EBW2g6F/D9/IH5y8uoy3fw1uCWOcy8ZU015A4viiOkuKW2TNdVw9yzmcQxBvo1otb7jcqXfAzeR23QsOe6BkOMJ7SchsRc0Tnn7x24ZcBIhqkRP4RE2K4ShYY6YwCD/XbgkczDa+drvmmLHZrc76xnXRmHuz7hXgYmzRW6FnSwEa+oKWbwZOfefJkwo5nUOZlPVlMdGKEOEHJpAjQMlVtp9szRE8N7F22RZr4wVOjaMhnm/a0uB3le81QbxyFQLRO/NRj+IE8THHTLJMsMBy8O9383BIqDHwvqxI+y7qmZpYd/g4sy6QUJlBGcwBiH5LShU7RX2oxYRWEyKNFK0Iklchs7Y2UbJB0qZQRKarVrZ6Drf1lr6vcfCrZggTC0sQPcuVAqk4otPE/08vvYFJUdD9QJdw/YPippjPwm1LK8vEw21oPRT9dpECjipjMiugyfhcSMbYm1N3u0o4MwZzh5wAoqRx2og9WSImbSbAizFdFTaE0PaItvCSmtwb2R7hB1R7KkLepgPu62WCT6Ky8v9nOVFeZfTRBjmUe0Taixhx04kNlLrEvykxL24dveXClv+OajX1Tpr6m7vKjU/zyyAgetPgYSr57axud/X5AHdh+b97ruiSIozcvxaptOqM2/qzDoYVQpuQdFHDrpxOaU+RWMWEGkwrrixz8HWaZKA3nxEJmxe5atfk0dHIcHnl7U/93GDKn8PTN+Msrgrfe3IdsX8BZUejzMH3U= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(366016)(376014)(7416014)(1800799024)(921020)(38350700014);DIR:O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rqCcSjVHXqGOkp1+hC8dgLc1dbAQoRH7eP2NYqnHZheKNPynMFvBvamljzLi8C5GiNOQFeE/kpgDsOFJ3xNzNuC6njuZAN39l8NxXiSxQ/Gk1d5e5gaB0bMMK3IXLGNZFCc39UZi9oXGX9pvh1qR1ivXrIlV7pfTAd7+0UjWRbE749kZ2ND28futSEPCGXlJ6SgpHWCT4/H+maJr9j3kOrkNM4U/9GhDRQEzJyrB+M0Wf6LU0RidqPzBUFDzfdICrscBD9HKdGsOUH77YOnvS8qe7CqB4Hom2gjQyO8aUMGdtI56LhRZCrMJFeHS1Og1K9GKwaVA2qDj6246RgjgbpBUYyOwdu+ZTxCicMxjZU4Wqt5Y/kqC/7mluq5XZe1YlDM6bF/jU9VeRE5L1hH+b/yrIiDTfwcmmogBGPJK0fm1zjYQB5XJC28x/+fWMyp25mghHQYzwN8sk4lYX3zsM4zDY8kBqsrgCTVOfBOmdK1k3ZlAuvi12HW0D+8+78b44UtcWKA8SIQnINfH6731ip8lld2QMHWQJh/gC+f+W1EvJj91IZgKgjwshel5bpevicDTxzaxSGRDUOI7tnwsbivIAUECOAhyJIxzG9WN0AjctIG+EiEj3Qq5XlSGlYGSA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe43efdc-a508-47b9-5879-08dc97144fce X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2024 01:47:47.4915 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Sf0JnBzzg3aiaeOnuXx4YuysZAjmN9BZ1q1YM1jdvyaVpqSAHNIBz8dloHghaCgGKO3Gr56r/cVkJ/7HeBInk747WZbkb9pLt63cTvoELTHeUQD5ZpRiK38ZI3qCqH96 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11434 simple-audio-mux is designed to be used generally, thus "Input 1" or "Input 2" are used to selecting MUX input. This numbered inputs would work, but might be not user friendly in some case, for example in case of system hardware design has some clear labels. Adds new "state-labels" property and enable to select MUX by own state names. Original > amixer set "MUX" "Input 1" Use mux-names sound_mux: mux { compatible = "simple-audio-mux"; mux-gpios = <...>; state-labels = "Label_A", "Label_B"; }; > amixer set "MUX" "Label_A" Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/simple-mux.c | 55 +++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/sound/soc/codecs/simple-mux.c b/sound/soc/codecs/simple-mux.c index bf67de12d20b..240af0563283 100644 --- a/sound/soc/codecs/simple-mux.c +++ b/sound/soc/codecs/simple-mux.c @@ -9,12 +9,21 @@ #include #include +#define MUX_TEXT_SIZE 2 +#define MUX_WIDGET_SIZE 4 +#define MUX_ROUTE_SIZE 3 struct simple_mux { struct gpio_desc *gpiod_mux; unsigned int mux; + const char *mux_texts[MUX_TEXT_SIZE]; + struct soc_enum mux_enum; + struct snd_kcontrol_new mux_mux; + struct snd_soc_dapm_widget mux_widgets[MUX_WIDGET_SIZE]; + struct snd_soc_dapm_route mux_routes[MUX_ROUTE_SIZE]; + struct snd_soc_component_driver mux_driver; }; -static const char * const simple_mux_texts[] = { +static const char * const simple_mux_texts[MUX_TEXT_SIZE] = { "Input 1", "Input 2" }; @@ -66,30 +75,23 @@ static unsigned int simple_mux_read(struct snd_soc_component *component, static const struct snd_kcontrol_new simple_mux_mux = SOC_DAPM_ENUM_EXT("Muxer", simple_mux_enum, simple_mux_control_get, simple_mux_control_put); -static const struct snd_soc_dapm_widget simple_mux_dapm_widgets[] = { +static const struct snd_soc_dapm_widget simple_mux_dapm_widgets[MUX_WIDGET_SIZE] = { SND_SOC_DAPM_INPUT("IN1"), SND_SOC_DAPM_INPUT("IN2"), - SND_SOC_DAPM_MUX("MUX", SND_SOC_NOPM, 0, 0, &simple_mux_mux), + SND_SOC_DAPM_MUX("MUX", SND_SOC_NOPM, 0, 0, &simple_mux_mux), // see simple_mux_probe() SND_SOC_DAPM_OUTPUT("OUT"), }; -static const struct snd_soc_dapm_route simple_mux_dapm_routes[] = { +static const struct snd_soc_dapm_route simple_mux_dapm_routes[MUX_ROUTE_SIZE] = { { "OUT", NULL, "MUX" }, - { "MUX", "Input 1", "IN1" }, - { "MUX", "Input 2", "IN2" }, -}; - -static const struct snd_soc_component_driver simple_mux_component_driver = { - .dapm_widgets = simple_mux_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(simple_mux_dapm_widgets), - .dapm_routes = simple_mux_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(simple_mux_dapm_routes), - .read = simple_mux_read, + { "MUX", "Input 1", "IN1" }, // see simple_mux_probe() + { "MUX", "Input 2", "IN2" }, // see simple_mux_probe() }; static int simple_mux_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; struct simple_mux *priv; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -103,7 +105,30 @@ static int simple_mux_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(priv->gpiod_mux), "Failed to get 'mux' gpio"); - return devm_snd_soc_register_component(dev, &simple_mux_component_driver, NULL, 0); + /* Copy default settings */ + memcpy(&priv->mux_texts, &simple_mux_texts, sizeof(priv->mux_texts)); + memcpy(&priv->mux_enum, &simple_mux_enum, sizeof(priv->mux_enum)); + memcpy(&priv->mux_mux, &simple_mux_mux, sizeof(priv->mux_mux)); + memcpy(&priv->mux_widgets, &simple_mux_dapm_widgets, sizeof(priv->mux_widgets)); + memcpy(&priv->mux_routes, &simple_mux_dapm_routes, sizeof(priv->mux_routes)); + + priv->mux_driver.dapm_widgets = priv->mux_widgets; + priv->mux_driver.num_dapm_widgets = MUX_WIDGET_SIZE; + priv->mux_driver.dapm_routes = priv->mux_routes; + priv->mux_driver.num_dapm_routes = MUX_ROUTE_SIZE; + priv->mux_driver.read = simple_mux_read; + + /* Overwrite text ("Input 1", "Input 2") if property exists */ + of_property_read_string_array(np, "state-labels", priv->mux_texts, MUX_TEXT_SIZE); + + /* switch to use priv data instead of default */ + priv->mux_enum.texts = priv->mux_texts; + priv->mux_mux.private_value = (unsigned long)&priv->mux_enum; + priv->mux_widgets[2].kcontrol_news = &priv->mux_mux; + priv->mux_routes[1].control = priv->mux_texts[0]; // "Input 1" + priv->mux_routes[2].control = priv->mux_texts[1]; // "Input 2" + + return devm_snd_soc_register_component(dev, &priv->mux_driver, NULL, 0); } #ifdef CONFIG_OF From patchwork Fri Jun 28 01:47:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13715375 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2057.outbound.protection.outlook.com [40.107.113.57]) (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 658E8125DB; Fri, 28 Jun 2024 01:48:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719539282; cv=fail; b=ojOwmu4LECM0P0sgnfWdcHINfoIxjrCgQj4xRYbQ3bb7BTBCwJZJ5TJ5dBfYn6rh0Z+RiaJFqfe29k+dg26dcIwZLONnNGuZEisGepsFYJKgP/ylVGk5c2zhbXtdfQYyPyCn5XoI+vnUgXBdlmwwMlyZPAemyybh1T1Dwx9LgeA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719539282; c=relaxed/simple; bh=AaMrLZgBc02FiWy9uvzjnD8w+ZORFU1I987r2DWPybM=; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type: Date:MIME-Version; b=FMcI2Q/j8WEQlb19539PG73XCN+KHgoAMsP97LwArwK1PLMbC7XcH0HF1+leCQCtveUvfgeQW/Vk1tcvjbQnkFwrqXnwodAnKb++wlOlm89PUasN6KW47/aFf/BgKM3SuPgcC8T2cY7LVItjiJqVKrOPooR2BqciNNHrtRhmBCg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=LDiF8Lbm; arc=fail smtp.client-ip=40.107.113.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="LDiF8Lbm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OWZ6Udw6BXMhfB03Ui/CxCxEfoxG8dfLpIrXpxjgF48f8xBE1L63CNcgqKIX2OoDOdnpEcE4FaVC3M411NcUGggIe6+aiaMQDANnSC6VQjJIHLyYSRLfaEY+RdWYLLdP3tr/V+5P+sf2a/P5z+Wu4wVklk8APtABKbmXBH2NYbikJRk7npbGGgZX/689u862IZtDHjzFP3m1AwieXSF4FNk/VcgcD/G430Qua1k5lKCmTFiC7zc/+x6iRM0WaBRq2Dr88hvZMlbTBMweLsrGzzvcXzDTaS0BwmEVkxbCUU+MrczVymH1p1QxMxa4TafTuqmvkshx2lsTbHvWRin3pA== 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=NVY3oRgsh6M60t9TbuZjUC/hFLe3TSuxpb07/Q3ATXI=; b=UYjs8fLJ56X1r1BKbD+7zB67KD+LanUYws/GewAu/uk/ruklbKS7/Tw+pROhHvXbex/toXsaZsl7biEyeDZU6Tnr1VM1vhMltLyqZUC2q7yxpqQwOzJV6zW8SRXE51vadwd9lDv4NnSsc9ustzpceiT5B/7bHIJaldptmlROdrJDN/gagJBrabh0QeLdcwhwWa/odwTOmRgSDO7ME8n+T6A8qdKyZGCYlzqxTtRxdcbbcBWoKmMIfHIUek6wnPbcJdw1cN23LgXVUzKROUKaHm/z4pqyXX7i54Y5nT6o4RJcPCkV6q5Tj83QnIwNbWEngd2NAbvTFHrJ8XFZYzhOVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NVY3oRgsh6M60t9TbuZjUC/hFLe3TSuxpb07/Q3ATXI=; b=LDiF8LbmrBTsAT7AHRrJ5/EEb3Gp0QTCymrCELrWXo6Wok7yN4w5yaeym3DOpKlVs8AhNYbBlzbdgFz4v3L/D2ybH4TO9MB9NJa+iAt0CIbuFsn/p/fxoFSnQ3dKDYBR//kQQG2U7gT2SVqDttAEnmQquQqjZwXfIfKNYRj5r9k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB11434.jpnprd01.prod.outlook.com (2603:1096:400:379::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Fri, 28 Jun 2024 01:47:58 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7719.022; Fri, 28 Jun 2024 01:47:58 +0000 Message-ID: <87ed8halde.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 2/2] ASoC: dt-bindings: simple-audio-mux: add mux-names property User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Alexandre Belloni , Conor Dooley , Jaroslav Kysela , Krzysztof Kozlowski , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Rob Herring , Takashi Iwai , devicetree@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87h6ddale3.wl-kuninori.morimoto.gx@renesas.com> References: <87h6ddale3.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 28 Jun 2024 01:47:57 +0000 X-ClientProxiedBy: TYCP301CA0004.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::12) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB11434:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b024d24-bc51-48f8-60a8-08dc97145613 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|376014|7416014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: W/kFC1jPQsSQyT+RKEbDrEaf8zjbhm6G5uNiVbj6X8dIWxv1HKMGTd0J+tw0GO6wCb2lV/wcN+bBcSi7kd4uQadRqoEtRYDjckw/6IIwB7SUBqHznTNCLxDyIOWCeINFC9+PcsCmh7d1KMk23oVMHN0B4Mhigwm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hwCBEVwrd1cldmZfAHtR+4+cq1WDHPxFKI107blkoxLM38hIZcxqWJ0dRcryZqWJPcNeL8DJy2joJnAi1RsxTpKzaDFh3OhHXcl4BpTx7LWBlxt/DvB9T3ZKjslb+zY1OK2vDcHiaVV3ypYRHpzLbcufzNluoBJDrRSbMga0+hDGRR/ugSnRT2a1nX9itTv7k11e8ubzY3qm0yWWCI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(366016)(376014)(7416014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mAxZZUchIuDz8ZvHDssTLouRIP/WodQKs6XDvDHPST8Cb3eLNW0bthXlVq+vZHJBR5Q88qfVcYcsY434FLYHPnyI+KAZpZ6uTI7h0RowREZx2oKcDzTQ3FWJI87kBkvBFSZluD3LUYARbFbSNYMDl9wiFoJ/OHmiCpR9AIoVhJ1rV7fMycDZd/MnUpAwvOIl4Rnvv/anE154dDH3Ey6q5pauuUckvvMswwLN9IW/q3N6sOplGjkQTB/v4/Q8Uyjf1X0R5MLdaRWTME4KQ5XWdNhreGucTMYFUurVIcLkDTT2LZusc/XLxyOS9ogiKHOl1uolBZOVjSt29Ks8fpCCFJKN1gU3HGHoo+6LKR6cS0Fz0VWSHlNp5q+c7yQdi3MqxdykhnM9kY8nLTn3psSAbsntlz1HhAjQJfpEbQfdLREf0Ax6u1c8hj4tzh3CfjVcRnVioxC0FZXnUjWMNvQAAMg4jK/tJ270xPDoQvJsDyIMAu1e4rUw2pMctiHIOAsnoHXFbxgcQMfNejDxJONY8HHV2aJfhJGnEvhY5MSleHLzfyA5/PmW+4XeQCTtdvwdqJ2uAXf0teWU4X6SWTGY1wiH1iTPKBc37MG9Rt+0df02TzbccQ70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-48f8-60a8-08dc97145613 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2024 01:47:57.9940 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aWiBSyOW1cAo2n5V7UeR9ax8g9d0Se/hDxhOB5CJxUG7cll5f8KVXvRdCrqus28ngLBS20Wf/8lT3uvg8dkK2C1Ab66Rc+Yztz7cZk6c7e+CniUOsURdKmEnLvPwFmvv X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11434 simple-audio-mux is designed to be used generally, thus "Input 1" or "Input 2" are used to selecting MUX input. This numbered inputs would work, but might be not user friendly in some case, for example in case of system hardware design has some clear labels. Adds new "state-labels" property and enable to select MUX by own state names. Signed-off-by: Kuninori Morimoto --- .../devicetree/bindings/sound/simple-audio-mux.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/simple-audio-mux.yaml b/Documentation/devicetree/bindings/sound/simple-audio-mux.yaml index 9f319caf3db7..3b38a0753282 100644 --- a/Documentation/devicetree/bindings/sound/simple-audio-mux.yaml +++ b/Documentation/devicetree/bindings/sound/simple-audio-mux.yaml @@ -24,6 +24,11 @@ properties: description: | GPIOs used to select the input line. + state-labels: + description: | + State of input line. default is "Input 1", "Input 2" + $ref: /schemas/types.yaml#/definitions/string-array + sound-name-prefix: true required: @@ -37,4 +42,5 @@ examples: mux { compatible = "simple-audio-mux"; mux-gpios = <&gpio 3 0>; + state-labels = "Label_A", "Label_B"; };