Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2862315pxb; Mon, 18 Oct 2021 03:35:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDZgVFK8YhjGPBr5TxFMV6RY4f6anYJ6tq3Quti7mvMo4gVwbKhDxOg9GODQ7pEvpKAPFQ X-Received: by 2002:a17:90b:4b10:: with SMTP id lx16mr32321146pjb.217.1634553309882; Mon, 18 Oct 2021 03:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634553309; cv=none; d=google.com; s=arc-20160816; b=r3RdUn+iFDkyitHURT0br70Zc1F01BrjsObFsjjBIgAqwHEjQtb3llWr3rTJLEPgWC 9tpAc1TliBppopgJ2DzCO80f+srcXLH9MniwSsXoOYjsSrpUFxN6I4+ERUhlwIi2ihQj W4xsyxwjsHwGaSu6GNmTvtW92QW6hFMyCEWxZaAXWiUExD5e1gz6Vho61yeN4beVoYAy Vjwk2H1n9p6xneldqs7iVVXzxktNHzAtN/JqFmuCxkF5YVHaoWh/16VhJ1Ab9JMMPzs/ sEgdLgOHR1MPvX7hNT5kC2VjGV1iMJCer7u69gk5q+TrXMz1AULyJ3d8DBOb/6XRiSK2 aUGg== 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=cGn43/LGWV9yHPcjMkf3TCrUECrY0/XNXt2QNLZSx3Y=; b=g10mlCXrNxbMmKZEdmVc4TtSbukuM37H2WkfvLyLuFW+lghzCi1N3p4Y2MXpz+yJic PWnIHSTaSECJ9osa9v+DUQ0FpKpVQdle0Cvh9XlB51EunphVTn7mz4y9Bm+caYVq+8hT sixLzIY3NXnw62GpiGTySIYZISgnDLq32kviKKNy4OhIIXR8IY3H3UwWY4iIwcAEurY5 Gra7PUeHRVBfCbwmMZ42brZxxckAWl6cQCXr74rN6pgzI8QJTrzdAtMoeUeN7+5dJq3S sJXjAs1ZvHq4vyFc/hzcGGk5EDJULWsCNHLJ6Vc/RTIDeCHO2aP79Lf88cpxg8t+Uwmw Palg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GxmpyZ8a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si18398083pfc.220.2021.10.18.03.34.57; Mon, 18 Oct 2021 03:35:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GxmpyZ8a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230446AbhJRKfr (ORCPT + 99 others); Mon, 18 Oct 2021 06:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230324AbhJRKfp (ORCPT ); Mon, 18 Oct 2021 06:35:45 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBAE8C06161C for ; Mon, 18 Oct 2021 03:33:34 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id t2so40492654wrb.8 for ; Mon, 18 Oct 2021 03:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cGn43/LGWV9yHPcjMkf3TCrUECrY0/XNXt2QNLZSx3Y=; b=GxmpyZ8aS8/cSgSoLniK7/q4OxJ45GEcM3HKfOdecelTtSYraAqBZd1BCaT5wBDswF 8Y9fMfDIUWaLh6fkzpv2NfyNjA1J5SnrK5NkMFpdBiy2QeEf/jl7d68d+ZXeO1fLXDYz 4AotQeZLj/fs4ihw36rPE3iloDRcfW9V8Py+IFWetqX6Uc3g3JgT/NKJDGBJzjXCQleP YyCcrvRyaGLnPGtyinYwTr2cxJdSmqUIXTc414vSuqRaggTskG3iIZjOmfhVsODPwXO3 I/gAvBIIn1Y+c4Xnp9l5sodFMCvwn9Lkd2KYov1RANmRVCR6pKUJCmM23xwvvOu1+54U VXiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cGn43/LGWV9yHPcjMkf3TCrUECrY0/XNXt2QNLZSx3Y=; b=7nFF2b1AGhlFlhAWI8IA82F5fBp8ooYI+mgXVipRsMGO/GzKK/qwR7Gwi3jJBNqf2R 8p1KvRYfgeCNJOa43KbdTrAVQssKsv37ntds2fjMpyi0JpA/9NmA2+dBuwIxRy3IoZtz EvGl+ZWz8OhF/68DAROaPkkSLK3qqtiqzim+cSgEZwE+upUO6O1hPHGHQtn0r5uOdDmb nuYpLdMWTYcCYbuqUymvsiiWDBTXlKv4KY3S2Ok51olQgnIMnY+4wRHMtJfFQlgRNvdO VH5t3LVYwjjHfAhFnNSKMAfCD/CbmeEn/5WmUC0aFqzQaPbXzFM5qOA3MPVxDmyVzBke kEKA== X-Gm-Message-State: AOAM532dDxK0ntZhMssVGGqNAoGioIQnzfoqDmLghTjDaqTnDWfEeytK m5dg36vhmgH7qCJKH+cb06uXDPq7oTg= X-Received: by 2002:a5d:64c5:: with SMTP id f5mr33763933wri.321.1634553213568; Mon, 18 Oct 2021 03:33:33 -0700 (PDT) Received: from localhost.localdomain ([195.245.16.219]) by smtp.gmail.com with ESMTPSA id o8sm19062252wme.38.2021.10.18.03.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 03:33:33 -0700 (PDT) From: Alexander Sverdlin To: soc@kernel.org Cc: Alexander Sverdlin , Geert Uytterhoeven , Nikita Shubin , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Mark Brown , Arnd Bergmann Subject: [PATCH v3 1/2] ASoC: cirrus: i2s: Prepare clock before using it Date: Mon, 18 Oct 2021 12:31:04 +0200 Message-Id: <20211018103105.146380-2-alexander.sverdlin@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018103105.146380-1-alexander.sverdlin@gmail.com> References: <20211018103105.146380-1-alexander.sverdlin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch to Common Clock Framework, otherwise the following is visible: WARNING: CPU: 0 PID: 97 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc Enabling unprepared mclk ... Hardware name: Cirrus Logic EDB9302 Evaluation Board ... clk_core_enable clk_core_enable_lock ep93xx_i2s_hw_params snd_soc_dai_hw_params soc_pcm_hw_params snd_pcm_hw_params snd_pcm_ioctl ... Acked-by: Mark Brown Signed-off-by: Alexander Sverdlin --- sound/soc/cirrus/ep93xx-i2s.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c index 0d26550d0df8..4d3179f03202 100644 --- a/sound/soc/cirrus/ep93xx-i2s.c +++ b/sound/soc/cirrus/ep93xx-i2s.c @@ -111,9 +111,9 @@ static void ep93xx_i2s_enable(struct ep93xx_i2s_info *info, int stream) if ((ep93xx_i2s_read_reg(info, EP93XX_I2S_TX0EN) & 0x1) == 0 && (ep93xx_i2s_read_reg(info, EP93XX_I2S_RX0EN) & 0x1) == 0) { /* Enable clocks */ - clk_enable(info->mclk); - clk_enable(info->sclk); - clk_enable(info->lrclk); + clk_prepare_enable(info->mclk); + clk_prepare_enable(info->sclk); + clk_prepare_enable(info->lrclk); /* Enable i2s */ ep93xx_i2s_write_reg(info, EP93XX_I2S_GLCTRL, 1); @@ -156,9 +156,9 @@ static void ep93xx_i2s_disable(struct ep93xx_i2s_info *info, int stream) ep93xx_i2s_write_reg(info, EP93XX_I2S_GLCTRL, 0); /* Disable clocks */ - clk_disable(info->lrclk); - clk_disable(info->sclk); - clk_disable(info->mclk); + clk_disable_unprepare(info->lrclk); + clk_disable_unprepare(info->sclk); + clk_disable_unprepare(info->mclk); } } -- 2.33.0