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: 659289 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 D7A57C64EC4 for ; Mon, 6 Mar 2023 17:46:06 +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 B5A99118E; Mon, 6 Mar 2023 18:45:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B5A99118E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678124764; bh=xYOEwY5kQ6Gyc2CDS0cFqPCFSmhO4xqRCo5LIOE6eP0=; h=From:Date:Subject:References:In-Reply-To:To:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=U4x/oTqy4+MjIGF1vh0EEHQX5XIVaow4UpPYeGE8k7NfTZuJd7EErPPC5J8c2e3C2 pusa15cdJVmwaRckk1JGpz4DiDP6E6/H7/haDQrIPgc32Pf5eor3QBOs2/7YHa+TFl 7ZTy6jNu07nYCnhCC4aAadA98IeO3rnosOmPv2QU= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0B655F80529; Mon, 6 Mar 2023 18:40:56 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4DB87F80266; Fri, 3 Mar 2023 11:05:05 +0100 (CET) Received: from out-61.mta1.migadu.com (out-61.mta1.migadu.com [IPv6:2001:41d0:203:375::3d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D99DCF8025A for ; Fri, 3 Mar 2023 11:04:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D99DCF8025A Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=NeQJKSuR 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 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-MailFrom: richard.leitner@linux.dev 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: 3DE3VPPJOWKKIESCHEFYYIIFIOE7UINI X-Message-ID-Hash: 3DE3VPPJOWKKIESCHEFYYIIFIOE7UINI X-Mailman-Approved-At: Mon, 06 Mar 2023 17:40:46 +0000 CC: Benjamin Bara , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Leitner X-Mailman-Version: 3.3.8 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: 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: 659290 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 BB00BC64EC4 for ; Mon, 6 Mar 2023 17:45:36 +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 61BA3115E; Mon, 6 Mar 2023 18:44:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 61BA3115E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678124734; bh=dRC2oYePSy+NpN70Oi3SVOL0aqbil/NIkk8MGh7RPYY=; h=From:Date:Subject:References:In-Reply-To:To:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qpR4lCYULFGAWfMSz+DbMg/dHeT8diqWMS0AncbFdFzUJMVrHjYWKZh+YMbbTRNKL Z0Qi/KKKcYAVtTimrdMOpUTjN5VAVH3AdinDM0ZoEnlcr+W5SXqjJW982cSfd/WBnV 9JeUEuKsh8J3eE8bYfAdXHD9icfs6QJd66ue8AOw= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 475A6F805DF; Mon, 6 Mar 2023 18:40:49 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EA448F8049C; Fri, 3 Mar 2023 11:04:22 +0100 (CET) Received: from out-13.mta1.migadu.com (out-13.mta1.migadu.com [95.215.58.13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 19BF7F80266 for ; Fri, 3 Mar 2023 11:04:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 19BF7F80266 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=rd7E5pCy 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 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-MailFrom: richard.leitner@linux.dev 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: JXJAUGPBSLM2UXFXUTODCJMAUOOUVSE7 X-Message-ID-Hash: JXJAUGPBSLM2UXFXUTODCJMAUOOUVSE7 X-Mailman-Approved-At: Mon, 06 Mar 2023 17:40:46 +0000 CC: Benjamin Bara , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Leitner X-Mailman-Version: 3.3.8 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: 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: 659944 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 92E91C61DA4 for ; Mon, 6 Mar 2023 17:45:54 +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 5D66C117A; Mon, 6 Mar 2023 18:45:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5D66C117A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678124752; bh=bhrgIGSipHRERMy/twmypKeGpAZECUckMWgpAtDUgws=; h=From:Date:Subject:References:In-Reply-To:To:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=LYWL5Mrf5Gxt6SvyM0jFcFPZLlb6oxtal2LnpBDbig2GkCbO7x2jEHUHD/JKZesnf nu4uGM9qXk8gKHKtvMpqmuDQPgoa9YGMMYeIW5E5z+B1YRKYNinSoGBZ0TX+E2hFLa vJH/tNNBVnl3erG7YhQz2mGWoskjfW3CKlTPi1Ps= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 80DE3F80534; Mon, 6 Mar 2023 18:40:52 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 26333F804B1; Fri, 3 Mar 2023 11:04:29 +0100 (CET) Received: from out-18.mta1.migadu.com (out-18.mta1.migadu.com [IPv6:2001:41d0:203:375::12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 402DEF80310 for ; Fri, 3 Mar 2023 11:04:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 402DEF80310 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=X50FDpSr 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 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-MailFrom: richard.leitner@linux.dev 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: C6PJW5SVHAWOV6QZDU72HLY25U6ZXX55 X-Message-ID-Hash: C6PJW5SVHAWOV6QZDU72HLY25U6ZXX55 X-Mailman-Approved-At: Mon, 06 Mar 2023 17:40:46 +0000 CC: Benjamin Bara , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Leitner X-Mailman-Version: 3.3.8 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: 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[] = {