From patchwork Tue Apr 30 07:25:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baojun Xu X-Patchwork-Id: 13649029 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0054C4345F for ; Tue, 30 Apr 2024 13:48:09 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9D668E9F; Tue, 30 Apr 2024 15:47:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9D668E9F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714484887; bh=f4HexFXrgl33Xvb0NsdgdkEQEzHfWh5sA10LWpZKdS4=; h=From:To:CC:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=XLQChfekFh9GLl6VXNJA3Qt4eeTseUBrbDTH83ARfgozxvIbxW7G54kDgW/6cAwec usZIinJn5c1kcyfXYXDTZu+ulqQbWTIzjX6mYz2r6G0LxdIOmXf1S+htPWtaaCKB1L k2lmOXpBSdcke+8XdSYxLF8EnDi4LH+fYoLq+QXU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A51F6F805F3; Tue, 30 Apr 2024 15:47:05 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 74137F805E8; Tue, 30 Apr 2024 15:47:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1F290F80269; Tue, 30 Apr 2024 09:26:52 +0200 (CEST) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1CF03F8023A for ; Tue, 30 Apr 2024 09:26:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1CF03F8023A Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=GoTCIlfl Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 43U7QbNU087453; Tue, 30 Apr 2024 02:26:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1714461997; bh=KTYnkmUys+v1UyGXnvoxWeo9cURnTj9K09u6LrUM9CA=; h=From:To:CC:Subject:Date; b=GoTCIlflIYy4J7RgskGGNAOfB0uv3KFT0dmKyNc/UC1SFKtYY3meBzzuE+BpkaZ05 PbmjhSBbE+3ax88IjO6NkJgRpcjaMssHVtSA3XCQs7It2o8p0MRiA5Vug50H8Kam81 zj0UC/aNjsN6JPTvHp2QSAngJTksVlGRsNz1mWLs= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 43U7QbJr129537 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Apr 2024 02:26:37 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 30 Apr 2024 02:26:36 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 30 Apr 2024 02:26:36 -0500 Received: from lelvsmtp5.itg.ti.com ([10.250.165.138]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 43U7QT59096668; Tue, 30 Apr 2024 02:26:30 -0500 From: Baojun Xu To: CC: , , , , , , , , <13916275206@139.com>, , , , , , , , , Subject: [PATCH v4 0/3] ALSA: hda/tas2781: Add tas2781 driver for SPI. Date: Tue, 30 Apr 2024 15:25:41 +0800 Message-ID: <20240430072544.1877-1-baojun.xu@ti.com> X-Mailer: git-send-email 2.43.0.windows.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-MailFrom: baojun.xu@ti.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: D74KN5Y2CK3AKIL5L22YKXPQF6UVIANG X-Message-ID-Hash: D74KN5Y2CK3AKIL5L22YKXPQF6UVIANG X-Mailman-Approved-At: Tue, 30 Apr 2024 13:46:57 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This patch was used to add TAS2781 devices on SPI support in sound/pci/hda. It use ACPI node descript about parameters of TAS2781 on SPI, it like: Scope (_SB.PC00.SPI0) { Device (GSPK) { Name (_HID, "TXNW2781") // _HID: Hardware ID Method (_CRS, 0, NotSerialized) { Name (RBUF, ResourceTemplate () { SpiSerialBusV2 (...) SpiSerialBusV2 (...) } } } } And in platform/x86/serial-multi-instantiate.c, those spi devices will be added into system as a single SPI device, so TAS2781 SPI driver will probe twice for every single SPI device. And driver will also parser mono DSP firmware binary and RCA binary for itself. Signed-off-by: Baojun Xu Baojun Xu (3): ALSA: hda/tas2781: Add tas2781 hda driver based on SPI ALSA: hda/tas2781: Tas2781 hda driver for SPI ALSA: hda/tas2781: Firmware load for tas2781 hda driver based on SPI drivers/acpi/scan.c | 2 + .../platform/x86/serial-multi-instantiate.c | 13 + sound/pci/hda/Kconfig | 14 + sound/pci/hda/Makefile | 2 + sound/pci/hda/patch_realtek.c | 13 + sound/pci/hda/tas2781-spi.h | 149 ++ sound/pci/hda/tas2781_hda_spi.c | 1240 +++++++++ sound/pci/hda/tas2781_spi_fwlib.c | 2252 +++++++++++++++++ 8 files changed, 3685 insertions(+) create mode 100644 sound/pci/hda/tas2781-spi.h create mode 100644 sound/pci/hda/tas2781_hda_spi.c create mode 100644 sound/pci/hda/tas2781_spi_fwlib.c