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: 1639538 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cutebit.org header.i=@cutebit.org header.a=rsa-sha256 header.s=mail header.b=NTBH9HEp; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LH3GW1TqWz9sFk for ; Tue, 7 Jun 2022 05:20:02 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231601AbiFFTT6 (ORCPT ); Mon, 6 Jun 2022 15:19:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230475AbiFFTT6 (ORCPT ); Mon, 6 Jun 2022 15:19:58 -0400 Received: from hutie.ust.cz (hutie.ust.cz [185.8.165.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DEF3113A21; Mon, 6 Jun 2022 12:19:54 -0700 (PDT) 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 Cc: =?utf-8?q?Martin_Povi=C5=A1er?= , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Kettenis , Hector Martin , Sven Peter , asahi@lists.linux.dev 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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