From patchwork Fri Mar 3 10:04:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Leitner X-Patchwork-Id: 63858 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp334140wrd; Fri, 3 Mar 2023 02:23:52 -0800 (PST) X-Google-Smtp-Source: AK7set85BbG4nTalvJ+T2mYXJ1bJGwmJqRL6nY8G9PQjwCmKAxpR22IA65wiC0nA2iQZLRMcPQH3 X-Received: by 2002:a17:902:c94c:b0:19d:20a:a219 with SMTP id i12-20020a170902c94c00b0019d020aa219mr1747938pla.66.1677839032491; Fri, 03 Mar 2023 02:23:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677839032; cv=none; d=google.com; s=arc-20160816; b=Vc5IG2n9GaRCDAiAC8srV2hXQmRVBI7IgOIzCrA9T6eJeSqpibRI2H4AN3vZVSc2Ao kFRLDJ2GlPsQKlwN/IBUQS/TWPIFkIJ73y1oYYHm018Drlw24lLL7788tf/avrGyU5f2 ERtbH6+/l5mYxM+HemgcqdRMLR6YaZSuVRmgpilLbZ0Ddq4vOKw0AkmC1+6Uh3q+YjBG OIDUcVTVOPOsSNrowRRLbjDBqS/9GzsXP+98BeJVeDzmiN2g0LUDsyaOLJCWtFnB4h9X kJoc29NOMzcBby2YcpH56s5txk2jdx778esvAYaDEI9/Pr5yXE5x0VPAa8r+MpbLjsqS 5SjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=GW339QZ/TdS68WJ1B968sS6Y3hjxt+W7MaaQRsWYRFA=; b=HcgJfefSqYZP2xwcNxvoFJveSicpZJ7+HWICygG8UzSvB1y8xwuYCiNib0Lib64yHP O6GaT96lQSlA2G0VhhJlCD6VoukzjXB0lzu+dc60HoZfxgrw4eaAeYClcjO8lE/+uKf/ fOnOyD0nGCWZJppRjVoxpnzc8wgtrqAemekbtfbfbrSJk/jfwl9sjvYNN2HNcCy1dwO1 OI5tA811ZajNVa+rNzxZOgMzB1+DRvNh5hZ0g0VIWeROf7kBnOINGOMUQXob9hY180Ro eE/DnQ0m3NrslNcOKXEdDf/nkyLab15HEwdEetvI+MuxCGMp/JNVJAJo0B9rzMksmyWl rNug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=NeQJKSuR; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kh6-20020a170903064600b0019cd93a8200si1731022plb.331.2023.03.03.02.23.40; Fri, 03 Mar 2023 02:23:52 -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=@linux.dev header.s=key1 header.b=NeQJKSuR; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230387AbjCCKEV (ORCPT + 99 others); Fri, 3 Mar 2023 05:04:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbjCCKEP (ORCPT ); Fri, 3 Mar 2023 05:04:15 -0500 Received: from out-22.mta1.migadu.com (out-22.mta1.migadu.com [95.215.58.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8341D136F4 for ; Fri, 3 Mar 2023 02:04:13 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1677837851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GW339QZ/TdS68WJ1B968sS6Y3hjxt+W7MaaQRsWYRFA=; b=NeQJKSuRZeOvVv8s+AOytxt9DC0bBF9R7g9zZHzlWCLcVyI4cTyZe972sMygJsVvZnfNxM rMatKFHbkVoqqH0zYq5WKDOZxZnWKRTBVkIYiDBezJvGo56BKPY0v0OZ7jRLEbR6RfLVnX Ide2ckQru9NXX2DW1LPkHVn2A885RkY= From: richard.leitner@linux.dev Date: Fri, 03 Mar 2023 11:04:01 +0100 Subject: [PATCH v2 1/3] ASoC: dt-bindings: maxim,max9867: convert txt bindings to yaml MIME-Version: 1.0 Message-Id: <20230302-max9867-v2-1-fd2036d5e825@skidata.com> References: <20230302-max9867-v2-0-fd2036d5e825@skidata.com> In-Reply-To: <20230302-max9867-v2-0-fd2036d5e825@skidata.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Ladislav Michl , Jaroslav Kysela , Takashi Iwai , Benjamin Bara Cc: Benjamin Bara , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Leitner X-Developer-Signature: v=1; a=openpgp-sha256; l=2270; i=richard.leitner@skidata.com; h=from:subject:message-id; bh=bwaHQSWKYlK+16GPkCzDPEt1Tmvix8Ku+HlNfeU8Izc=; b=owGbwMvMwCX2R2KahkXN7wuMp9WSGFIYj0la3Tv++fkUD7Xnu65Z93hO//TLpFpq72GV50qcppMs f33+31HKwiDGxSArpshib8zV7p5b9r5SUScXZg4rE8gQBi5OAZjIVDuG/x4M8x+Grp51rnFrdanlxU zDzw+sfJ5HbOL8tfXs20729XcZGSZks07INlp45nMy5y5xXX65fO/Jhz6XH+LaoCWpt2SvDTsA X-Developer-Key: i=richard.leitner@skidata.com; a=openpgp; fpr=3F330A87476D76EF79212C6DFC189628387CFBD0 X-Migadu-Flow: FLOW_OUT 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 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?1759341080193739431?= X-GMAIL-MSGID: =?utf-8?q?1759341741288545125?= From: Richard Leitner Convert from max9867.txt to maxim,max9867.yaml and add missing '#sound-dai-cells' property. Signed-off-by: Richard Leitner --- .../devicetree/bindings/sound/max9867.txt | 17 ------- .../devicetree/bindings/sound/maxim,max9867.yaml | 55 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 17 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/max9867.txt b/Documentation/devicetree/bindings/sound/max9867.txt deleted file mode 100644 index b8bd914ee697..000000000000 --- a/Documentation/devicetree/bindings/sound/max9867.txt +++ /dev/null @@ -1,17 +0,0 @@ -max9867 codec - -This device supports I2C mode only. - -Required properties: - -- compatible : "maxim,max9867" -- reg : The chip select number on the I2C bus - -Example: - -&i2c { - max9867: max9867@18 { - compatible = "maxim,max9867"; - reg = <0x18>; - }; -}; diff --git a/Documentation/devicetree/bindings/sound/maxim,max9867.yaml b/Documentation/devicetree/bindings/sound/maxim,max9867.yaml new file mode 100644 index 000000000000..74cd163546ec --- /dev/null +++ b/Documentation/devicetree/bindings/sound/maxim,max9867.yaml @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/maxim,max9867.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Maxim Integrated MAX9867 CODEC + +description: | + This device supports I2C only. + Pins on the device (for linking into audio routes): + * LOUT + * ROUT + * LINL + * LINR + * MICL + * MICR + * DMICL + * DMICR + +maintainers: + - Ladislav Michl + +allOf: + - $ref: dai-common.yaml# + +properties: + compatible: + enum: + - maxim,max9867 + + '#sound-dai-cells': + const: 0 + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + codec@18 { + compatible = "maxim,max9867"; + #sound-dai-cells = <0>; + reg = <0x18>; + }; + }; +... From patchwork Fri Mar 3 10:04:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Leitner X-Patchwork-Id: 63856 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp332714wrd; Fri, 3 Mar 2023 02:19:39 -0800 (PST) X-Google-Smtp-Source: AK7set9EbRWc2TGz/0BSFOUNAlB5yHumvyZymx/MbNrLiX5QPhrhfTjL3tdG7s9k+7E35b2q0WJi X-Received: by 2002:a17:906:948:b0:87f:5d0a:c610 with SMTP id j8-20020a170906094800b0087f5d0ac610mr1101372ejd.32.1677838779547; Fri, 03 Mar 2023 02:19:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677838779; cv=none; d=google.com; s=arc-20160816; b=ySMO1Srl0Ev0zgcK59nrzonqFe84HACLgiTTd01eqdX4rtGD+bxUnSZP9vO4O2glth oqoWvGR9yFKhs0R7h0e3UdA/EIqV0dUHM36wqSR3qjHsF6jC48MWn9ITPCPNxttVc+8I T7Bk38UhTpQU1PnJjJeKMagG4t5GLXGStRALPe5GkAdryOqo6Qz/Dcx8IFZxATAPeOSO zSJJiNnL4D6bEwz5BSZYRXmzXjA7HIbMg/0wbrHUp0YAacNSasNlwdCql8vXUvmU8lvh G05mWq5T+Cy74zJKW5HyvpJUT+aC26Vfw2/QbXcZkQv5jvxGjKS0fXWB6TE+KXQW9vrT P7rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=hcYJmRGskfPRmhAdzc8S9FcZG/yfwAAq4mWaDd/Lugo=; b=NsvDA7n15ym1Zdd5FBi8UjtrEkYMCM7BOVEy6BBhxbQOCfzcV1DiryHHQHXLHi4Vgo pQDLgajLHPSVQP7ZzMjdIvVZWoOrG0zaKWU9oy4KGnR1EMjipFpDOL4xXpULxaobQp+1 FqUy99tDRTwDk3042K3SCoXnpar1Cj0HsM5Lq935IY6GGWFQiDLI3a52NMf2mnYbcozV WyOBnABcDLneausFM6CbXQOctZrzUNWuBe6HDzUbAANCXkyQ9TpfkHOkWHHs6D6uSEht sYQ+PYAuBFYWqHgzmx7Xa+jfnR8HSV9oGxJERCO+RNNNrUcRFCYnK0vm1Irqb1jd6hpw AwQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=rd7E5pCy; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w12-20020aa7dccc000000b004aab62d6c68si2130473edu.495.2023.03.03.02.19.16; Fri, 03 Mar 2023 02:19:39 -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=@linux.dev header.s=key1 header.b=rd7E5pCy; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbjCCKEX (ORCPT + 99 others); Fri, 3 Mar 2023 05:04:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230230AbjCCKEQ (ORCPT ); Fri, 3 Mar 2023 05:04:16 -0500 Received: from out-6.mta1.migadu.com (out-6.mta1.migadu.com [IPv6:2001:41d0:203:375::6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42709136C3 for ; Fri, 3 Mar 2023 02:04:13 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1677837852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hcYJmRGskfPRmhAdzc8S9FcZG/yfwAAq4mWaDd/Lugo=; b=rd7E5pCyZo37krxzehhlmD8gXrWZwmbdUMFvbrp5i9bDxMKlI0Kc5NyoCp1VzrEkLFV+sX zrFtUmqhONVRfp0Kf/fkeivHwOZWJbvgacU9S9x8tZsfZrwS6e/SKi7nwAczGrUORuoXge vJplx83DQ7aWwI3+pCGEmXnybm7CFIE= From: richard.leitner@linux.dev Date: Fri, 03 Mar 2023 11:04:02 +0100 Subject: [PATCH v2 2/3] ASoC: dt-bindings: maxim,max9867: add clocks property MIME-Version: 1.0 Message-Id: <20230302-max9867-v2-2-fd2036d5e825@skidata.com> References: <20230302-max9867-v2-0-fd2036d5e825@skidata.com> In-Reply-To: <20230302-max9867-v2-0-fd2036d5e825@skidata.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Ladislav Michl , Jaroslav Kysela , Takashi Iwai , Benjamin Bara Cc: Benjamin Bara , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Leitner X-Developer-Signature: v=1; a=openpgp-sha256; l=1121; i=richard.leitner@skidata.com; h=from:subject:message-id; bh=Iw/3nRyv551zpvZ9GVbHR0uIwA0KwrzA9i3bmK0aYNU=; b=owGbwMvMwCX2R2KahkXN7wuMp9WSGFIYj0k9KNl0Scd945wXUcxPbVI3u8f7HnqVNbO4qWraz02s E8PbOkpZGMS4GGTFFFnsjbna3XPL3lcq6uTCzGFlAhnCwMUpABMpn8PIsOXiWQPl98q7PjyZs2PFzN fb/574dlby0Qol92zDb/7KGW0M/x36pip5rDGsn5FlEb95gul5/Ys/05V2Xjp0x9njZei9XzwA X-Developer-Key: i=richard.leitner@skidata.com; a=openpgp; fpr=3F330A87476D76EF79212C6DFC189628387CFBD0 X-Migadu-Flow: FLOW_OUT 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 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?1759341118527386713?= X-GMAIL-MSGID: =?utf-8?q?1759341476129335675?= From: Richard Leitner Add clocks property to require a "mclk" definition for the maxim,max9867 codec. Signed-off-by: Richard Leitner --- Documentation/devicetree/bindings/sound/maxim,max9867.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/maxim,max9867.yaml b/Documentation/devicetree/bindings/sound/maxim,max9867.yaml index 74cd163546ec..6f27029b137d 100644 --- a/Documentation/devicetree/bindings/sound/maxim,max9867.yaml +++ b/Documentation/devicetree/bindings/sound/maxim,max9867.yaml @@ -35,9 +35,13 @@ properties: reg: maxItems: 1 + clocks: + maxItems: 1 + required: - compatible - reg + - clocks additionalProperties: false @@ -50,6 +54,13 @@ examples: compatible = "maxim,max9867"; #sound-dai-cells = <0>; reg = <0x18>; + clocks = <&codec_clk>; }; }; + + codec_clk: clock { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12288000>; + }; ... From patchwork Fri Mar 3 10:04:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Leitner X-Patchwork-Id: 63859 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp335283wrd; Fri, 3 Mar 2023 02:27:21 -0800 (PST) X-Google-Smtp-Source: AK7set/4mFOeHHoHZgckOIKP516mtjeQNGlzDDhCG5i2X7RkaBOB5t+YTM4eFNjaVFEsaSSJapfY X-Received: by 2002:a17:903:41d0:b0:19e:3b41:1826 with SMTP id u16-20020a17090341d000b0019e3b411826mr1728042ple.54.1677839240712; Fri, 03 Mar 2023 02:27:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677839240; cv=none; d=google.com; s=arc-20160816; b=Kj+P5nwIJh8dhQyi9bpW2N6qz5/g8syn4X3qjdepj9hRBviDdLejzgdzCnvH9JYODS gFugbR0QQ3Zi1zendSi8TOV8Y46P5NCpk3JGAX0BsgKsvUW31YskBhbgGcDvZX4seOkA 3yPhAWkTELd5DFs+JD7fWOJCQXNGfYCWjqoVQhOCj8ctvoyyN33cy/vRm1jjn36PgV5R gBbyo1hWSF2YfGiKCqATMqzOtSPtBU/3ijomYG3Tw2Bn2Vz1Qv/TQsw5Hc0rv4O9XuTr EtZvCqHLl12Afv5of0K4ubBcCqDKRKERe8yX6lx8zIwIlSPWI+h5l87tjElrBfp8eC5a se4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=qwgv6vZF0y8lp2WjIbk7DSvdWa3VrwfThseCo0zqB4k=; b=TFy4AFh/rTa4uBg6aVL1Ea1+Kak+ygsnvBU2nOVvF8TB4DOAFtCSf3yV/KmeSEKp1V KeH8Bl0qxH76Ef9s9/4ffXyY3WOHsR7U1oXGVJGPEFtN1wQeN8gorpqAh3nZCJ+wXYqM ATHy0plF+4AyRc48n2SgCen0+ZIsYwhQd20kWapi/JOad2RZ6PGdrgbQ+4HFQPMZtLvp tAp5KGq4Xa+SItNMt5I/R71mfQPQ5ZwL1t/OewDBusGxzSPfyORrt5/iFBiTuozOp2SQ QMdJxx6TccG76ZnRrSYcoCwHMsEqtIb9iHcZLwYd2P4uNzgJk+k9ymy1MGmCF+AMKjFu 6L5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=X50FDpSr; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kh6-20020a170903064600b0019cd93a8200si1731022plb.331.2023.03.03.02.27.07; Fri, 03 Mar 2023 02:27:20 -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=@linux.dev header.s=key1 header.b=X50FDpSr; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230031AbjCCKEd (ORCPT + 99 others); Fri, 3 Mar 2023 05:04:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbjCCKEU (ORCPT ); Fri, 3 Mar 2023 05:04:20 -0500 Received: from out-49.mta1.migadu.com (out-49.mta1.migadu.com [95.215.58.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E202125AE for ; Fri, 3 Mar 2023 02:04:14 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1677837853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qwgv6vZF0y8lp2WjIbk7DSvdWa3VrwfThseCo0zqB4k=; b=X50FDpSrYOh7nBnY9KeIVLLZrMW+Iy3/KCSwe6SBcvXqmo7UH+lYckw7f1hmsp810eH1Wq W7G/7JsUCGldKfJzgynYfDjOKbIId0+lRKKHL1CeqWxNyOtsPm9KLoElh9Uuy5pjKzXQBp 5XNexFSnTTUiA9K0WuOe6wKnIrDudEs= From: richard.leitner@linux.dev Date: Fri, 03 Mar 2023 11:04:03 +0100 Subject: [PATCH v2 3/3] ASoC: maxim,max9867: add "mclk" support MIME-Version: 1.0 Message-Id: <20230302-max9867-v2-3-fd2036d5e825@skidata.com> References: <20230302-max9867-v2-0-fd2036d5e825@skidata.com> In-Reply-To: <20230302-max9867-v2-0-fd2036d5e825@skidata.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Ladislav Michl , Jaroslav Kysela , Takashi Iwai , Benjamin Bara Cc: Benjamin Bara , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Leitner X-Developer-Signature: v=1; a=openpgp-sha256; l=2184; i=richard.leitner@skidata.com; h=from:subject:message-id; bh=wYqb5T3X4q78UgSPWnOpqyJNxmqmPsLey2OahM/f3Ks=; b=owGbwMvMwCX2R2KahkXN7wuMp9WSGFIYj0mJhCjoW4q/7NLatPNY7qwTx3TOeH6qSFp08MjxmQxs y+N5OkpZGMS4GGTFFFnsjbna3XPL3lcq6uTCzGFlAhnCwMUpABMJtWL479+m3rZnYrLP5M9aZ0SrbF v3Hryy+KZD+OejF+dt/5m3mpWR4Ve/wXs7qezqf2Elkzu/SR2+IByjmnfocEiGpsWDzH9buQA= X-Developer-Key: i=richard.leitner@skidata.com; a=openpgp; fpr=3F330A87476D76EF79212C6DFC189628387CFBD0 X-Migadu-Flow: FLOW_OUT 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 autolearn=unavailable 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?1759341959613057476?= X-GMAIL-MSGID: =?utf-8?q?1759341959613057476?= From: Benjamin Bara Add basic support for the codecs' mclk. Enable it on SND_SOC_BIAS_ON, disable it on SND_SOC_BIAS_OFF. Signed-off-by: Benjamin Bara Signed-off-by: Richard Leitner --- sound/soc/codecs/max9867.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c index e161ab037bf7..ae552d72beec 100644 --- a/sound/soc/codecs/max9867.c +++ b/sound/soc/codecs/max9867.c @@ -6,6 +6,7 @@ // Copyright 2018 Ladislav Michl // +#include #include #include #include @@ -16,6 +17,7 @@ #include "max9867.h" struct max9867_priv { + struct clk *mclk; struct regmap *regmap; const struct snd_pcm_hw_constraint_list *constraints; unsigned int sysclk, pclk; @@ -577,6 +579,11 @@ static int max9867_set_bias_level(struct snd_soc_component *component, struct max9867_priv *max9867 = snd_soc_component_get_drvdata(component); switch (level) { + case SND_SOC_BIAS_ON: + err = clk_prepare_enable(max9867->mclk); + if (err) + return err; + break; case SND_SOC_BIAS_STANDBY: if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { err = regcache_sync(max9867->regmap); @@ -595,6 +602,7 @@ static int max9867_set_bias_level(struct snd_soc_component *component, return err; regcache_mark_dirty(max9867->regmap); + clk_disable_unprepare(max9867->mclk); break; default: break; @@ -663,9 +671,16 @@ static int max9867_i2c_probe(struct i2c_client *i2c) dev_info(&i2c->dev, "device revision: %x\n", reg); ret = devm_snd_soc_register_component(&i2c->dev, &max9867_component, max9867_dai, ARRAY_SIZE(max9867_dai)); - if (ret < 0) + if (ret < 0) { dev_err(&i2c->dev, "Failed to register component: %d\n", ret); - return ret; + return ret; + } + + max9867->mclk = devm_clk_get(&i2c->dev, NULL); + if (IS_ERR(max9867->mclk)) + return PTR_ERR(max9867->mclk); + + return 0; } static const struct i2c_device_id max9867_i2c_id[] = {