From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from PH8PR06CU001.outbound.protection.outlook.com (mail-westus3azon11012000.outbound.protection.outlook.com [40.107.209.0]) (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 AABA62E8B64 for ; Thu, 20 Nov 2025 09:21:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.209.0 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763630515; cv=fail; b=RwtUCSJ6/tQyUwU4Q6cfBxUvNQfXxyjtH4YoA8qvB5hrKxFK4WjKFiF4Wxfs0+W7ptpxbLeikEj8Fxmz8RKSOetouOAb21ShXPVEEovufY2GMTL3602fEhN+EmlSrv0XBJPFAsMsrvbdlxYQWTqKd+Vj8FdSA0RcXxHAOtm9N54= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763630515; c=relaxed/simple; bh=F/00U6r6QTOQo2Hk90gTihBivuh252BkrXrbxx5YNJE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S5ZuMjTf/fi6eNEPNjtKNFM19RHwXT8Ky004AVc9n9oDZdxG5ByZRhaW2CNX8jnBKJjU3SmyEnLxbr6HwWoN8fUMdczwE3rhWQRG0ct+eN6UknOhbUkh4PKcCDIU0fN5UfPw1c5ALqHqlFivxAnd+gbT3vbzQimnplZCSUBsj9s= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=T+d6Que6; arc=fail smtp.client-ip=40.107.209.0 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="T+d6Que6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=x6AeLsETLFLgvH/yqdkzCDa1R6gCEKZls7Xgb9VF+NqY8KrkrugVjVTqxBUKrE/nXSMz7zVxmwRIgGXKO2TMD4FEAaib41XAAafBF5Vs4Mcwwmn3eB8+cv9iMBV/0DirPzpnY1hAAL1fS3Mj8qQCdgDyX8lqX+HZAAYCaD001d8ei3alz25YkmaK8njQIt4EgqLSJ4FKupSEwelyP18CYyntxGeRCjFPEvYXZ9acS16yNov7MnZGu4dfuYkbALbb31bc4rw1qGuqC8aPZT8efxa6l4TlKbkk7BFIC8/W31nI/OwVRRR5t4mYhk1dDGXRdifdkW7wCz0xOi4QYZtMAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=VIS2eLeAsRp4qR7J3UbolPVmnCJDdx6upuP8ymLtQek=; b=ilv0MlIxvamkS86VOe/sjdgS8XfsIXwkYjs3/9/K+FH3Kj5hDf8OiB2wR8R/Sl1GJNuTmte6yTzfOzMVc/GdVZgvu+j9wA8aYOnDCVjX6jHzEMjwSryw9dx52Gg0FA1V2DpsWHGWe+8nn+W/WzbXGXtXx2GqkxRvjVfzKQMRRtGroJ1wUWlyOlZC/S2K1rONU98ZSQ5g/lFWlGvO56m5uUhDgpDDX3EqXMbZ2Juqt58V91xUdcW+XMGsi2yDONPmetlzZ2/OrxJGZlkTWv8V/coHB5mimTmmev9N4y7O0GmdXs68Z2FFW3TK4p5z5qwQ+Y/nru12s1ieFr9n/klhsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.194) smtp.rcpttodomain=linaro.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VIS2eLeAsRp4qR7J3UbolPVmnCJDdx6upuP8ymLtQek=; b=T+d6Que61m3u/Dic6KYY2e1KXrx4vbAtTX8Q140UswXSq6QgYs3bAJYmfSZgGxRj0vR2baZ3nvQZemnts/yjs49jw70mQmqxanMTCAvEZAzaNz42tCs+6OQTy6fJrofAD7F8mTMjzaMhdrNctC5HrWGqlCAN3N3sjhzsQxIEPY0= Received: from SJ0PR03CA0138.namprd03.prod.outlook.com (2603:10b6:a03:33c::23) by PH3PPFB6E8A1B1E.namprd10.prod.outlook.com (2603:10b6:518:1::7c2) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9343.11; Thu, 20 Nov 2025 09:21:51 +0000 Received: from CO1PEPF000042A9.namprd03.prod.outlook.com (2603:10b6:a03:33c:cafe::8e) by SJ0PR03CA0138.outlook.office365.com (2603:10b6:a03:33c::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9343.10 via Frontend Transport; Thu, 20 Nov 2025 09:21:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C Received: from flwvzet200.ext.ti.com (198.47.21.194) by CO1PEPF000042A9.mail.protection.outlook.com (10.167.243.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9343.9 via Frontend Transport; Thu, 20 Nov 2025 09:21:49 +0000 Received: from DFLE215.ent.ti.com (10.64.6.73) by flwvzet200.ext.ti.com (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 20 Nov 2025 03:21:43 -0600 Received: from DFLE212.ent.ti.com (10.64.6.70) by DFLE215.ent.ti.com (10.64.6.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 20 Nov 2025 03:21:42 -0600 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE212.ent.ti.com (10.64.6.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Thu, 20 Nov 2025 03:21:42 -0600 Received: from LTPW0EX92E.dhcp.ti.com ([10.249.133.122]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 5AK9L1c53383883; Thu, 20 Nov 2025 03:21:37 -0600 From: Niranjan H Y To: CC: , , , , , , , , , , , , , , , , , Niranjan H Y Subject: [PATCH v1 5/8] ASoc: tas2783A: fw name based on system details Date: Thu, 20 Nov 2025 14:50:47 +0530 Message-ID: <20251120092050.1218-5-niranjan.hy@ti.com> X-Mailer: git-send-email 2.33.0.windows.2 In-Reply-To: <20251120092050.1218-1-niranjan.hy@ti.com> References: <20251120092050.1218-1-niranjan.hy@ti.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042A9:EE_|PH3PPFB6E8A1B1E:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c0336e8-0012-4ca9-3fa6-08de28163c54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|7416014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?WazA/YRJ0VMX3rAZW+WVTsVe00Y+K//xCMWFmgl38H/yvG9kDVdyLHEEEOop?= =?us-ascii?Q?+3v5H3wsh9gIiUkRNMzwZd/dHMYt1HR6zBIOjPfpF07zylxyfvqQgUgJbBZm?= =?us-ascii?Q?4h498F1MPJUWnApC36lkefbvzbIKKUDKOs6PsKAlifGfFoDGg4JQg9aeQtOx?= =?us-ascii?Q?Ne2kEOX9ehGs6hE9fv2m/Wr8eKpu+rzyIbjA7OZcxfDTNYHmyS/WeZPFMjbt?= =?us-ascii?Q?ltak/P+24T6vt05Cul13z3NnOKLVbLLpMjlEYfdoGnJyzuRfpMGHEogMl/wt?= =?us-ascii?Q?fNUKfI0pA/yhC3YwI2qTLEMBPmcRemxQc1uERD+XtqBgh21TmvGHdMzWLc5h?= =?us-ascii?Q?ZpE114rJTNk3nX94rPCtMUUK0xJ4tDzw+8048HfIC2OmrjkKLBkIiC7YjJwG?= =?us-ascii?Q?wSE5XOkCfNVeyO7vH4UCyPOu4WlctlIxqrPmtYH64tnBCjKH7BFTgU4kwqcQ?= =?us-ascii?Q?xkMQjTH7aUa1kAUvLiC8BtxgjF4H+FwcDb3TtbO/+SF+7fF/2thNBN8QS4AM?= =?us-ascii?Q?EQhTlab+TwNIt/ScGb3LZe5X+pw2RyqoaXWKyIwfLJ1FYEXZn5lJ0khILaUH?= =?us-ascii?Q?nHdn4/cUPEUATQNDs0e4OutkagwHoaucjE7oImn+i+YqXwn7x5u8Cj2OnLji?= =?us-ascii?Q?ouVyFVRpnxmGneTqV0sZB2WEUQO4XtDPQ776q5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dxHY+dUB9y13MLs8NE=3D?= X-Forefront-Antispam-Report: CIP:198.47.21.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet200.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(36860700013)(376014)(7416014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2025 09:21:49.8375 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c0336e8-0012-4ca9-3fa6-08de28163c54 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.194];Helo=[flwvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042A9.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH3PPFB6E8A1B1E The firmware file for tas2783A contains the device and algorithm settings. So the firmware files are unique for a system and driver should have the ability to distinctly identify and pick the right firmware. This commit adds the method to uniquely identify the firmware for a system based on the below format. --.bin * Subsystem is the PCI device subsystem-id * Link is the SoundWire link id on which the device recides. * Unique is the SoundWire slave unique id in the system. Signed-off-by: Niranjan H Y --- sound/soc/codecs/tas2783-sdw.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/tas2783-sdw.c b/sound/soc/codecs/tas2783-sdw.c index 397442cd6..adfbccedb 100644 --- a/sound/soc/codecs/tas2783-sdw.c +++ b/sound/soc/codecs/tas2783-sdw.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -1162,8 +1163,21 @@ static const struct dev_pm_ops tas2783_sdca_pm = { RUNTIME_PM_OPS(tas2783_sdca_dev_suspend, tas2783_sdca_dev_resume, NULL) }; +static struct pci_dev *tas_get_pci_dev(struct sdw_slave *peripheral) +{ + struct device *dev = &peripheral->dev; + + for (; dev; dev = dev->parent) + if (dev->bus == &pci_bus_type) + return to_pci_dev(dev); + + return NULL; +} + static s32 tas_io_init(struct device *dev, struct sdw_slave *slave) { + struct pci_dev *pci; + struct sdw_bus *bus; struct tas2783_prv *tas_dev = dev_get_drvdata(dev); s32 ret; u8 unique_id = tas_dev->sdw_peripheral->id.unique_id; @@ -1171,6 +1185,13 @@ static s32 tas_io_init(struct device *dev, struct sdw_slave *slave) if (tas_dev->hw_init) return 0; + pci = tas_get_pci_dev(slave); + if (!pci) { + dev_err(dev, "pci device id can't be read"); + return -EINVAL; + } + + bus = slave->bus; tas_dev->fw_dl_task_done = false; tas_dev->fw_dl_success = false; @@ -1181,8 +1202,10 @@ static s32 tas_io_init(struct device *dev, struct sdw_slave *slave) } usleep_range(2000, 2200); + /* subsystem_id-link_id-unique_id */ scnprintf(tas_dev->rca_binaryname, sizeof(tas_dev->rca_binaryname), - "tas2783-%01x.bin", unique_id); + "%04X-%1X-%1X.bin", pci->subsystem_device, bus->link_id, + unique_id); ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, tas_dev->rca_binaryname, tas_dev->dev, -- 2.25.1