Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3467533pxv; Mon, 26 Jul 2021 05:01:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrffQH2g6ak2paq0z079jvqALIfur+l2IpoT/h1AncQRAjMoPTnvEAKegDnurG/9VmTZc2 X-Received: by 2002:a50:8d4e:: with SMTP id t14mr21632220edt.138.1627300865795; Mon, 26 Jul 2021 05:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627300865; cv=none; d=google.com; s=arc-20160816; b=hzrZUxsCVX7Ng5PBxLgMbmjCmpwrKAf8rUqknmO8Er36bipydo6pvV99nXgPL0tJQ+ 4W1+aGc9FByu/cozqsWkPLdqaJsrEsEYu5X5FmLN2CnPyXRVDbT/hVGDeDCXqq0ux3kw oK1+kyZc2Or2D0HIFTxWlCafEpokPOhDpx0ERb5pSUdtFiI+gW0fWG6uyyp9IOqt51Fs 6N6uaUzXbh6RM5ikuXEt4byeU+DVcP5KnuX3QvshFa1EdRw1X2V7Oxcx5NT8SnnoVATl 8qV5XbA8eAqP6bSTnj+0sFLaVTMfMKuWyClJ7OI0rArDI92gyDn4LQ4m2G5oX94EsI5Z 3Psg== 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=wrYpi7Lb3bPjDh2wgnPPsmcJxdCvpxYqsSBC4dQvxwE=; b=x+WRBH5tjPQY91n13h8vkSD+mbEXAErKWtY4hjgPApL31PIzoxah/TSsJhhF4gQtZu WLk0m2fJY4RRlnHgTW54VYL68SO6yBdzj206XZW7t6LvV2mPaFLHjLRtlPZ7MNYTGsuC r8T4wsb8loNXMwRXagyBdQSWC7HqyEH4FEdycxIS77FHRbzHAM+3F5ATH84xcqPtc71L UWMJ5wT1j66V0eHqy4AdhDNXvNl1QYehsAsZpcQz/7AAMKSpQqXSIb8j/b+cpT3iyQNY 4s1O/2J2EjBi2UOqJAmqhz85I1GOP6yg6zQTo4tWqKF+VnTwZJ5Vk9smOYr9sVO8In50 NDYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maquefel.me header.s=mail header.b=Kg0Rp1ZB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si1442617ejm.65.2021.07.26.05.00.42; Mon, 26 Jul 2021 05:01:05 -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=@maquefel.me header.s=mail header.b=Kg0Rp1ZB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233729AbhGZLSn (ORCPT + 99 others); Mon, 26 Jul 2021 07:18:43 -0400 Received: from forward102o.mail.yandex.net ([37.140.190.182]:40754 "EHLO forward102o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233606AbhGZLSn (ORCPT ); Mon, 26 Jul 2021 07:18:43 -0400 Received: from iva8-34fb5df223d4.qloud-c.yandex.net (iva8-34fb5df223d4.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:b999:0:640:34fb:5df2]) by forward102o.mail.yandex.net (Yandex) with ESMTP id F23336681AC5; Mon, 26 Jul 2021 14:52:12 +0300 (MSK) Received: from iva6-2d18925256a6.qloud-c.yandex.net (iva6-2d18925256a6.qloud-c.yandex.net [2a02:6b8:c0c:7594:0:640:2d18:9252]) by iva8-34fb5df223d4.qloud-c.yandex.net (mxback/Yandex) with ESMTP id iUqqxXqB0d-qCHe0deu; Mon, 26 Jul 2021 14:52:12 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1627300332; bh=wrYpi7Lb3bPjDh2wgnPPsmcJxdCvpxYqsSBC4dQvxwE=; h=In-Reply-To:Message-Id:References:Date:Subject:To:From:Cc; b=Kg0Rp1ZB8LHBIQKvqXdI+108oirKG5Yjb+IXuAulSRKCtVgd/0B6WGsA113q9sB4I wVqNk4mT04s11eG1/x2ypfxY4ii4jdy/I4i0X7yz0WI/QNDVOFpRw2Gd53DGk2Ncbk rzc055RNydjPC8FjTNPtwQr3+FLdbaKvArAOdDXs= Authentication-Results: iva8-34fb5df223d4.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me Received: by iva6-2d18925256a6.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id PIKatQa27D-qB2S8kdK; Mon, 26 Jul 2021 14:52:11 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Nikita Shubin To: Alexander Sverdlin , Geert Uytterhoeven Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Kuninori Morimoto , alsa-devel@alsa-project.org (moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 6/8] ASoC: cirrus: i2s: Prepare clock before using it Date: Mon, 26 Jul 2021 14:50:50 +0300 Message-Id: <20210726115058.23729-7-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210726115058.23729-1-nikita.shubin@maquefel.me> References: <20210726115058.23729-1-nikita.shubin@maquefel.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Sverdlin 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 ... 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.26.2