From patchwork Mon Jun 6 19:19:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Povi=C5=A1er?= X-Patchwork-Id: 12870779 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 81626CCA473 for ; Mon, 6 Jun 2022 19:20:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F01B71B0D; Mon, 6 Jun 2022 21:19:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F01B71B0D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654543248; bh=P1N4BsgZxARnYuz2PFM5gvoKvKngCq7DsoINvzTzaTU=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=AlACeanvkheb2t6aHmEfI9nli/53WwLUUcgzq08HzMQi1eInkw8/KzV1WPHQFwjsz 2afj9VR957K8ufbKFZTKCls5AQX/ffLj99nYWzCVTw+zUkOVpcc7IXo/8ze1/0/B32 KiuQxttWuf/CMdDM18ya4WsyN4+5OIXR+Mdnff6o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 82C22F801D8; Mon, 6 Jun 2022 21:19:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CD6E5F80109; Mon, 6 Jun 2022 21:19:55 +0200 (CEST) Received: from hutie.ust.cz (unknown [IPv6:2a03:3b40:fe:f0::1]) (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 E1CBFF80109 for ; Mon, 6 Jun 2022 21:19:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E1CBFF80109 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=cutebit.org header.i=@cutebit.org header.b="NTBH9HEp" From: =?utf-8?q?Martin_Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1654543191; bh=/hmKUt7bKZ+vS3xQgBgBubVAOQI0iUYXfBsj1iDGvNo=; h=From:To:Cc:Subject:Date; b=NTBH9HEpba5B0vY0Fb0D/5XET+BqBriweMvoXzWlV2IMrfLln9CzCQR4ds1HgKSun n9hBgB5grSVVoF5dVG5IoXB84nUpb6FFpU63OJD808r5gtjeNKHp7Ri68QE6uuFXMr 16xzkpyosI07VekfptdOMf614aGaP6bxlswQ/QYU= To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai Subject: [RFC PATCH v2 0/5] Apple Macs machine/platform ASoC driver Date: Mon, 6 Jun 2022 21:19:05 +0200 Message-Id: <20220606191910.16580-1-povik+lin@cutebit.org> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Sven Peter , Hector Martin , linux-kernel@vger.kernel.org, asahi@lists.linux.dev, Mark Kettenis , =?utf-8?q?Martin_Povi=C5=A1er?= X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Hi all, This is again RFC with a machine-level ASoC driver for recent Apple Macs with the M1 line of chips. This time I attached the platform driver too for good measure. What I am interested in the most is checking the overall approach, especially on two points (both in some ways already discussed in previous RFC [0]): - The way the platform/machine driver handles the fact that multiple I2S ports (now backend DAIs) can be driven by/connected to the same SERDES unit (now in effect a frontend DAI). After previous discussion I have transitioned to DPCM to model this. I took the opportunity of dynamic backend/frontend routing to support speakers/headphones runtime switching. More on this in comments at top of the machine and platform driver. - The way the machine driver deactivates some of the controls where suitable, and limits volume on others. I added a new ASoC card method to that end. Kind regards, Martin [0] https://lore.kernel.org/linux-devicetree/20220331000449.41062-1-povik+lin@cutebit.org/ Martin PoviĊĦer (5): dt-bindings: sound: Add Apple MCA I2S transceiver dt-bindings: sound: Add Apple Macs sound peripherals ASoC: apple: Add MCA platform driver for Apple SoCs ASoC: Introduce 'fixup_controls' card method ASoC: apple: Add macaudio machine driver .../bindings/sound/apple,macaudio.yaml | 157 +++ .../devicetree/bindings/sound/apple,mca.yaml | 102 ++ include/sound/soc-card.h | 1 + include/sound/soc.h | 1 + sound/soc/Kconfig | 1 + sound/soc/Makefile | 1 + sound/soc/apple/Kconfig | 25 + sound/soc/apple/Makefile | 5 + sound/soc/apple/macaudio.c | 1004 +++++++++++++++ sound/soc/apple/mca.c | 1122 +++++++++++++++++ sound/soc/soc-card.c | 6 + sound/soc/soc-core.c | 1 + 12 files changed, 2426 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/apple,macaudio.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,mca.yaml create mode 100644 sound/soc/apple/Kconfig create mode 100644 sound/soc/apple/Makefile create mode 100644 sound/soc/apple/macaudio.c create mode 100644 sound/soc/apple/mca.c