From patchwork Fri Jan 27 16:51:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Binding X-Patchwork-Id: 4642 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp933873wrn; Fri, 27 Jan 2023 08:53:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXsSspvm3gZ3noZo58yzRiWoRi6lN3mSbF9F0F+7bQTf8tSq79JvArY3CaW6UZozalnGs68P X-Received: by 2002:a05:6402:2686:b0:46d:c288:e798 with SMTP id w6-20020a056402268600b0046dc288e798mr56578692edd.21.1674838405741; Fri, 27 Jan 2023 08:53:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674838405; cv=none; d=google.com; s=arc-20160816; b=r4k7DkZtW0UPmkvQ+7dnCZQYj4Y8HOX/B63Wfa7AtYLfqB2LP6JK45PYENDkMSnWLx fMUVn7JhPmi07KjAN+aHuogDo5fjtNzf3b8ZfxMUU0MSc1KzXrwKRkBJZUTYNNrCIwf1 aVeAhzYiS7+zW9JFxjNlualkGi4vSgvApBJAj2WD/1b5oFoUbYEQthhw4N0bUWqKY2Op T3bCTNeGiiox/gRKkX2WKqg1jHAECHQgQlNLV/dKEGHRcOqDYTpW/BqbcMFkfCAQPWGN 4vy6lpQDYeiv7i/w9o5aAB402NeWhDOpc0RDZKpnz9aUyT3N3eVIaAmvGl4CoQBRjgoO +Kbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=lY5UIsZ69hx/4gHdwcW0N1VKa4Qb9oFZA+396K23HMk=; b=jEru+iKRBOIWD7dkCGA/gjhChXd+XbtIIz68dArn/ljJ9iS6nU/cAIeZ/GOVYES+1O Vy7qhQxcqdeZS5n0vzJ12el4SaEpr985SqZsMfcdjn+igDP3AcbWLSqsQOFEeZHGv6c/ P3ZiW1yg1vSE56SsP1Qo5TQjfPAjXCF4YMFzg1kzggDTKnH9UtlJb1HCFRIzy9MXE+E8 2NPW6Fe9GR/gXI7VIH0m7MWY761iNyj0P8Ncy/snMMnl4KuUEPkDFEC30vqIaGRo6upM QiF3dFBYq4aRi5a3/yYRlIX2JazpS8vwm8iavY1pxlyK2qAVxux2dnZClEDrNYkqaqht X98g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=nmP4VnrK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a056402274c00b0049e5332b5e7si7737090edd.46.2023.01.27.08.53.02; Fri, 27 Jan 2023 08:53:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=nmP4VnrK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233761AbjA0Qvm (ORCPT + 99 others); Fri, 27 Jan 2023 11:51:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231582AbjA0Qvk (ORCPT ); Fri, 27 Jan 2023 11:51:40 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0716F7DBD1 for ; Fri, 27 Jan 2023 08:51:38 -0800 (PST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30R9k8LN030633; Fri, 27 Jan 2023 10:51:30 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=lY5UIsZ69hx/4gHdwcW0N1VKa4Qb9oFZA+396K23HMk=; b=nmP4VnrKi5tWiANdAKVn1dx+iUsTW94X+9EQP7+jCs0ZnPc5pbfgDj4KBx+HSgiG6OTu j7gN1EUfjSUYOVNMneCE5FtUWiKL+HHxGdEzED8akj50hwNHCy2h9euxBrXskiItQyIH PqdKasikiZp76e6CkR+O84zZw+vKPS7sRFAuC414Si5LIHW3nXzVet3OdtgAgbe+333G 2+v0Gu6zOHNu9ekEwqipaOgZjYsk2f8rV6sKq7vek08ORq58gYHqIs4Qjz7Tg73Ktd3O tOyLwS8JTkUIsL8n6yL6+WGQOrdtNbk5wy0tTm3NiAQN5OXU7RjO5wuiMAhd92cCfGRn 5A== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3n8dbsvrd1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jan 2023 10:51:29 -0600 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.21; Fri, 27 Jan 2023 10:51:28 -0600 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.7 via Frontend Transport; Fri, 27 Jan 2023 10:51:28 -0600 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.202.160]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 34237475; Fri, 27 Jan 2023 16:51:28 +0000 (UTC) From: Stefan Binding To: Vinod Koul , Bard Liao , Mark Brown , Pierre-Louis Bossart CC: , , , Stefan Binding Subject: [PATCH v3 0/8] ASoC: cs42l42: Add SoundWire support Date: Fri, 27 Jan 2023 16:51:03 +0000 Message-ID: <20230127165111.3010960-1-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: ld2F_qA2ieOHzm2HVUV8Vbzu6z-BGsLr X-Proofpoint-GUID: ld2F_qA2ieOHzm2HVUV8Vbzu6z-BGsLr X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS 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: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756195356073057304?= X-GMAIL-MSGID: =?utf-8?q?1756195356073057304?= The CS42L42 has a SoundWire interface for control and audio. This chain of patches adds support for this. Patches #1 .. #5 split out various changes to the existing code that are needed for adding Soundwire. These are mostly around clocking and supporting the separate probe and enumeration stages in SoundWire. Patches #6 .. #8 actually adds the SoundWire handling. Changes since v1: - fixes for various review comments from v1 - add support for wakeup from clock stop using hardware interrupts - use port_prep callback to prepare/deprepare codec Changes since v2: - fix various comments - enable pm_runtime during probe Richard Fitzgerald (6): ASoC: cs42l42: Add SOFT_RESET_REBOOT register ASoC: cs42l42: Ensure MCLKint is a multiple of the sample rate ASoC: cs42l42: Separate ASP config from PLL config ASoC: cs42l42: Export some functions for SoundWire ASoC: cs42l42: Add SoundWire support ASoC: cs42l42: Don't set idle_bias_on Stefan Binding (2): soundwire: stream: Add specific prep/deprep commands to port_prep callback ASoC: cs42l42: Wait for debounce interval after resume drivers/soundwire/stream.c | 4 +- include/linux/soundwire/sdw.h | 8 +- include/sound/cs42l42.h | 5 + sound/soc/codecs/Kconfig | 8 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/cs42l42-sdw.c | 610 +++++++++++++++++++++++++++++++++ sound/soc/codecs/cs42l42.c | 133 ++++--- sound/soc/codecs/cs42l42.h | 9 +- 8 files changed, 729 insertions(+), 50 deletions(-) create mode 100644 sound/soc/codecs/cs42l42-sdw.c