From patchwork Fri Oct 28 15:26:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Zanders X-Patchwork-Id: 12389 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp896868wru; Fri, 28 Oct 2022 08:31:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kDewqMjC8G9WEED4eMru/TlIYPY/obKzHS+XBZ+7is6zs6OdpBkE2D9yIS8FAzFEwMN5h X-Received: by 2002:a62:1490:0:b0:563:51e7:693b with SMTP id 138-20020a621490000000b0056351e7693bmr55503658pfu.39.1666971116951; Fri, 28 Oct 2022 08:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666971116; cv=none; d=google.com; s=arc-20160816; b=EphmHKvE6cKMb3kEvDeDK+Q2I2wNBQTCD8VRKZcOtEB7g/T9WCUuWUKnt4hiUscAUn bOCQuwkLrhCUix6JPNJKHVozwnaMDhi3rfxDb2XpqWmZqTDxMHk8wPgxIKP164QUDt7P 2s0Lp6KhLFvHp20hKJu/Fvhs4biaakGm2IbehpsFc8dsi9HoOfJ9zN2WGx05augej0Lm hBwX5QMQcKCHzFP5/or27mNSM+tAUXHzR3RwKLnZ0ya/t8hjHEekEAV6V9/rZ4ku9C3w 399KeEBVdQn7tndgz1kW3sapRgc6XpHiqdQlKZvkx/r42J6JkbqOCxPxeB0qwIXqn0iv 5F9w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KYAU7odEMWKCjcropggkZQwO0OXnOT7Nxlue1f2Igjw=; b=oywi0WMrJHJ5eOJSA2hwDYDeLaQSXrnAAOVUyNqaY6KajQx88HA95J60/UAtY97Ldv KoxZ+wrqSCZSH2EXIGIa7qIbOSRcw96GxktHbgjKMe5BdTRXZ3Rlg6Y740VjYaC4rX21 FST+TJ9O60srBeE7AUT5tWYXfVkzsSqlv44qFTxqC1BQGeNFsB9aphVBgXoQYigic4Lz 1LAcW4m/Fre+5NFPMp0bbSWMda1Pgu6Vl9EU2maedQVDyc1PFANx8aHZvxOnNE3ShTFg YUdsYS9hY0u0nLtc3MWom2nIL33x+K5TGEiTGhJDBTWWbd/fbgbd9iJH2ez6+Y6ryHFl V52g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mind.be header.s=google header.b="N4qct+2/"; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb14-20020a17090ae7ce00b00205d0348e7fsi6051423pjb.93.2022.10.28.08.31.40; Fri, 28 Oct 2022 08:31:56 -0700 (PDT) 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=@mind.be header.s=google header.b="N4qct+2/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230140AbiJ1P1I (ORCPT + 99 others); Fri, 28 Oct 2022 11:27:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229571AbiJ1P0x (ORCPT ); Fri, 28 Oct 2022 11:26:53 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E9AB1CF54B for ; Fri, 28 Oct 2022 08:26:52 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id q9so13838361ejd.0 for ; Fri, 28 Oct 2022 08:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KYAU7odEMWKCjcropggkZQwO0OXnOT7Nxlue1f2Igjw=; b=N4qct+2/SkZTJmUhVNcb4x9h7lglsGkPGesm5ETCb6oDXj/896682W1IKcdN13TLcG gbEtaMgVEyleOH1zypX/bT1pazrPuMqQPG5xvSv2qzdZvL+olVF/KWwtwno67arAzTkL W3K4jUtGoo3rlzaDH5gok3XY0vEyMjSuHY5fM5MRm6iD2G5SkAdWW7k4zv9U0+pP97HT uo0nP/LOksN6bp8kC4OfFV2xDijskpC/DXBwG0FeSQU97vxR09Cjo1eHTCFA85h8ArXI s1aKN9+FHg9TcVnM4ILkZaZb96o1MkKsTKtaEvRHhjqMVKYr8i1XIlAiLkmu+lE8P1oO EArA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KYAU7odEMWKCjcropggkZQwO0OXnOT7Nxlue1f2Igjw=; b=Kwijpcp0Kdt7ENfkV6yKacShA3v4HpngglV+dk+2UebIg8vyvhrgTBDWIysNAgY4Vl XXzqNsnf7UE9WaPI1aJHeSnAs2DQeCceMuavVxAwL7SeDAXFvXvYQh0vhqW2DGzdZOt4 WKuPeu5L7Vgbvl79GxFu5AIVz3FLTnDfZjzalL/Km773GAfGfy/0tfXxex5X6hCTmHc4 26otWhlREfx6RPRk6tVaFmZNgxmaANKwqiPJpOerSgbHwsuu5SRpPKGSlcXe7nJHqH5d blR8/FkIyAivBi+NOGR1+B+tEdkaZ1zPUsQTQPNQutRDtibGo7df6zvuAnRMpOzxQC+4 WPbw== X-Gm-Message-State: ACrzQf3TuWCL9w6ozIDDmbAzEwCdblfTtE/+IchZjYMVhZfxFTNyKGRL g1gi4hIe4u68dg9FB2Wx/mGfew== X-Received: by 2002:a17:906:30c5:b0:782:707:9e2d with SMTP id b5-20020a17090630c500b0078207079e2dmr46375763ejb.286.1666970810840; Fri, 28 Oct 2022 08:26:50 -0700 (PDT) Received: from dtpc.zanders.be (78-22-137-109.access.telenet.be. [78.22.137.109]) by smtp.gmail.com with ESMTPSA id 17-20020a170906319100b00730df07629fsm2349839ejy.174.2022.10.28.08.26.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 08:26:50 -0700 (PDT) From: Maarten Zanders To: Lars-Peter Clausen , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: Maarten Zanders , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] ASoC: adau1372: fix mclk Date: Fri, 28 Oct 2022 17:26:23 +0200 Message-Id: <20221028152626.109603-2-maarten.zanders@mind.be> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221028152626.109603-1-maarten.zanders@mind.be> References: <20221028152626.109603-1-maarten.zanders@mind.be> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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?1747945905876775570?= X-GMAIL-MSGID: =?utf-8?q?1747945905876775570?= "mclk" is retrieved from the configuration and assigned to adau1372->clk. However adau1372->mclk (==NULL) is used for clk_prepare_enable() and clk_disable_unprepare() which don't have any effect. Remove .clk from struct adau1372 and use .mclk throughout. This change ensures that the input clock is switched on/off when the bias level is changed. Signed-off-by: Maarten Zanders --- sound/soc/codecs/adau1372.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/adau1372.c b/sound/soc/codecs/adau1372.c index a9f89e8565ec..00d0825e193b 100644 --- a/sound/soc/codecs/adau1372.c +++ b/sound/soc/codecs/adau1372.c @@ -25,7 +25,6 @@ #include "adau-utils.h" struct adau1372 { - struct clk *clk; struct regmap *regmap; void (*switch_mode)(struct device *dev); bool use_pll; @@ -925,9 +924,9 @@ int adau1372_probe(struct device *dev, struct regmap *regmap, if (!adau1372) return -ENOMEM; - adau1372->clk = devm_clk_get(dev, "mclk"); - if (IS_ERR(adau1372->clk)) - return PTR_ERR(adau1372->clk); + adau1372->mclk = devm_clk_get(dev, "mclk"); + if (IS_ERR(adau1372->mclk)) + return PTR_ERR(adau1372->mclk); adau1372->pd_gpio = devm_gpiod_get_optional(dev, "powerdown", GPIOD_OUT_HIGH); if (IS_ERR(adau1372->pd_gpio)) @@ -947,7 +946,7 @@ int adau1372_probe(struct device *dev, struct regmap *regmap, * 12.288MHz. Automatically choose a valid configuration from the * external clock. */ - rate = clk_get_rate(adau1372->clk); + rate = clk_get_rate(adau1372->mclk); switch (rate) { case 12288000: